Skip to main content
Glama
xcode-analyzer-mcp

xcode-analyzer-mcp

by sunny-maeng

analyze_circular_dependencies

Detect circular dependencies in Xcode projects by analyzing Swift imports and Package.swift targets to expose module, file, or type-level cycles before they disrupt builds.

Instructions

Detect circular dependencies between modules/files in an Xcode project using Tarjan's SCC algorithm. Analyzes Package.swift targets and Swift import statements.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectPath": "<projectPath>"
    },
    "name": "analyze_circular_dependencies"
  }
}

Input Schema

NameRequiredDescriptionDefault
levelNoAnalysis level: 'module' for module-level, 'file' for file-level, 'type' for class/struct circular references and retain cycles (default: module)
projectPathYesPath to the Xcode project root directory
excludePatternsNoGlob patterns to exclude (e.g., ['**/Tests/**'])

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, but 'detect/analyze' clearly signals a non-mutating read analysis and it does disclose the algorithm and the analyzed inputs (Package.swift targets, Swift imports), which is useful context. It stops short of describing output shape, runtime cost on large projects, or what happens when the project path is invalid.

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?

Two tight sentences, front-loaded with the verb and resource, followed by the algorithmic and input details. There is no filler or redundant restatement of the title.

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 three-parameter, read-only analysis tool with no output schema, the definition covers what is analyzed and how, but leaves the return value undescribed and gives no sense of scale or failure behavior. That is adequate but not complete for an agent deciding whether to call it and how to interpret results.

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 all three parameters are already documented, including the 'level' enum values. The description adds only indirect context via 'between modules/files' and 'Package.swift targets', which loosely ties to the level and projectPath parameters without adding new semantics.

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 and resource: 'Detect circular dependencies between modules/files in an Xcode project', and adds the technique (Tarjan's SCC) plus the data sources (Package.swift targets and Swift imports). An agent can tell this is cycle detection rather than a general dependency listing, though it does not explicitly contrast itself with siblings like analyze_dependency_tree or detect_retain_cycles.

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?

There is no when-to-use or when-not-to-use guidance. The description never tells the agent to prefer detect_retain_cycles for retain cycles (even though the 'type' level mentions retain cycles) or analyze_dependency_tree for tree/inventory views, so routing must be inferred entirely from the name and purpose sentence.

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