Skip to main content
Glama
shanejonas

openrpc-mpc-server

by shanejonas

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
NameRequiredDescriptionDefault
serverYesServer URL

Implementation Reference

  • 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"]
        }
      }
    ]
  • Input schema for rpc_discover tool: object with required 'server' string property.
    inputSchema: {
      type: "object",
      properties: {
        server: {
          type: "string",
          description: "Server URL"
        },
      },
      required: ["server"]
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions this is for discovery and references the OpenRPC Specification, it doesn't describe what the tool actually returns (method list, schema, etc.), error conditions, authentication requirements, or rate limits. The example prompt helps but doesn't fully explain behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two sentences. The first sentence states the technical implementation, and the second provides a helpful usage example. Both sentences earn their place, though the structure could be slightly more front-loaded with the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description should do more to explain what the tool returns. While it mentions discovery, it doesn't describe the response format, whether it returns method names, schemas, or other metadata. The example prompt helps but doesn't fully address output expectations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the single 'server' parameter as a URL. The description adds marginal value by implying this parameter should be a JSON-RPC server URL in the example, but doesn't provide additional format requirements or constraints beyond what's in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool uses JSON-RPC to call `rpc.discover` for server method discovery, which is a specific verb+resource combination. However, it doesn't explicitly distinguish this from its sibling tool `rpc_call`, which would handle actual RPC method calls rather than discovery.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context with the example prompt 'What JSON-RPC methods does this server have? <server url>', indicating when to use this tool. It doesn't explicitly state when NOT to use it or mention the alternative `rpc_call` tool, but the context strongly implies this is for discovery rather than execution.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/shanejonas/openrpc-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server