Skip to main content
Glama

Review Swift concurrency and actor isolation

review_swift_concurrency

Detect Swift 6 concurrency and isolation defects in a Swift project, including missing @MainActor, unsafe Sendable, and data race risks. Use when reviewing code or migrating to Swift 6.

Instructions

Check a Swift project for Swift 6 concurrency and isolation defects: @Observable types missing @MainActor, Task.detached, DispatchQueue.main.async in async code, @unchecked Sendable, nonisolated(unsafe), unstructured Tasks in onAppear, empty catch blocks, and types named Task that shadow _Concurrency.Task. Use when reviewing Swift code, migrating to Swift 6, or diagnosing a data race.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the Swift project root (the folder containing Package.swift or the .xcodeproj).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
scoreYes0-100 defect density. 100 = no findings. penalty = 10*blockers + 3*serious + 1*minor; capacity = files*10. Comparable across runs on ONE project, not between projects.
countsYes
issuesYesEvery finding, most severe first.
summaryYesOne-line plain-language result.
suggestionsYesPrioritized next actions, deduplicated by rule — not a restatement of every issue's fix.
files_checkedYesSwift files actually scanned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.7.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It discloses the exact checks performed, including @Observable isolation, Task.detached, DispatchQueue.main.async in async code, @unchecked Sendable, nonisolated(unsafe), unstructured Tasks, empty catch blocks, and Task shadowing. This is substantive behavioral detail, though it does not explicitly state side-effect-free behavior or limitations.

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 front-loaded with the primary action and resource, followed by a compact comma-separated list of specific checks, and ends with concrete use cases. Every sentence and list item adds information; there is no fluff.

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?

The description covers what the tool checks protector and when to use it, and the output schema exists to define the return shape. Given a single path parameter and high schema coverage, the description is complete enough for an agent to select and invoke the tool correctly, though it could optionally clarify that the analysis is non-mutating.

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%, and the schema description for 'path' already specifies it as an absolute path to the Swift project root containing Package.swift or .xcodeproj. The tool description adds no additional parameter-level nuance, so baseline 3 is appropriate.

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 opens with a specific verb-resource pair, 'Check a Swift project for Swift 6 concurrency and isolation defects,' and then enumerates concrete defect categories. This clearly distinguishes it from sibling review_swift_* tools that target architecture, memory, security, performance, testing, and SwiftUI.

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?

The description explicitly states when to use the tool: 'reviewing Swift code, migrating to Swift 6, or diagnosing a data race.' It does not explicitly name alternatives or exclusions, but the domain-specific defect list and use cases give a clear selection context relative to sibling tools.

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