Skip to main content
Glama

github_search_code

Search GitHub code using query syntax such as repo:owner/name terms, and set per_page to control returned results for locating relevant code snippets.

Instructions

搜索 GitHub 代码(需要配置 token)。

Args: query: 搜索语法,例如 "repo:AstrBotDevs/AstrBot mcp"。 per_page: 返回数量,1-100。

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
queryYes
per_pageNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations exist, so the description carries the full behavioral burden, and it only discloses the token requirement. It says nothing about rate limits, result caps, pagination, or how auth failures surface — significant gaps for a remote API call with zero annotation coverage.

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 one-line purpose plus a compact Args block; nearly every token carries information. The 'Args:' preamble is slightly redundant but harmless.

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

Completeness3/5

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

An output schema exists, so return values need not be explained. Still missing for a networked search tool: whether results are capped, whether total counts are returned, and what a missing/invalid token produces.

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 0%, so the description must compensate, and it does: it gives a concrete query-syntax example with 'repo:owner/name keyword' and adds the 1-100 range for per_page that the schema itself lacks (only a default of 20).

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 ('搜索 GitHub 代码'), which is clearly distinct from github_search_repos and github_get_file in the sibling list. It stops short of explicitly naming which sibling to prefer for repo-level vs code-level lookups.

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 parenthetical '(需要配置 token)' gives a real prerequisite and the query example demonstrates the syntax, which implies usage. However, it never says when to use this versus github_search_repos or github_get_file, and gives no exclusions.

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