(
request: { method: string; params?: { cursor?: string } },
schema: { parse: (value: unknown) => unknown },
)
| 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++ |
no outgoing calls
no test coverage detected