Skip to main content
Glama

code_research

Retrieves precise code snippets from a specified codebase using natural language queries, helping you understand how features are implemented.

Instructions

Retrieves precise code snippets related to the query from a specific codebase.
Use this to understand how features are implemented.

Args:
    query: Natural language question about the codebase
    directory: Path to the codebase directory to search
    limit: Maximum number of results to return (default: 5)

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>",
      "directory": "<directory>"
    },
    "name": "code_research"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
queryYes
directoryYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior2/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 says 'retrieves' (implying a read) but does not state whether the codebase must first be indexed via index_directory/sync_index, whether results are ranked semantically, or what happens when the directory is not indexed - a material omission given the sibling index-management tools.

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 sentences front-load the purpose, followed by a compact Args block; there is no filler. The only redundancy is restating the limit default already present in the schema.

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?

An output schema exists, so return format need not be explained. However, for a semantic code-search tool in a family with explicit indexing tools, the description omits the indexing prerequisite and any notion of result ranking, leaving a real gap for correct invocation.

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

Parameters4/5

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

Schema coverage is 0%, but the Args block documents all three parameters with meaning that the bare schema titles lack: query is a 'natural language question', directory is the codebase path to search, limit is the maximum number of results. Only the limit default duplicates the schema.

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?

It states a specific verb and resource - retrieving code snippets from a codebase for a query - and adds a purpose clause ('understand how features are implemented'). It does not explicitly distinguish itself from siblings like super_grep or get_symbol_definition, so the agent must infer the boundary from the 'natural language question' framing.

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?

'Use this to understand how features are implemented' gives an implied usage context, but there is no when-not guidance and no alternative named. The agent is left to guess whether to use this or super_grep/get_symbol_definition for a given question.

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