Skip to main content
Glama
impact-mcp
by 0xmortuex

find_cycles

Detects import cycles in Python and JavaScript/TypeScript projects, listing each strongly connected component's shortest cycle file by file and flagging cycles softened by lazy or type-only imports.

Instructions

Import cycles: strongly connected components (Tarjan), each with its shortest cycle spelled out file by file, and whether the cycle is softened by lazy/type-only imports.

Input Schema

NameRequiredDescriptionDefault
limitNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose meaningful behavior beyond the schema: results are strongly connected components, each reduced to a shortest cycle listed file by file, plus a flag for whether lazy/type-only imports soften the cycle. It does not disclose analysis scope or how many components are returned before truncation, which keeps it below 5.

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?

A single dense sentence that front-loads the resource ('Import cycles') and then qualifies the output. The parenthetical '(Tarjan)' is useful shorthand, though 'spelled out file by file' is slightly awkward phrasing.

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?

The tool is simple (one optional param) and has an output schema, so return values need not be explained here; the description covers purpose and the key nuance of softened cycles. The only real omission is the limit parameter's meaning and default behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There is one parameter (limit, default 10) with 0% schema description coverage, and the description never mentions it — no indication that it caps the number of cycles reported or what happens when more exist. The description therefore does not compensate for the coverage gap.

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+resource ('Import cycles') and goes further by naming the algorithm (Tarjan SCCs) and the shape of each result ('shortest cycle spelled out file by file'). It is clearly distinct from siblings like dependencies or project_map, though it never names an alternative explicitly.

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 it is for circular-import investigation, but there is no statement of when to reach for this versus dependencies/dependents, nor any prerequisite or scope guidance (whole project vs a subtree).

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