rpc_discover
Discover available JSON-RPC methods by querying a server's OpenRPC specification to understand what functionality it provides.
Instructions
This uses JSON-RPC to call rpc.discover which is part of the OpenRPC Specification for discovery for JSON-RPC servers. A user would prompt: What JSON-RPC methods does this server have?
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | Yes | Server URL |
Implementation Reference
- src/index.ts:110-128 (handler)Handler for the rpc_discover tool. Extracts the server URL from arguments, creates an HTTPTransport and OpenRPC Client, calls rpc.discover method on the server, and returns the formatted result.case "rpc_discover": { const server = String(request.params.arguments?.server); if (!server) { throw new Error("Server is required"); } let transport = new HTTPTransport(server); let client = new Client(new RequestManager([transport])); const results = await client.request({ method: "rpc.discover" }); return { toolResult: { content: [{ type: "text", text: JSON.stringify(results, null, 2) }], isError: false } }; }
- src/index.ts:68-82 (registration)Tool registration in the ListToolsRequestHandler. Defines the name, description, and inputSchema (requiring 'server' URL) for the rpc_discover tool.{ name: "rpc_discover", description: "This uses JSON-RPC to call `rpc.discover` which is part of the OpenRPC Specification for discovery for JSON-RPC servers. A user would prompt: What JSON-RPC methods does this server have? <server url>", inputSchema: { type: "object", properties: { server: { type: "string", description: "Server URL" }, }, required: ["server"] } } ]
- src/index.ts:71-80 (schema)Input schema for rpc_discover tool: object with required 'server' string property.inputSchema: { type: "object", properties: { server: { type: "string", description: "Server URL" }, }, required: ["server"] }