Skip to main content
Glama

find_related_code

Read-only

Search a GitHub repository for identifiers, error messages, or phrases to find related code files before triaging an issue.

Instructions

Search the code of a repository for a term. Requires GITHUB_TOKEN because GitHub code search needs authentication.

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": {
      "repo": "<repo>",
      "query": "<query>"
    },
    "name": "find_related_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoYes
limitNo
queryYesIdentifier, error message or phrase to look for

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety and network profile is covered. The description adds real value by disclosing the authentication prerequisite, but omits other behavior an agent needs: code search's strict rate limits, whether results are truncated or capped by the tool, and whether a missing token fails at call time or setup time.

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?

Two short sentences, front-loaded with the core action and followed by the auth constraint — nothing is padded or redundant. It could carry one more sentence of substance without becoming bloated.

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?

With three parameters, low schema description coverage, and no output schema, the description should explain what comes back (matching files, snippets, line hits) and how results are bounded. It says nothing about returns or limits, leaving an agent unable to anticipate result shape or size.

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 description coverage is only 33%, so the description must compensate, and it does not. The 'term' phrasing loosely maps to the query parameter, but nothing explains the repo format (owner/name, only implied by a regex pattern with no description) or the limit parameter's default of 10 with a max 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?

The description gives a specific verb and resource: 'Search the code of a repository for a term.' That clearly separates it from the sibling issue-oriented tools (search_issues, get_issue, check_existing_fix), though it never explicitly names those alternatives or states the boundary.

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 precondition 'Requires GITHUB_TOKEN' is genuinely useful context for selecting the tool, but there is no when-to-use guidance relative to search_issues or get_issue, and no statement of when to avoid it (for example, unindexed repos or tiny repos where a file listing would suffice). Usage is implied rather than instructed.

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