Skip to main content
Glama

map_code

Read-onlyIdempotent

Maps every symbol in an ingested code file to its line range, so you can find where to look without reading the whole file.

Instructions

Skeleton of one ingested code file: every symbol with its line range. Use instead of reading the whole file when you only need to know WHERE to look. Self-heals against the local file if CM_CODE_ROOT is set.

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": {
      "path": "<path>"
    },
    "name": "map_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, so the bar is low, and the description still adds a genuinely non-obvious trait: it self-heals against the local file when CM_CODE_ROOT is set. The caveat is that "self-heals" is jargon and never says what is refreshed, whether the index is written, or what happens when CM_CODE_ROOT is unset.

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-loaded with the output shape and followed by the routing advice, with no filler. Minor cost: the final sentence's vague "self-heals" phrasing spends words without resolving meaning.

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 one-parameter read tool with no output schema, the description covers what is returned (symbols and line ranges) and the main selection cue. It leaves out error/empty behavior for files that were never ingested and the path-resolution rule tied to CM_CODE_ROOT, both of which an agent needs before calling.

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?

The single required parameter has 0% schema description coverage and the description never explains it: "path" is only implied by "one ingested code file." It does not state whether the path is absolute, relative to CM_CODE_ROOT, or must match the identifier used at ingest time, which is exactly the ambiguity an agent would hit on first call.

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?

"Skeleton of one ingested code file: every symbol with its line range" names a concrete output artifact (symbols + line ranges) for a specific resource (one file), which is clearly distinct from search_code or get_symbol. It does not name those siblings explicitly, so differentiation is inferred from the output shape rather than stated.

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?

"Use instead of reading the whole file when you only need to know WHERE to look" gives an explicit trigger condition and the alternative it replaces. It does not say when NOT to use it (e.g., when you already know the symbol name and should use get_symbol, or when the file was never ingested), so the guidance is one-sided.

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