Skip to main content
Glama

related_code

Returns symbols related to a given symbol by co-location, shared imports, or name similarity, helping discover nearby code and understand its context.

Instructions

Returns symbols related to a given symbol by co-location, shared imports, or name similarity. Useful for discovering nearby code and understanding context.

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": {
      "symbol_id": "<symbol_id>"
    },
    "name": "related_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
symbol_idYesSymbol identifier (from search_symbols or get_file_outline results)
max_resultsNoMaximum results to return

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.10.2

TDQS

B3.4/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 the three relation strategies and that this is a read ('Returns'), which is real behavioral content, but it says nothing about result ordering, whether relations are ranked across the three strategies, or how max_results truncation behaves.

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 with the core action front-loaded and zero wasted clauses. The trailing 'understanding context' phrase is slightly generic but does contribute a usage hint, so it largely earns its place.

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?

For a simple two-parameter read tool this covers the essentials, but with no output schema and no annotations the description should have sketched the returned symbol shape or ordering; that gap leaves the agent guessing at what it will receive.

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?

Schema description coverage is 100%, including the note that symbol_id comes from search_symbols or get_file_outline, and the 1-100 bounds on max_results. The description adds no parameter-level meaning beyond the schema, so the baseline 3 applies.

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 ('Returns symbols related to a given symbol') and names the three relation mechanisms (co-location, shared imports, name similarity), which is genuinely informative. It does not, however, differentiate itself from the sibling find_similar_code, whose name suggests substantial overlap, so an agent cannot fully disambiguate from the description alone.

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 second sentence ('Useful for discovering nearby code and understanding context') gives an implied use case but no explicit when-to-use/when-not criteria and no mention of an alternative such as find_similar_code or find_code. The agent must infer selection from the purpose statement rather than from stated guidance.

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