Skip to main content
Glama

Fix ABAP automatically (deterministic)

fix_abap
Read-onlyIdempotent

Correct ABAP code by applying abaplint's verified, machine-applicable fixes, returning parser-guaranteed modern syntax while leaving unfixable issues 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.
Behavior5/5

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

Even with readOnlyHint/idempotentHint annotations present, the description adds substantial behavioral context: fixes are applied in "verified batches" where each batch is re-parsed and any parse-breaking batch is discarded, so "the output is parser-guaranteed, never guessed". It discloses that unfixed findings surface in `remaining`, and that it "does not invent rewrites (only fixes abaplint defines)". The pure-function framing (source in → corrected code out) is consistent with readOnlyHint=true, so there is no contradiction.

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 long but every sentence earns its place: core action first, then the verification mechanism, the unfixed-findings contract, when to use, what it does not do with named alternatives, and a working example. There is no redundancy or filler; the structure flows logically from what → how → when → when-not → example.

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?

Given an output schema exists, the description need not document return values, yet it still pre-announces the `remaining` field. It covers scope (files, up to 32 per call via schema), the correctness guarantee, exclusions, sibling routing, and an example — complete for a 4-parameter tool with nested objects and two enums. Nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds value beyond the schema by giving a concrete invocation example ("fix_abap({ "files": [ { "source": ... } ] })") and by illustrating fix categories (keyword casing, MOVE → =) that help an agent anticipate what the `files`/`rules` parameters will produce. It does not elaborate on preset/abapVersion semantics, but the schema already documents those fully.

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 states a specific verb and resource — "Apply abaplint's own machine-applicable corrections to ABAP sources and return the corrected code" — and names the mechanism (deterministic, batched abaplint fixes). It explicitly distinguishes from siblings: "is not a formatter (format_abap pretty-prints without changing statements)" and points cloud-blocker work to plan_cloud_migration. An agent can tell exactly what this tool does and what it is not.

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 guidance: "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 also gives when-not-to-use with named alternatives — cloud blockers needing re-architecture go to plan_cloud_migration, and formatting goes to format_abap. Nothing is left to inference.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/palimkarakshay/abap-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server