Skip to main content
Glama
gh-search-mcp
by raystyle

search_code

Read-onlyIdempotent

Search public GitHub repositories for code using text queries and optional qualifiers, then paginate results. Private repository code is never returned.

Instructions

Search code in public GitHub repositories. Results from private repositories are never returned.

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": "search_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNo1-based page of results; start at 1.
limitNoMaximum number of results to return (1–50).
queryYesCode search text with optional qualifiers, e.g. `O_NOFOLLOW language:python`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, and open-world behavior, so the safety profile is covered. The description contributes the meaningful extra detail that private-repository results are excluded, but says nothing about authentication requirements, rate limits, or result shape.

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?

Two short sentences, with the scope constraint front-loaded, and no wasted wording. Every clause carries information.

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 simple three-parameter read-only search with full schema coverage and no output schema, the definition covers purpose and the key public-repository limitation. Remaining gaps such as auth or result formatting are minor, though the absence of explicit sibling routing keeps it from a 5.

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 already documents query, page, and limit with examples and bounds. The description adds no parameter-level meaning beyond that, making the baseline 3 appropriate.

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 states a specific verb and resource ('Search code') plus a scope qualifier ('public GitHub repositories'), which is enough to separate it from searching repositories or fetching file contents. It stops short of explicitly naming the sibling tools or contrasting itself with them.

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 public-only constraint ('Results from private repositories are never returned') implies a when-not condition, but there is no explicit guidance on when to choose this over search_repositories or get_file_contents. Usage is left to inference from the purpose statement.

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

Deploy Server

Other Tools