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

Function prompts

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

Source from the content-addressed store, hash-verified

119export const toolName = (clientName: string, name: string) => sanitize(clientName) + "_" + sanitize(name)
120
121export function prompts(client: Client, timeout?: number) {
122 if (!client.getServerCapabilities()?.prompts) return Promise.resolve([])
123 return paginate(
124 (cursor) => client.listPrompts(cursor === undefined ? undefined : { cursor }, { timeout }),
125 (result) => result.prompts,
126 )
127}
128
129export function resources(client: Client, timeout?: number) {
130 if (!client.getServerCapabilities()?.resources) return Promise.resolve([])

Callers 2

AuthPromptsViewFunction · 0.85
nextFunction · 0.85

Calls 3

paginateFunction · 0.85
listPromptsMethod · 0.80
getServerCapabilitiesMethod · 0.45

Tested by

no test coverage detected