MCPcopy Index your code
hub / github.com/anomalyco/opencode / resources

Function resources

packages/opencode/src/mcp/catalog.ts:129–135  ·  view source on GitHub ↗
(client: Client, timeout?: number)

Source from the content-addressed store, hash-verified

127}
128
129export function resources(client: Client, timeout?: number) {
130 if (!client.getServerCapabilities()?.resources) return Promise.resolve([])
131 return paginate(
132 (cursor) => client.listResources(cursor === undefined ? undefined : { cursor }, { timeout }),
133 (result) => result.resources,
134 )
135}
136
137export function resourceTemplates(client: Client, timeout?: number) {
138 if (!client.getServerCapabilities()?.resources) return Promise.resolve([])

Callers 1

createPromptStateFunction · 0.85

Calls 3

paginateFunction · 0.85
getServerCapabilitiesMethod · 0.45
listResourcesMethod · 0.45

Tested by

no test coverage detected