Skip to main content
Glama

Fix ABAP automatically (deterministic)

fix_abap
Read-onlyIdempotent

Apply abaplint's machine-applicable corrections to ABAP sources and return parser-guaranteed fixes; unfixable findings remain for review.

Instructions

Apply abaplint's own machine-applicable corrections to ABAP sources and return the corrected code: keyword casing, obsolete statements with defined modern replacements (MOVE → =, and every other rule that ships a concrete edit), applied in verified batches — after each batch the result is re-parsed, and a batch that would break the parse is discarded, so the output is parser-guaranteed, never guessed. Findings WITHOUT a machine fix come back in remaining — those need judgment (yours or an agent's, proven afterwards with compare_abap). Use this when someone highlights code and wants it corrected to best practices / modern syntax instantly, as the mechanical first pass before any AI rewriting, or to modernize a file before review. It does not invent rewrites (only fixes abaplint defines), does not resolve cloud blockers that need re-architecture (dynpro, WRITE output — see plan_cloud_migration), and is not a formatter (format_abap pretty-prints without changing statements). Example: fix_abap({ "files": [ { "source": "report zdemo.\ndata lv_x type i.\nmove 5 to lv_x." } ] }).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYesSource files to analyze, up to 32 per call, 100k chars each.
rulesNoabaplint rule overrides merged onto the preset, e.g. { "keyword_case": { "style": "lower" } } — fixes follow your org's pack, same as lint_abap.
presetNoWhich ruleset supplies the fixes: "style" (default) fits isolated snippets; "full" expects all referenced objects provided; "syntax-only" yields no style fixes.style
abapVersionNoABAP language version to parse and fix against ("Cloud" for ABAP Cloud code).v758

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYes
fixedYesWhat was fixed (capped at 200 entries; fixedCount carries the total).
remainingYesFindings with no machine fix — judgment work; rework them and verify with compare_abap.
fixedCountYesTotal machine fixes applied.
iterationsYesFix batches applied (each batch re-parses before the next).
stoppedEarlyNoPresent when the safety valve discarded a batch or the batch cap was reached.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.12.4
    • addedInput schema / properties / rules / additionalProperties / anyOf
      Added value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "additionalProperties": {},
      +    "propertyNames": {
      +      "type": "string"
      +    },
      +    "type": "object"
      +  }
      +]
  2. Addedv0.10.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations cover safety (readOnlyHint, idempotentHint, openWorldHint=false), and the description adds substantial behavioral detail beyond them: corrections are applied in verified batches, each batch is re-parsed, a batch that would break the parse is discarded, and output is 'parser-guaranteed.' It also discloses what happens to non-fixable findings (returned in `remaining`). This is rich context not derivable from annotations.

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?

The core action and its guarantees are front-loaded before exclusions and the example. It is dense and long, with em-dash-heavy phrasing, but nearly every clause carries routing or behavioral information. Slightly more than strictly needed, hence not a 5.

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?

An output schema exists, so return values need not be explained, yet the description still clarifies the `remaining` output bucket. Combined with batch-verification behavior, exclusions, and a concrete example, an agent has everything needed to call it correctly for a nested, multi-param mutation-style fixer.

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 the schema already documents files, rules, preset, and abapVersion — the baseline is 3. The description's inline example illustrates the `files`/`source` shape but adds no syntax or format meaning beyond the schema. It does reference the preset merge behavior ('same as lint_abap') lightly, but parameter meaning is essentially schema-carried.

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+resource: applies abaplint's machine-applicable corrections to ABAP sources and returns corrected code. It explicitly distinguishes itself from siblings — not a formatter (format_abap), not re-architecture planning (plan_cloud_migration). An agent can route among lint_abap/format_abap/compare_abap 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use ('highlights code and wants it corrected', 'mechanical first pass before any AI rewriting', 'modernize a file before review') paired with explicit when-not ('does not invent rewrites', 'does not resolve cloud blockers that need re-architecture — see plan_cloud_migration', 'is not a formatter'). Alternatives are named with the condition that selects them.

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