Skip to main content
Glama

find_import_cycles

Read-onlyIdempotent

Detect import cycles in a project's file-level import graph to find strongly-connected components that cause circular dependencies. Limit results with max_cycles for focused analysis.

Instructions

Detect import cycles (strongly-connected components) in the file-level import graph (Tarjan's).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNoProject name/path (default: active).
max_cyclesNoMaximum number of cycles to return (default 20, 0 = unlimited).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.0.0

TDQS

B3.1/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and openWorldHint=false, so safety is covered. The description adds no behavioral context beyond the algorithm name – it doesn't say how results are ordered, whether partial cycles are returned, or how max_cycles=0 affects output volume.

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?

A single front-loaded sentence with zero filler, correctly placing the verb and the clarifying parenthetical about SCCs and the algorithm.

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 two-param read-only diagnostic with no output schema, the description covers the what but not the output shape (list of cycles? nested structure?) or result ordering. Annotations handle the safety profile, so nothing critical is missing, but the return-value gap leaves the agent unsure how to consume the result.

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 baseline is 3. The description adds no parameter meaning beyond the schema's own documentation of 'project' and 'max_cycles' defaults and the unlimited-flag.

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?

States a specific verb (Detect) and resource (import cycles in the file-level import graph), plus names the algorithm (Tarjan's) and clarifies the output is strongly-connected components. This is much more specific than the sibling get_imports, though it doesn't explicitly contrast against it or find_dead_code.

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?

No guidance on when to use this tool versus siblings like get_imports, get_file_dependencies, or find_dead_code, which all touch the import graph. The agent must infer the diagnostic use case on its own.

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