Skip to main content
Glama

Apply machine-applicable diagnostic fixes

fix
Read-onlyIdempotent

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. Of several alternative fixes on one diagnostic it applies the one archlang fix takes. Returns { ok, passes, applied, skipped, source }.

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": {
      "source": "<source>"
    },
    "name": "fix"
  }
}

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 observed

TDQS

A4.4/5.0
Behavior5/5

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

Goes well past the annotations, which only declare it non-destructive and idempotent. The description adds the iteration cap ("at most 4 passes"), a rollback safety rule ("rolls back a pass that raises the error count"), the fix-selection tie-break matching the `archlang fix` CLI, and the escalation path for `unsafe`. The apply-and-return-source framing is consistent with `readOnlyHint: true`.

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-loaded with the action and scope, then scoping contrast, then safety semantics, then return shape — a sensible progression with no filler. The parenthetical example list ("an opening off its wall... an out-of-range position is clamped, …") is slightly cryptic and relies on an ellipsis, which costs a point.

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?

There is no output schema, and the description compensates by naming every returned field ("{ ok, passes, applied, skipped, source }"). Combined with the pass limit, rollback rule, and sibling boundary, an agent has everything needed to call it correctly and interpret the result.

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%, with both `source` and `unsafe` already documented in-schema, so the baseline is 3. The description echoes the `unsafe` meaning ("also applies `maybe-incorrect` fixes") and adds the alternative-fix selection rule, but says nothing extra about `source` formatting or size limits.

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 object ("Apply the machine-applicable fixes attached to a plan's compile diagnostics") plus the return ("return the edited source"). It explicitly carves out scope against the sibling `repair` ("furniture geometry is `repair`'s job"), so an agent can distinguish the two 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?

Makes the selecting condition concrete: use this for source-level faults arising from a plan's compile diagnostics, use `repair` for furniture geometry. It also explains when to set `unsafe:true`. What's missing is an explicit instruction about sequencing (e.g. needing `compile` first to produce the diagnostics), so it stops just short of full when/when-not coverage.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.