Skip to main content
Glama
reflex-search

Reflex

Official

find_circular

Detects circular dependencies in static imports. Finds cycles like A→B→C→A to debug compilation issues and improve code architecture.

Instructions

Detect circular dependencies in the codebase.

Purpose: Find dependency cycles (A → B → C → A).

Pagination: Default limit of 200 results per page. Check response.pagination.has_more to fetch more pages.

Sorting: Default order is descending (longest cycles first). Use sort parameter to change.

Returns: Object with pagination metadata and array of cycles, where each cycle is an array of file paths forming the circular path.

Use this when:

  • Debugging circular dependency issues

  • Improving code architecture

  • Validating refactoring

IMPORTANT: Only detects cycles in static imports (string literals). Dynamic imports are filtered. See CLAUDE.md section "Dependency/Import Extraction" for details.

Note: Circular dependencies can cause compilation issues and indicate architectural problems.

Example output: {"pagination": {...}, "results": [{"paths": ["a.rs", "b.rs", "a.rs"]}]}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of cycles per page (default: 200)
offsetNoPagination offset (skip first N cycles). Use with limit for pagination.
sortNoSort order: 'asc' (shortest cycles first) or 'desc' (longest cycles first, default)
Behavior4/5

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

No annotations provided, so description carries full burden. Discloses pagination behavior (default limit 200, check has_more), sorting default (desc), return structure (object with pagination and array of cycles), and limitation to static imports.

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?

Well-structured with labeled sections (Purpose, Pagination, Sorting, etc.). Information is front-loaded and every sentence adds value. No redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Moderate complexity tool with 3 parameters, all covered. No output schema, but description explains return structure and provides example. Covers usage, behavior, limitations, and pagination comprehensively.

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

Parameters4/5

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

Schema coverage is 100%, but description adds value: default limit (200), default sort (desc), and how offset/limit work for pagination. Goes beyond what schema provides.

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?

Description explicitly states it detects circular dependencies in codebase, with clear purpose of finding dependency cycles. This distinguishes it from sibling tools like get_dependencies or find_references.

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

Usage Guidelines4/5

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

Lists specific use cases (debugging circular dependencies, improving architecture, validating refactoring) and includes important note about static imports only. Does not explicitly state when not to use, but context is clear.

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/reflex-search/reflex'

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