Skip to main content
Glama

Map a file's dependency neighborhood

map_dependencies

Trace a file's imports, reverse imports, and connected tests with path and line evidence. Scans JavaScript/TypeScript to reveal static dependencies with explicit limits.

Instructions

Find a file's local imports, reverse imports and tests connected by imports. Each relationship includes a source path and line as evidence. Static file relationships, not runtime callers or test coverage. Scans JavaScript/TypeScript including tests, with bounded work and explicit unresolved imports and scan limits. Deterministic; no provider call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesSource file, absolute or relative to directory
depthNoImport hops in each direction, default 1
limitNoTotal neighboring files to return, default 50
maxFilesNoMaximum source files to discover, default 1000
directoryYesProject directory; source outside this directory is excluded

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.2

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses determinism ('no provider call'), bounded work, and explicit handling of unresolved imports and scan limits. It implies a read-only analysis by describing static relationships. It could explicitly state that it does not modify files, but the nature of the tool strongly implies it. This is good transparency for a tool with no annotation safety hints.

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 sentences, no filler. The main purpose is front-loaded, followed by scope and behavior clarifications. Every sentence adds value: purpose, exclusions and language, and determinism/limits. It is concise and well-structured for an agent to quickly grasp.

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?

Given the tool's moderate complexity (5 params, no output schema), the description covers purpose, scope, exclusions, behavior (deterministic, bounded), and even mentions output evidence ('source path and line'). It does not describe the exact return structure or error handling, but for a static analysis tool that is not overly complex, this is reasonably complete.

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 the schema already documents each parameter (depth, limit, maxFiles, directory, file). The description adds only a general mention of 'bounded work and explicit unresolved imports,' which indirectly relates to parameters but does not introduce new semantics beyond the schema. Baseline of 3 is appropriate since the schema does the heavy lifting.

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?

The description opens with a precise verb and resource: 'Find a file's local imports, reverse imports and tests connected by imports.' It further distinguishes itself from siblings by explicitly stating it deals with static file relationships, not runtime callers or test coverage, and specifies the language scope (JavaScript/TypeScript). This clearly sets it apart from tools like predict_failures or analyze_logs.

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 provides a clear exclusion: 'not runtime callers or test coverage,' which tells the agent when not to use it. It also notes the bounded work and scan limits, implying a use case of controlled analysis. However, it does not explicitly name alternative tools for the excluded scenarios, so guidance is slightly implied rather than fully explicit.

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