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

Method request

packages/opencode/test/mcp/lifecycle.test.ts:207–220  ·  view source on GitHub ↗
(
      request: { method: string; params?: { cursor?: string } },
      schema: { parse: (value: unknown) => unknown },
    )

Source from the content-addressed store, hash-verified

205 }
206
207 async request(
208 request: { method: string; params?: { cursor?: string } },
209 schema: { parse: (value: unknown) => unknown },
210 ) {
211 if (this._state) this._state.requestCalls++
212 if (request.method === "tools/list") {
213 return schema.parse(
214 this._state?.toolPages[request.params === undefined ? "initial" : (request.params.cursor ?? "")] ?? {
215 tools: this._state?.tools ?? [],
216 },
217 )
218 }
219 throw new Error(`unsupported request: ${request.method}`)
220 }
221
222 async listPrompts(params?: { cursor?: string }) {
223 if (this._state) this._state.listPromptsCalls++

Callers 15

initializeFunction · 0.45
newSessionFunction · 0.45
lifecycle.test.tsFile · 0.45
prepareNativeRequestFunction · 0.45
llm-native.test.tsFile · 0.45
share-next.test.tsFile · 0.45
requestFunction · 0.45
requestFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected