Skip to main content
Glama

import_graph

Trace file-level import dependencies and importers, map directed edges with symbol counts, and follow chains up to three hops to analyze code impact.

Instructions

Returns file-level import dependency graph. Shows what a file imports, what imports it, or both. Returns nodes with symbol counts and directed edges. Follows import chains up to 3 hops deep.

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": {
      "file_path": "<file_path>",
      "repo": "<repo>"
    },
    "name": "import_graph"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoYesRepository name (as shown in list_repos)
depthNoImport hops to follow (1-3)
directionNoTraversal directionboth
file_pathYesRelative file path within the repository (e.g., 'src/main.py')

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.10.2

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does describe the return shape in useful terms (nodes with symbol counts, directed edges) and a traversal ceiling of 3 hops, which is genuine added context. However, it omits result-size/truncation behavior, error cases for bad paths, and any latency or scope caveats an agent would want before calling it.

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?

Four short sentences, front-loaded with the primary 'what it returns' statement before the directional and depth detail. The final sentence slightly restates the schema's maximum of 3 for depth, so it is not perfectly waste-free.

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?

For a read-only graph query with four fully documented parameters and no output schema, the description supplies the essential picture: node/edge structure, directionality, and the hop limit. Only secondary details like result truncation or failure modes are missing.

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 coverage is 100%, so the schema already documents repo, file_path, depth, and direction, including the 1-3 range and the enum values. The description reinforces the depth semantics ('up to 3 hops deep') and the direction concept but adds no format, default, or edge-case meaning beyond the structured fields.

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 opens with a specific verb and resource ('Returns file-level import dependency graph') and immediately enumerates the three queryable viewpoints (imports, importers, both). That makes the tool's function unambiguous without opening the schema, though it never contrasts itself with graph/inspection siblings such as cross_repo_impact or find_code.

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

Usage Guidelines3/5

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

Usage is only implied: an agent can infer this is the tool for dependency exploration, but there is no statement of when to prefer it over per-symbol or cross-repo tools, and no prerequisites or exclusions are given. The direction options hint at use cases without explicitly routing the agent.

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