Skip to main content
Glama
github-fetcher

github-fetcher

by KurvCygnus

GitHub code search

github_search_code
Read-onlyIdempotent

Search code across GitHub repositories by query, repo, or path to locate symbols and snippets, with pagination and caching; cross-check recent changes when results are incomplete.

Instructions

Search code across GitHub. Requires a token; GitHub allows this endpoint only 10 requests/minute and caps results at 1000. The repo: and path: qualifiers are parsed from query and re-injected at the end. Returns {total_count, incomplete_results, items[{repo, path, sha, html_url, text_matches}], page, per_page, has_more, next_page}. GitHub's search index lags fresh pushes; recently changed symbols may be missing — cross-check with github_file_grep or github_file.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "github_search_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNoPage number, starting at 1
freshNoBypass the local cache
queryYesGitHub code search query
per_pageNoItems per page, 1-100, default 20

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • changedInput schema / properties / per_page / description
      Previous value: -"Items per page, default 20"New value: +"Items per page, 1-100, default 20"
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/openWorld, and the description layers on non-obvious behavior: token requirement, a 10 req/min endpoint limit, a hard 1000-result cap, index lag on fresh pushes, and the quirk that repo:/path: qualifiers are re-injected. That is exactly the context annotations cannot express.

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?

Front-loaded with purpose, then constraints, then return shape, then caveat — a sensible order. The literal object listing for the return value is dense but earns its space because no output schema exists; a slightly tighter phrasing would gain the last point.

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?

For a search tool with no output schema it covers rate limits, result caps, return fields, qualifier handling, and index staleness — nearly everything needed to call it correctly. The unaddressed items are the local cache and `fresh` parameter, plus how a token is supplied.

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 coverage is 100%, so baseline is 3; the description goes further by explaining how `query` is transformed (repo:/path: qualifiers parsed and re-appended) and by naming page/per_page in the return shape. It never mentions the `fresh` cache-bypass parameter, which is the one semantic gap.

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?

Opens with a specific verb and resource: 'Search code across GitHub.' The resource 'code' immediately distinguishes it from the sibling search tools (issues, repos, users), so an agent can route without opening the schema.

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?

Gives an explicit fallback with a condition: when the search index lags fresh pushes, 'cross-check with github_file_grep or github_file.' It does not state a general when-to-use/when-not rule (e.g. prefer github_file_grep for known paths), so it stops short of the full 5.

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