Skip to main content
Glama

ask_codebase

Read-only

Gathers the code, docs, and related commits most relevant to a plain-language question, returning numbered, cited sources for answering how something works or where it is handled.

Instructions

Gather the code and docs most relevant to a question, plus related commits, as numbered, cited sources. Use this to answer "how does X work?" or "where is Y handled?" questions. Answer from these sources only and cite each claim as path:start-end; open a source in full with read_lines. For filters, use search.

Input Schema

NameRequiredDescriptionDefault
kNoHow many results to return, 1 to 25.
repoNoName of an indexed repo, as list_repos shows it. Leave out when only one repo is indexed.
questionYesA question in plain words, e.g. "How are sessions expired?"

Output Schema

NameRequiredDescriptionDefault
repoYes
sourcesYes
questionYes
instructionsYes
related_commitsYesCommits whose messages match the question.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.2.1
    • addedInput schema / properties / k / description
      Added value: +"How many results to return, 1 to 25."
    • addedInput schema / properties / question / description
      Added value: +"A question in plain words, e.g. \"How are sessions expired?\""
    • addedInput schema / properties / repo / description
      Added value: +"Name of an indexed repo, as list_repos shows it. Leave out when only one repo is indexed."
  2. First observedv0.2.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint true and openWorldHint false, and the description adds real behavioral content on top: results arrive as numbered cited sources including related commits, claims must be cited as path:start-end, and there is an answer-from-sources-only rule. Output format is partly covered by the output schema, so the remaining detail is appropriate rather than a gap.

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?

The description is densely front-loaded, leading with what the tool does and following with usage rules and routing. It is compressed almost to note form, but every sentence carries an instruction and there is no filler.

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?

Annotations cover safety and an output schema exists, so the description does not need to explain returned structure. It still covers purpose, triggering conditions, citation format, and the alternatives, which is complete for a retrieval tool of moderate complexity; only the sourcing or ranking behavior is left implicit.

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%, so k, repo, and question are already documented, and the description adds no parameter-level detail. The baseline 3 is correct when the schema does all the work.

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?

States a specific verb and output: gather the code and docs most relevant to a question, plus related commits, returned as numbered cited sources. It is clearly distinguishable from search (filters) and read_lines (full source), both of which are named.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete triggering questions ("how does X work?", "where is Y handled?") and explicitly routes the agent elsewhere: use search for filters and read_lines to open a source in full. It also imposes an answering constraint (answer from these sources only), so the agent knows what the tool is for and what it is not.

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