Skip to main content
Glama

getMethodInformation

Retrieve detailed information about specific gRPC methods within a proto file by providing the file path, service name, and method name. Ideal for developers debugging or analyzing gRPC services.

Instructions

Get information about methods in a proto file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodYesMethod name (e.g., GetAddress)
pathYesPath to the proto file (Full path)
serviceYesService name (e.g., AddressService)

Implementation Reference

  • The core handler function that loads the protobuf definition from the given proto file path, searches for the specified service and method, and returns detailed information including request/response message names, associated messages, and enums.
    async getMethodAsync(path: string, service: string, method: string): Promise<Method | undefined> {
        const proto = await protoLoader.loadAsync(path);
    
        let result: Method | undefined = undefined;
        protocolBufferMethodForEach(
            proto.map((p) => p.protocolBuffer),
            (p, s, m) => {
                if (s.name === service && m.name === method) {
                    result = {
                        name: method,
                        request: m.requestMessageName,
                        response: m.responseMessageName,
                        messages: [...p.messages],
                        enums: [...p.enums],
                    };
                }
                return result !== undefined;
            },
        );
    
        return result;
    },
  • src/index.ts:61-78 (registration)
    Registers the MCP tool 'getMethodInformation' with the FastMCP server, including input schema validation via Zod and a thin execute wrapper that invokes the core handler and handles errors.
    server.addTool({
        name: "getMethodInformation",
        description: "Get information about methods in a proto file",
        parameters: z.object({
            path: z.string().describe("Path to the proto file (Full path)"),
            service: z.string().describe("Service name (e.g., AddressService)"),
            method: z.string().describe("Method name (e.g., GetAddress)"),
        }),
        execute: async (args) => {
            try {
                const res = await loader.getMethodAsync(args.path, args.service, args.method);
                return obj2String(res, true);
            } catch (e) {
                Logger.error(e);
                return e instanceof Error ? e.message : "An unknown error occurred";
            }
        },
    });
  • TypeScript type definition for the output structure returned by the getMethodInformation tool.
        name: string;
        request: string;
        response: string;
        messages: ProtocolBufferMessage[];
        enums: ProtocolBufferEnum[];
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'gets information', implying a read-only operation, but lacks details on permissions, error handling, rate limits, or output format. This is insufficient for a tool with three required parameters and no output schema.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized, making it easy to parse quickly.

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?

Given the tool has three required parameters, no annotations, and no output schema, the description is incomplete. It fails to explain what information is returned, how errors are handled, or any behavioral nuances, leaving significant gaps for agent understanding.

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?

The schema description coverage is 100%, with clear descriptions for all three parameters (method, path, service). The description does not add any semantic details beyond the schema, such as examples or constraints, so it meets the baseline for high schema coverage without extra value.

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 action ('Get information about') and the target resource ('methods in a proto file'), which is specific and unambiguous. However, it does not explicitly differentiate from sibling tools like 'loadProto' or 'sendRequest', which might handle proto files differently, so it misses full sibling distinction.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'loadProto' or 'sendRequest'. There is no mention of prerequisites, context, or exclusions, leaving the agent without direction on tool selection.

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/Yuki4-dev/grpc-mcp'

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