rpc_call
Execute JSON-RPC methods on remote servers by specifying the server URL, method name, and parameters to interact with JSON-RPC APIs.
Instructions
Call any JSON-RPC method on a server with parameters. A user would prompt: Call method on with params
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | Yes | Server URL | |
| method | Yes | JSON-RPC method name to call | |
| params | No | Stringified Parameters to pass to the method |
Implementation Reference
- src/index.ts:93-109 (handler)The switch case handling 'rpc_call': extracts server URL, method, and params from arguments; creates HTTPTransport and Client from @open-rpc/client-js; calls the JSON-RPC method; returns the result as a text content block with formatted JSON.case "rpc_call": { const server = String(request.params.arguments?.server); const method = String(request.params.arguments?.method); const params = JSON.parse(String(request.params.arguments?.params)); let transport = new HTTPTransport(server); let client = new Client(new RequestManager([transport])); const results = await client.request({ method: method, params: params as any}); return { toolResult: { content: [{ type: "text", text: JSON.stringify(results, null, 2) }], isError: false } }; }
- src/index.ts:45-67 (registration)Registers the 'rpc_call' tool in the ListTools response, including its name, description, and inputSchema defining server (string, required), method (string, required), and optional stringified params.{ name: "rpc_call", description: "Call any JSON-RPC method on a server with parameters. A user would prompt: Call method <method> on <server url> with params <params>", inputSchema: { type: "object", properties: { server: { type: "string", description: "Server URL" }, method: { type: "string", description: "JSON-RPC method name to call" }, // this is a bit of a hack since claude seems to have issues with nested parameters params: { type: "string", description: "Stringified Parameters to pass to the method" } }, required: ["server", "method"] } },
- src/index.ts:48-66 (schema)Input schema for rpc_call tool: object with required 'server' and 'method' strings, optional 'params' as string (JSON stringified).inputSchema: { type: "object", properties: { server: { type: "string", description: "Server URL" }, method: { type: "string", description: "JSON-RPC method name to call" }, // this is a bit of a hack since claude seems to have issues with nested parameters params: { type: "string", description: "Stringified Parameters to pass to the method" } }, required: ["server", "method"] }