Skip to main content
Glama

gh_search_code

Read-only

Search GitHub source code using GitHub's code search qualifiers to find specific functions, languages, and more.

Instructions

Search GitHub source code.

Supports all GitHub code search qualifiers (e.g. 'func name:main language:python').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
per_pageNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYes
queryYes
truncatedYes
total_countNo
Behavior4/5

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

Annotations already declare readOnlyHint and destructiveHint false, so the safety profile is covered. The description adds behavioral context by noting support for 'all GitHub code search qualifiers,' which informs query construction. It does not mention pagination or rate limits, but the annotations lower the bar for additional disclosure.

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 two sentences long, front-loaded with the core action, and includes a helpful example without any fluff. Every sentence earns its place.

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 read-only search tool with an output schema present, the description covers the essential behavior and query syntax. It omits details about pagination behavior, but these are inferable from the schema and the tool's straightforward nature. The example qualifier adds practical nuance.

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?

With 0% schema description coverage, the description must compensate. It provides a concrete example for the 'query' parameter, which is valuable. However, 'per_page' is not mentioned at all, and its meaning is only implicit from the schema type and default. Partial compensation warrants a middle score.

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?

The description clearly states 'Search GitHub source code,' which is a specific verb+resource pair. It distinguishes from sibling search tools (e.g., gh_search_repos, gh_search_issues) by explicitly targeting source code, and the qualifier example reinforces its unique scope.

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?

The description provides clear context that this tool searches source code, which implicitly guides selection among other search tools. However, it does not explicitly mention when not to use it or name alternative tools for non-code searches, so it stops short of a full 5.

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/fvanevski/gh_mcp'

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