Skip to main content
Glama
Ray0907

Git MCP Server

by Ray0907

get_file_contents

Retrieve file or directory contents from GitHub or GitLab repositories by specifying repository, path, and optional branch/tag reference.

Instructions

Get the contents of a file or directory from a repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYesRepository identifier (GitLab: "group/project" or ID, GitHub: "owner/repo")
pathYesFile or directory path in the repository
refNoBranch name, tag, or commit SHA (default: default branch)
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 action but lacks critical details: whether it requires authentication, rate limits, what happens with non-existent paths, if it returns raw content or metadata, or if there are size limitations. For a read operation with zero annotation coverage, this leaves significant behavioral gaps.

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's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place, achieving ideal conciseness.

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's moderate complexity (fetching file/directory contents), lack of annotations, and no output schema, the description is insufficiently complete. It doesn't explain return values, error handling, authentication needs, or differences between file vs. directory responses. For a tool with 3 parameters and no structured safety hints, more contextual detail 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%, so the schema fully documents all three parameters (repo, path, ref) with clear descriptions. The description adds no additional parameter semantics beyond what's already in the schema, such as examples or edge cases. This meets the baseline for high schema coverage but doesn't enhance understanding.

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 verb 'Get' and the resource 'contents of a file or directory from a repository', making the purpose immediately understandable. It distinguishes itself from siblings like get_repository_tree (which lists files) and search_code (which searches content). However, it doesn't specify the exact format of the returned contents (e.g., raw text, metadata), which prevents a perfect score.

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

Usage Guidelines3/5

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

The description implies usage for retrieving file/directory contents, but provides no explicit guidance on when to use this tool versus alternatives like get_repository_tree (for listing) or search_code (for searching). There's no mention of prerequisites, error conditions, or specific scenarios where this tool is preferred, leaving usage context somewhat ambiguous.

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/Ray0907/git-mcp-server'

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