Skip to main content
Glama

map_codebase

Scan a repository to build a dependency map of files linked through imports/exports, helping you assess connections and change impact before editing.

Instructions

Scans the entire codebase and builds a dependency map showing how all files are connected through imports/exports.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "map_codebase"
  }
}

Input Schema

NameRequiredDescriptionDefault
root_pathNoRoot directory to scan. Defaults to current working directory.
use_cacheNoWhether to use cache. Default true.
force_rescanNoForce full rescan even when cache exists.
exclude_patternsNoGlob patterns to exclude.
include_patternsNoGlob patterns for files to include.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full disclosure burden. It says the scan covers the 'entire codebase', hinting at cost, but never states whether this is read-only, how expensive or slow it is, whether it writes anything to disk, or what the resulting map looks like. For a whole-repo scan with zero annotation coverage, that is a meaningful 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?

One front-loaded sentence with no filler or redundancy. It is efficient, though its brevity is also the source of the missing usage and behavioral context.

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?

Five parameters, no annotations, and no output schema mean the description should ideally explain the shape of the returned dependency map and the cost of a full scan. It gestures at the return value ('showing how all files are connected through imports/exports') but leaves invocation cost and output structure largely 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 root_path, use_cache, force_rescan, and the include/exclude patterns are already documented in the schema. The description adds no meaning beyond that, which is acceptable but not additive; 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?

The description uses a specific verb and resource: 'Scans the entire codebase and builds a dependency map showing how all files are connected through imports/exports.' That is far more informative than a restated name. It does not, however, distinguish itself from siblings like get_structure or check_impact, which an agent could plausibly confuse with this tool.

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

Usage Guidelines2/5

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

There is no statement of when to use this tool versus check_impact, find_safe_files, or get_structure, and no exclusion criteria. The agent is left to infer that 'map everything' is the broad, expensive option. A single routing sentence would have resolved this.

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