Skip to main content
Glama

loadProto

Load and retrieve content from Protocol Buffer (.proto) files within a specified directory using the MCP server's gRPC-based tools.

Instructions

Load a proto file and return its content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dirYesDirectory containing the proto file (e.g., /path/to/proto)

Implementation Reference

  • src/index.ts:44-59 (registration)
    Registration of the MCP tool 'loadProto', including inline input schema and handler function that calls loader.loadAsync on the provided directory and serializes the result to JSON string.
    server.addTool({
        name: "loadProto",
        description: "Load a proto file and return its content",
        parameters: z.object({
            dir: z.string().describe("Directory containing the proto file (e.g., /path/to/proto)"),
        }),
        execute: async (args) => {
            try {
                const res = await loader.loadAsync(args.dir);
                return obj2String(res, true);
            } catch (e) {
                Logger.error(e);
                return e instanceof Error ? e.message : "An unknown error occurred";
            }
        },
    });
  • Core implementation logic for loading and parsing proto files from a directory: fetches proto definitions, extracts service names and method lists, structures output as array of objects with path and services.
    async loadAsync(dir: string): Promise<Proto[]> {
        const proto = await protoLoader.loadAsync(dir);
        const result: Proto[] = [];
        for (const p of proto) {
            const services: Service[] = [];
            for (const s of p.protocolBuffer.services) {
                services.push({
                    name: s.name,
                    methods: s.methods.map(m => m.name),
                });
            }
            result.push({
                path: p.protocolBuffer.metadata.protoPath,
                services: services,
            });
        }
        return result;
    },
  • Helper function protoLoader.loadAsync that discovers all .proto files in the directory, loads each asynchronously using loadProtoAsync (which uses @grpc/proto-loader), and returns array of parsed package definitions used by the loader.
    async loadAsync(fileOrDir: string): Promise<ProtocolBufferPackageDefinition[]> {
        const files = await getFileAsync(fileOrDir, { extensions: [proto_ext] });
        const protoTask = files.map((file) => this.loadProtoAsync(file));
        return Promise.all(protoTask);
    }
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 basic operation but lacks critical details: whether this requires file system access permissions, what happens if the file doesn't exist, if there are size limitations, or what format the returned content takes. For a file-reading tool with zero annotation coverage, this is insufficient.

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 with zero wasted words. It's appropriately sized for a simple tool and front-loads the essential information without unnecessary elaboration.

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 file-reading tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'content' means (raw text, parsed structure, etc.), error conditions, or system dependencies. Given the complexity of file operations and lack of structured data, more behavioral context is needed.

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%, with the single parameter 'dir' well-documented in the schema. The description doesn't add any parameter-specific information beyond what the schema already provides, so it meets the baseline expectation when schema does the heavy lifting.

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 ('Load a proto file') and the outcome ('return its content'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from its siblings (getMethodInformation, sendRequest), which could have overlapping functionality with proto files.

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 getMethodInformation or sendRequest. There's no mention of prerequisites, constraints, or comparative use cases, leaving the agent without contextual usage instructions.

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