Skip to main content
Glama

Apply machine-applicable diagnostic fixes

fix
Read-onlyIdempotent

Apply machine-applicable corrections from a plan's compile diagnostics to ArchLang source and return the edited code; unsafe mode also applies maybe-incorrect corrections.

Instructions

Apply the machine-applicable fixes attached to a plan's compile diagnostics and return the edited source. It corrects source-level faults (an opening off its wall becomes the attachment form, an out-of-range position is clamped, …); furniture geometry is repair's job. It runs at most 4 passes and rolls back a pass that raises the error count. unsafe:true also applies maybe-incorrect fixes. Returns { ok, passes, applied, skipped, source }.

Input Schema

NameRequiredDescriptionDefault
sourceYesArchLang source to fix.
unsafeNoAlso apply `maybe-incorrect` fixes (default: machine-applicable only).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Adds substantial context beyond the annotations: at most 4 passes, rollback of any pass that raises the error count, the unsafe opt-in semantics, and the exact return shape { ok, passes, applied, skipped, source }. This is exactly the kind of non-obvious behavior annotations cannot convey, and it is consistent with readOnlyHint/idempotentHint.

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?

Front-loads the core action in the first sentence and follows with scope, constraints, and return shape. Parenthetical examples ('an opening off its wall becomes the attachment form', 'an out-of-range position is clamped') are useful but slightly inflate the length.

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?

With only two flat parameters, no output schema, and full annotation coverage, the description still supplies the return-value shape, pass limits, and rollback semantics. Nothing an agent needs in order to call this correctly is missing.

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 both `source` and `unsafe` are already documented. The description's mention of `unsafe:true` and `maybe-incorrect` fixes largely restates the schema rather than adding new syntax or edge-case meaning, so baseline 3 is right.

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?

States a specific verb and resource: applies machine-applicable fixes from compile diagnostics and returns edited source. Explicitly separates itself from `repair` by saying furniture geometry is repair's job, so an agent can route between the two siblings without opening schemas.

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?

Names the alternative (`repair`) and the condition that selects it, and explains the `unsafe:true` opt-in for `maybe-incorrect` fixes. It does not state prerequisites such as running `compile`/`lint` first or the ordering relative to other siblings, so it falls short of full when/when-not guidance.

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