Skip to main content
Glama

detect_circular_dependencies

Analyze import graphs to identify circular dependencies that cause initialization issues and maintenance problems in codebases.

Instructions

Analyze the import graph to detect circular dependencies between files. Circular dependencies can cause initialization issues, tight coupling, and maintenance problems. Returns all detected cycles sorted by length (shorter cycles are often more problematic).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNoOptional path prefix to limit analysis (e.g., 'src/features', 'libs/shared')
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 effectively describes key behavioral traits: it performs analysis on an import graph, returns detected cycles, and specifies that results are sorted by length with an explanation ('shorter cycles are often more problematic'). This adds valuable context beyond basic functionality, though it lacks details on performance, error handling, or data sources.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by explanatory context and output behavior. Every sentence adds value—explaining why circular dependencies matter and how results are organized—with no wasted words or redundancy.

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 tool's moderate complexity (analyzing dependencies), no annotations, and no output schema, the description is fairly complete. It covers what the tool does, why it's useful, and output formatting. However, it could improve by mentioning input requirements (e.g., file types supported) or error cases, leaving minor gaps in full contextual understanding.

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 has 100% description coverage, with the single parameter 'scope' documented as an 'Optional path prefix to limit analysis.' The description does not add any parameter-specific information beyond what the schema provides, so it meets the baseline of 3 for high schema coverage without compensating with extra details.

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 specific action ('Analyze the import graph to detect circular dependencies between files') and resource ('files'), distinguishing it from sibling tools like get_codebase_metadata or search_codebase. It explains the purpose beyond just the tool name by mentioning the analysis target and the problems circular dependencies cause.

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?

The description implies usage context by noting that circular dependencies 'can cause initialization issues, tight coupling, and maintenance problems,' suggesting when this tool might be useful. However, it does not explicitly state when to use it versus alternatives like get_component_usage or get_team_patterns, nor does it provide exclusions or prerequisites.

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/PatrickSys/codebase-context'

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