Skip to main content
Glama

Build import graph

build_import_graph

Extract intra-repo import relationships for JavaScript/TypeScript and Python. Returns a JSON graph where files are nodes and directed imports are edges, with auto-collapsing for large repositories.

Instructions

Extract intra-repo import/require relationships for JavaScript/TypeScript and Python. Nodes are files (auto-collapsed to module/directory level for large repos); edges are directed import relationships. Returns JSON.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute or relative path to the repository root
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 of behavioral disclosure. It reveals that nodes are auto-collapsed for large repos, edges are directed, and the result is JSON. These details go beyond a trivial statement and help the agent anticipate output structure. However, it does not mention whether the tool is read-only, performance implications, or side effects, but the nature of the task strongly implies a non-destructive analysis.

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?

The description is impressively concise, using two sentences to cover the core action, supported languages, node/edge behavior, auto-collapse rule, and return type. Every sentence adds value with no redundancy or fluff, and the main verb 'Extract' is front-loaded.

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 lack of an output schema, the description adequately explains the return value (JSON), node/edge representation, and the autoregressive collapsing behavior for large repos. It also specifies supported languages, which is a critical constraint. It could go further by describing an example output structure or handling of unsupported languages, but overall it is complete enough for a one-parameter tool.

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?

The input schema covers the single parameter (path) with a clear description of 'Absolute or relative path to the repository root' (100% coverage). The tool description does not add extra parameter semantics, so the baseline of 3 is appropriate since the schema already provides sufficient meaning.

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 clearly states the tool's function: extract intra-repo import/require relationships for JavaScript/TypeScript and Python. It specifies the resource (repo), the exact type of relationships (directed imports), and the output (JSON). It distinguishes itself from sibling tools like map_repo or generate_diagram by focusing on import graph extraction rather than generic mapping or visualization.

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?

The description provides no explicit guidance on when to use this tool versus alternatives like map_repo, scan_repo, or generate_diagram. It implies usage for import analysis but doesn't explain exclusions or mention that for diagram generation one should use generate_diagram. An agent is left to infer the use case, which is a clear gap.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/builditwithgk/repo-cartographer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server