Skip to main content
Glama
jesspig

git-mcp-server

by jesspig

git_grep

Read-onlyIdempotent

Find where a string or symbol appears in tracked files. Returns 'file:line:content' matches to locate usages in the codebase without a shell.

Instructions

Search tracked files for a pattern, returning 'file:line:content' matches. Use this to find where a string or symbol appears in the codebase — answering 'where is X used?' — without a shell. Best for: finding where a string appears in the codebase. Returns: 'file:line:content' matches, or 'No matches'. Pattern must not start with '-'; does NOT search commit messages or untracked files — use git_log with its grep filter for commit messages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNoFiles to search in; empty means all tracked files
patternYesSearch pattern; must not start with '-'
repo_pathNoPath to the git repository, defaults to '.' (the server working directory).
Behavior5/5

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

Annotations already mark it as read-only and idempotent, and the description adds important behavioral context: it only searches tracked files, requires the pattern not start with '-', returns 'No matches' when nothing is found, and excludes untracked files and commit messages. This gives the agent a complete picture of the tool's 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 efficient and front-loaded with the tool's core function. There is slight redundancy between 'Use this to find where a string or symbol appears' and 'Best for: finding where a string appears', but the extra detail about not using a shell and the git_log alternative keeps the description informative.

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

Completeness4/5

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

The description covers the essential details: what the tool searches, the output format, the no-match case, the pattern constraint, and exclusions. It does not mention whether the pattern is a regex or fixed string, but the tool is simple enough that this is not a critical omission.

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 input schema provides full descriptions for all three parameters, including the pattern restriction and repo_path default, so the description does not need to add much. The description adds no new parameter details beyond what the schema already covers, making this a baseline 3 given the 100% schema coverage.

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

Purpose5/5

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

The description clearly states the tool searches tracked files for a pattern and returns matches in 'file:line:content' format. It also directly addresses the common use case of finding where a string/symbol appears, and differentiates itself from git_log by explicitly stating it does not search commit messages.

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

Usage Guidelines5/5

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

The description provides explicit guidance: use this to find where a string appears in the codebase without a shell, and do not use it for commit messages or untracked files—instead use git_log with its grep filter. This clearly states when to use the tool and when to use an alternative.

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

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