Skip to main content
Glama
PhialsBasement

GitHub MCP Server Plus

search_code

Search for code across GitHub repositories to find specific implementations, patterns, or functions within codebases.

Instructions

Search for code across GitHub repositories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYes
orderNo
pageNo
per_pageNo

Implementation Reference

  • The core handler function that executes the GitHub API search for code using the provided parameters.
    export async function searchCode(params: z.infer<typeof SearchCodeSchema>) {
      return githubRequest(buildUrl("https://api.github.com/search/code", params));
    }
  • Zod schema defining the input parameters for the search_code tool (SearchOptions, exported and aliased as SearchCodeSchema).
    export const SearchOptions = z.object({
      q: z.string(),
      order: z.enum(["asc", "desc"]).optional(),
      page: z.number().min(1).optional(),
      per_page: z.number().min(1).max(100).optional(),
    });
  • Alias for SearchOptions schema used in tool registration and parsing.
    export const SearchCodeSchema = SearchOptions;
  • index.ts:138-142 (registration)
    Tool declaration in the ListToolsResponse, registering the search_code tool with name, description, and input schema.
    {
      name: "search_code",
      description: "Search for code across GitHub repositories",
      inputSchema: zodToJsonSchema(search.SearchCodeSchema),
    },
  • index.ts:284-290 (registration)
    Dispatch handler in CallToolRequestHandler that parses arguments using SearchCodeSchema and invokes the searchCode function.
    case "search_code": {
      const args = search.SearchCodeSchema.parse(request.params.arguments);
      const results = await search.searchCode(args);
      return {
        content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
      };
    }
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states what the tool does at a high level ('Search for code across GitHub repositories') without revealing any behavioral traits like authentication requirements, rate limits, pagination behavior, error conditions, or what the search results look like. For a search tool with zero annotation coverage, this is completely inadequate.

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?

The description is a single, efficient sentence that gets straight to the point. There's no wasted verbiage or unnecessary elaboration. It's appropriately sized for a basic tool description, though this conciseness comes at the cost of completeness.

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

Completeness1/5

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

Given the complexity of a search operation with 4 parameters, no annotations, and no output schema, the description is completely inadequate. It doesn't explain what the tool returns, how results are structured, authentication requirements, rate limits, or parameter usage. For a search tool that likely returns complex results, this minimal description leaves the agent with insufficient information to use the tool effectively.

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

Parameters1/5

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

The description provides no information about parameters beyond what's implied by the tool name. With 0% schema description coverage and 4 parameters (q, order, page, per_page), the description doesn't explain what 'q' represents (search query syntax?), what 'order' sorts by, or how pagination works. The description fails to compensate for the complete lack of schema documentation.

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 clearly states the action ('Search for code') and resource ('across GitHub repositories'), which is specific and unambiguous. However, it doesn't differentiate this from sibling tools like search_issues, search_repositories, or search_users, which all perform different types of searches within GitHub.

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?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of when to choose search_code over other search tools (search_issues, search_repositories, search_users) or when to use it versus browsing tools like get_file_contents. The agent must infer usage from the name alone.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PhialsBasement/mcp-github-server-plus'

If you have feedback or need assistance with the MCP directory API, please join our Discord server