Skip to main content
Glama

ai_guard_fix

Idempotent

Apply deterministic AI Guard autofixes to one JS/TS file and return a unified diff; write changes only when apply=true.

Instructions

Apply AI Guard deterministic autofixes to one JS/TS file. Returns a unified diff and writes nothing unless apply=true.

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": {
      "path": "<path>"
    },
    "name": "ai_guard_fix"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
applyNoWrite the fixes to disk
rulesNoOnly apply fixes from these rules
presetNoagent

Output Schema

NameRequiredDescriptionDefault
diffYes
fileYes
errorsYes
statusYes
appliedYes
changedYes
successYes
remainingYes
fixedCountYes
fixedRulesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations declare destructiveHint=false and idempotentHint=true, and the description usefully adds that fixes are deterministic, that a unified diff is returned, and that nothing is written unless apply=true. Scope is bounded ('one JS/TS file'). It does not say what happens on files with no fixable issues or whether partial fixes are possible.

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 action and scope, followed by the return shape and the safety default. No filler.

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?

An output schema exists so the diff return needn't be detailed, and annotations cover the safety profile; the description fills the key gap about default non-writing behavior. The unexplained preset/rules relationship is the main remaining hole for a 4-parameter mutation tool.

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 50%: apply and rules are documented in the schema, while path and preset are not. The description reinforces apply semantics ('writes nothing unless apply=true') but says nothing about preset values (recommended/strict/security/agent) or how rules interacts with preset.

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+resource ('Apply AI Guard deterministic autofixes to one JS/TS file'), which naturally separates it from the scan/check siblings that only read. It stops short of naming which sibling to run first or instead.

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 and by the 'writes nothing unless apply=true' dry-run default, which tells an agent it can safely preview. There is no explicit when-to-use/when-not guidance and no pointer to running a scan first or to ai_guard_verify_change after.

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