Skip to main content
Glama

Import cycles

snapshot_cycles
Read-onlyIdempotent

Detect circular import cycles in a repository using the same resolver as the snapshot generator. Returns strongly connected components so you can find files that import each other in a loop.

Instructions

Strongly connected components in the import graph: files that import each other in a loop. Computed with the same resolver the generator uses, so a reported cycle is one the snapshot really has. Read-only.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "snapshot_cycles"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootNoRepository root. Defaults to the directory this server was started in.
outDirNoSnapshot directory, relative to the root, and it must resolve inside the served repository. Defaults to the project configuration's outDir.
maxComponentsNoCap on reported components (default 20).

Output Schema

NameRequiredDescriptionDefault
componentsNo
filesInCyclesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so 'Read-only' at the end is largely redundant. The genuinely additive content is the fidelity claim that cycles are computed with the same resolver the generator uses, so a reported cycle is real — that tells the agent results are trustworthy and not heuristic approximations.

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 short sentences, front-loaded with the core definition and followed by the accuracy guarantee and safety note. No filler and nothing that could be cut without losing information.

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?

With an output schema present, return values need not be explained, and the three zero-required parameters are simple scoping knobs. What remains missing is routing guidance relative to the dependency-listing siblings, which keeps it from a 5.

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 root, outDir and maxComponents are already fully documented in the schema, including defaults and the containment constraint on outDir. The description adds nothing about parameters, which is acceptable at the baseline of 3 when the schema does the work.

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 resource (strongly connected components in the import graph) and glosses it in plain terms ('files that import each other in a loop'), which is enough for an agent to distinguish it from neighbors/dependents-style siblings. It stops short of naming a contrasting sibling, so it lands at 4 rather than 5.

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: the agent can infer this is the tool for circular-import investigation, but there is no statement of when to pick this over snapshot_dependents or snapshot_neighbors, and no prerequisites or exclusions. Adequate but with a clear gap.

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