Skip to main content
Glama

search_code

Read-onlyIdempotent

Find where functions or classes are implemented by semantic query, returning file path and line range for each match so agents can locate the code handling a task.

Instructions

Semantic search inside the project's ingested code symbols (functions/classes/methods). Use for 'where is X implemented', 'which function handles Y'. Returns file path + line range per hit, with the indexing age.

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": "search_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoOptional: one file path
limitNo
queryYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile needs no restating. The description adds genuine value beyond that by defining the return shape (file path + line range per hit) and surfacing 'indexing age', which warns the agent about potentially stale results. It says nothing about ranking, result truncation, or behavior when indexing is incomplete.

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?

Three short sentences, front-loaded with purpose, then usage triggers, then return format. Every clause carries information and nothing is repeated from the schema or annotations.

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?

With three simple parameters, no output schema and full annotation coverage, the description covers purpose, triggers and return contents well. The remaining gap is the undocumented 'limit' parameter and any note on result ordering, which matters for an agent that expects the most relevant hit first.

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 coverage is only 33% – just 'path' is documented ('Optional: one file path') – so the description needed to carry the load and does not. It implies 'query' is a natural-language semantic query, but never explains 'limit' (default 5) or how many hits are returned and whether path scoping filters before or after semantic ranking.

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 ('Semantic search inside the project's ingested code symbols') and narrows scope to functions/classes/methods with concrete example questions. It does not name or distinguish itself from plausible siblings such as search_context or get_symbol, so it stops short of the top mark.

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?

It supplies explicit usage context via example intents ('where is X implemented', 'which function handles Y'), which tells an agent when to reach for it. It offers no exclusions or alternative-tool routing, and does not mention that get_symbol is the better pick when the exact name is already known.

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