Skip to main content
Glama
Akxan
by Akxan

Search code in a repository

github_search_code
Read-onlyIdempotent

Find specific code snippets in a GitHub repository by searching file contents with path, extension, or custom queries. Returns matching files with fragments for technical SEO analysis.

Instructions

Search file contents in one repository (GitHub code search syntax, e.g. 'og:image path:src', 'canonical extension:astro'). Returns matching files with fragments. Indexed for the default branch only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYesRepository as 'owner/name', e.g. 'octocat/my-site'.
limitNo
queryYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.1
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observedv0.3.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare the tool read-only, idempotent, and non-destructive. The description adds meaningful behavioral context: results include matching files with fragments, and the index only covers the default branch—an important limitation that affects expectations. No contradiction with annotations.

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?

Three short sentences front-load the core action, then add syntax examples, return shape, and the key indexing caveat. Every sentence earns its place and there is no filler.

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?

For a simple search tool with no output schema, the description covers what is returned, the scope, and the most important behavioral limitation. The schema covers required parameters and the limit constraint, while annotations cover safety and idempotence. Nothing critical is missing for an agent to invoke it correctly.

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 low at 33%, but the description partially compensates by giving concrete query syntax examples such as 'og:image path:src' and 'canonical extension:astro.' It does not add meaning to the repo or limit parameters beyond what the schema already provides via pattern, default, and range.

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?

States a specific verb and resource: 'Search file contents in one repository.' The examples of GitHub code search syntax make the operation concrete, and the phrase 'Returns matching files with fragments' differentiates it from sibling file tools like github_get_file or github_list_dir.

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

Usage Guidelines4/5

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

Provides clear context for when to use the tool: searching file contents within a single repository, with GitHub code search syntax. It does not explicitly name alternatives or exclusions, but the scoping phrase 'in one repository' and the 'default branch only' caveat make routing unambiguous.

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