Skip to main content
Glama

Search source text at an exact identity

code_grep
Read-only

Finds a literal string (no regular expressions) in the text files of a public GitHub repository at a commit sha or an npm package version, and returns the matches with path, line number, line text and the file's git blob id. A hit is a proven match in the exact bytes named. Counts of files scanned, binary files (a NUL byte or invalid UTF-8; never searched as text) and files over the per-file memory bound are reported, so nothing is silently left out. Pages with offset/limit: at most 1000 matches and about 1 MB per page (truncated:true when the byte bound ended a page); next_offset names the next page. Every answer, an error included, carries a pauhu-library-receipt/2 in structuredContent.receipt and as a trailing "receipt: {...}" text line; library_verify checks a receipt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoBranch, tag or 40-hex commit sha (default HEAD). It is resolved to a commit sha first; the read is at that sha.
pathNoOnly files under this directory prefix
repoNoGitHub repository as owner/name, e.g. nodejs/node. Give this or package.
limitNoMatches per page (default 200, at most 1000)
queryYesLiteral text to find
offsetNo
packageNonpm package name, e.g. source-map-js or @scope/name. Give this or repo.
versionNonpm version or dist-tag (default latest); the tarball is checked against the registry's sha512 integrity.
extensionsNoOnly files ending in one of these, e.g. [".ts", ".js"]
ignore_caseNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Goes far beyond the readOnlyHint/openWorldHint annotations: it guarantees nothing is silently omitted by reporting counts of scanned files, binary files (defined as NUL byte or invalid UTF-8, never searched as text) and oversized files, and it documents the truncation contract (1000 matches / ~1 MB per page, truncated:true, next_offset). It also explains that every response, including errors, carries a receipt in structuredContent and as a trailing text line, and that library_verify validates it.

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?

A single dense block but front-loaded correctly: the literal-match purpose comes first, followed by return shape, omission accounting, pagination, and receipt. Every sentence carries information, though bullets or line breaks would make the pagination and receipt clauses easier to scan.

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

Completeness5/5

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

With no output schema and 10 parameters, the description carries the return-format burden well: it names the match fields (path, line number, line text, blob id), explains pagination and truncation, and describes the receipt envelope. For a read-only search tool this is complete enough for an agent to call correctly, with the remaining gaps (auth, rate limits, repo-vs-package precedence) minor.

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

Parameters4/5

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

Schema description coverage is 80%, so the baseline is 3, and the description adds meaning on top: it explains the page-size defaults and hard cap (default 200, at most 1000), the 1 MB byte bound that can end a page early, and the role of next_offset. That said, it says nothing extra about ref resolution, path/extensions filtering, or repo-vs-package precedence beyond what the schema already documents.

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?

States a precise verb and resource: 'Finds a literal string ... in the text files of a public GitHub repository at a commit sha or an npm package version.' The parenthetical '(no regular expressions)' clearly differentiates it from a regex/semantic searcher, but it does not name sibling tools such as source_search or code_read to complete the disambiguation.

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?

Usage is implied rather than stated: the literal-match constraint and repo/package targeting tell the agent the kind of query this tool answers, but there is no explicit when-to-use, when-not-to-use, or preferred-alternative guidance relative to source_search or source_fetch_fragment.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources