Skip to main content
Glama
xcode-analyzer-mcp

xcode-analyzer-mcp

by sunny-maeng

detect_unused_imports

Find potentially unused Swift import statements using heuristic analysis against a built-in framework symbol database to identify cleanup candidates.

Instructions

Detect potentially unused Swift import statements using heuristic analysis. Checks against a built-in symbol database for popular iOS frameworks (UIKit, RxSwift, SnapKit, etc.).

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": "detect_unused_imports"
  }
}

Input Schema

NameRequiredDescriptionDefault
confidenceNoConfidence filter: high=certain only, medium=likely, low=all suspects (default: medium)
projectPathYesPath to the Xcode project root directory
targetPathsNoSpecific files/directories to analyze (default: entire project)
excludePatternsNoGlob patterns to exclude

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/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. It does useful work by disclosing the heuristic nature and the built-in symbol database for 'popular iOS frameworks,' which tells the agent that frameworks outside that database may produce false negatives. It does not cover output format, whether results are advisory only, or performance on large projects.

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?

Two tight sentences, front-loaded with the primary action and followed by the mechanism that qualifies the result quality. Both sentences earn their place, though the parenthetical framework list could be trimmed.

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 four-parameter read-only analyzer with a fully documented schema and no output schema, the definition covers purpose and the key heuristic caveat. It leaves gaps on what is actually returned (file/line? counts?) and on how to interpret 'potentially,' which an agent needs to report results sensibly.

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 description coverage is 100%, so every parameter including the confidence enum is already documented in the schema. The description adds no syntax, default-behavior, or interaction detail (e.g., how confidence interacts with the symbol database), so baseline 3 applies.

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 — detecting 'potentially unused Swift import statements' — and names the mechanism (heuristic analysis against a built-in symbol database), which separates it from siblings like analyze_import_graph or detect_large_files. It stops short of explicitly naming a sibling it replaces.

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 implied by the verb: call it when you want to find unused imports in a Swift project. There is no explicit when-to-use/when-not-to-use statement, no mention of pairing it with a fixing tool, and no prerequisites such as a built project or resolved packages.

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