Skip to main content
Glama
hofill
by hofill

get_file

Retrieve a single file from the RequestRepo MCP server by specifying its path, with options to decode base64 content and limit file size for efficient handling.

Instructions

Get one file response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
decode_base64No
max_bytesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler implementation for get_file in RequestrepoMCPService class. Retrieves file from the requestrepo client and serializes the response using serialize_file_response helper.
    def get_file(
        self,
        *,
        path: str,
        decode_base64: bool = True,
        max_bytes: int | None = None,
    ) -> dict[str, Any]:
        response = self._client().get_file(path)
        return {
            "path": path,
            "file": serialize_file_response(
                response,
                decode_base64=decode_base64,
                max_bytes=self._resolved_max_bytes(max_bytes),
            ),
        }
  • MCP tool registration using @mcp.tool() decorator. Defines the get_file tool with parameters (path, decode_base64, max_bytes) and delegates to resolved_service.get_file().
    @mcp.tool()
    def get_file(path: str, decode_base64: bool = True, max_bytes: int = 65536) -> dict[str, Any]:
        """Get one file response."""
        return resolved_service.get_file(path=path, decode_base64=decode_base64, max_bytes=max_bytes)
  • Serialization helper that converts a requestrepo Response object into a dictionary. Handles base64 decoding when requested and creates a bytes envelope for UTF8 preview.
    def serialize_file_response(
        response: Response,
        *,
        decode_base64: bool,
        max_bytes: int,
    ) -> dict[str, Any]:
        payload: dict[str, Any] = {
            "raw_base64": response.raw,
            "headers": [serialize_header(header) for header in response.headers],
            "status_code": response.status_code,
        }
        if decode_base64:
            try:
                decoded = base64.b64decode(response.raw, validate=True)
            except binascii.Error as exc:
                payload["raw_decoded"] = None
                payload["decode_error"] = str(exc)
            else:
                payload["raw_decoded"] = bytes_envelope(decoded, max_bytes=max_bytes)
        return payload
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. 'Get one file response' implies a read operation but doesn't disclose important behavioral traits like whether this requires authentication, what happens with large files (given the max_bytes parameter), whether it's idempotent, what errors might occur, or what the 'response' format looks like. The description mentions 'response' but doesn't explain what that entails.

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 extremely concise at just four words, which could be appropriate if it were more informative. However, this brevity comes at the cost of under-specification rather than efficient communication. The single sentence is front-loaded but doesn't contain enough substance to justify its existence.

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 a file retrieval tool with 3 parameters, no annotations, and sibling tools that suggest a file management context, the description is inadequate. While an output schema exists (which reduces the need to describe return values), the description doesn't address the tool's role in the ecosystem, parameter purposes, or behavioral characteristics needed for safe and effective use.

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

Parameters2/5

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

With 0% schema description coverage and 3 parameters, the description provides no information about any parameters. It doesn't mention 'path', 'decode_base64', or 'max_bytes', leaving the agent to infer their purposes from schema titles alone. The description fails to compensate for the complete lack of parameter documentation in the schema.

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

Purpose2/5

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

The description 'Get one file response' is a tautology that essentially restates the tool name 'get_file'. It doesn't specify what type of file retrieval this performs (e.g., from filesystem, cloud storage, etc.) or how it differs from sibling tools like 'list_files' or 'set_file'. While 'get' implies retrieval, the description lacks specificity about what resource is being accessed.

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

Usage Guidelines1/5

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

The description provides no guidance about when to use this tool versus alternatives. It doesn't mention sibling tools like 'list_files' for multiple files or 'set_file' for writing files, nor does it indicate prerequisites, constraints, or appropriate contexts for use. The agent receives no direction about when this specific file retrieval method is appropriate.

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/hofill/RequestRepo-MCP'

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