Skip to main content
Glama

github_search_code

Search GitHub code using query syntax to locate files, patterns, and TODOs across repositories; read-only and requires GitHub code search permission.

Instructions

搜索代码(只读,需 GitHub 代码搜索权限)。

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": {
      "q": "<q>"
    },
    "name": "github_search_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
qYes代码搜索语法,如 "repo:owner/name language:js TODO"
pageNo
per_pageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden; it does disclose two useful traits: the operation is read-only and it requires GitHub code-search permission. It says nothing about result caps, pagination behavior, or rate limits, which matter for GitHub code search given the page/per_page parameters.

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 short sentence with no filler, and the read-only and permission caveats are packed in efficiently. It is arguably too thin rather than verbose, but conciseness itself is good.

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

Completeness2/5

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

For a tool with three parameters, no annotations, no output schema, and undocumented pagination, the definition is too sparse. It should explain pagination semantics, result limits, and how it differs from the other github_search_* tools.

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

Parameters2/5

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

Schema coverage is only 33%, so the description should compensate—yet it adds no parameter meaning at all. The query-syntax example it could have clarified already lives in the schema's q description, and page/per_page are undocumented in both places.

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 specific verb and resource (搜索代码 / search code) along with a scope qualifier (只读, needs code-search permission). The resource is distinguishable from github_search_issues and github_search_repositories, but the definition never explicitly contrasts itself with those siblings, leaving routing to inference.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance and no mention of the sibling search tools that cover issues and repositories. The only usage-adjacent information is the permission prerequisite, which is a requirement rather than selection guidance.

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