Skip to main content
Glama

Compare two ABAP versions

compare_abap
Read-onlyIdempotent

Compare BEFORE and AFTER ABAP sources to report lint fixes, cloud-readiness score changes, and structural changes. Use it to judge refactors, modernization, or AI rewrites objectively.

Instructions

Compare a BEFORE and an AFTER version of ABAP source and report what a rework actually changed: lint findings resolved and introduced (matched by content, so moved-but-unchanged code is not noise), cloud-blocker / score / A–D grade movement from the same dual-parse diff as check_cloud_readiness, and structural changes — classes, methods and FORMs added or removed. Use this when reviewing a refactor, a modernization step or an AI-generated rewrite of an existing object and you need an objective better-or-worse verdict instead of eyeballing a diff. It is not a textual diff tool (use git diff to see the edits) and it cannot judge functional equivalence — behavior can change while every number improves; it does not connect to any SAP system. Example: compare_abap({ "before": [ { "source": "REPORT zr.\nWRITE 1." } ], "after": [ { "source": "REPORT zr.\nWRITE 2." } ] }).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterYesThe AFTER sources — the reworked version being judged. Up to 32 files, 100k chars each.
focusNoCurated rule-pack lens: report only rules carrying this abaplint tag — "Performance" for a tuning pass, "Security" for a security sweep, "Styleguide" for Clean ABAP adherence. Parser errors always surface. Ignored with preset "syntax-only". Combine with rules to re-tune individual rules in the pack.
rulesNoabaplint rule overrides applied to both sides, e.g. { "line_length": { "length": 120 } }.
beforeYesThe BEFORE sources — the current/old version of the object(s). Up to 32 files, 100k chars each.
presetNoLint preset applied identically to both sides: "style" (default) for isolated snippets, "full" when every referenced object is provided, "syntax-only" for parser errors only.style
abapVersionNoABAP language version both sides are linted against. "v758" (default) is current on-prem; "Cloud" is ABAP Cloud.v758

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterYesLint and readiness numbers for the AFTER side.
beforeYesLint and readiness numbers for the BEFORE side.
resolvedYesFindings present before but gone after — improvements.
matchNoteYesHow findings were matched and what the numbers do and do not mean.
introducedYesFindings present only after — regressions to fix.
outlineChangesYes
unchangedCountYesFindings present on both sides (content-matched).

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. First observedv0.4.5

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover safety (readOnly, idempotent, not open-world), but the description adds context annotations cannot: matching by content so moved-but-unchanged code isn't noise, that the dual-parse diff mirrors check_cloud_readiness, and that it does not connect to any SAP system. The explicit caveat that behavior can change while every number improves is exactly the kind of trap-warning an agent needs.

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 what is compared and reported before the when-to-use and the exclusions. The dense sentence enumerating lint findings, score/grade movement, and structural changes is long but each clause carries distinct information; only the closing example could be trimmed without loss.

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?

For a six-parameter, nested-object, enum-heavy tool with an output schema, the description supplies triggers, exclusions, limitations, and a sample invocation, while correctly leaving return-value detail to the output schema. 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 parameter baseline is 3, and the description adds a worked example call showing the before/after array shape. It also flags the focus/preset interaction ('ignored with preset syntax-only'), though that detail is already in the schema text, so the extra value is modest.

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?

Opens with a specific verb+resource+scope (compare BEFORE/AFTER ABAP source) and enumerates the three concrete output categories it reports. It explicitly distinguishes itself from nearby siblings by name ('use git diff' and 'same dual-parse diff as check_cloud_readiness'), so an agent can route between it, lint_abap, and check_cloud_readiness 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?

Gives a positive trigger (reviewing a refactor, modernization step, or AI-generated rewrite) and a named alternative for the adjacent task ('It is not a textual diff tool (use git diff to see the edits)'). It also states what it cannot do — judge functional equivalence — which prevents the most likely misuse.

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