Skip to main content
Glama

ABAP Checks and Tests

abap_test
Read-onlyIdempotent

Check ABAP code with syntax checks and ATC/ABAP Unit where available without changing source; returns line:column errors and severity to validate code before saving.

Instructions

Check ABAP code: syntax check, ABAP Unit, ATC. Changes no source.

Actions (pass action plus that action's parameters; connectionId picks the system): • syntax — Run the SAP syntax check on source text you supply, in the context of an existing object, without saving or locking anything. Returns each message as line:column, severity and text, or a no-errors confirmation. Use it before abap_write(action: "write"); use abap_test(action: "atc") for quality checks on the saved object. Required: url, source. Optional: mainUrl.

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": {
      "action": "<action>"
    },
    "name": "abap_test"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoADT source URL of the object being checked (e.g. /sap/bc/adt/programs/programs/ZREPORT/source/main)
actionYesWhat to do: syntax (see the tool description)
sourceNoThe complete ABAP source to check, as it would be saved (not a fragment)
mainUrlNoADT URL of the main object. Default and almost always right: the object itself (url without /source/main) — also for function modules, includes and classes.
connectionIdNoSAP system connection ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv2.1.0
    • changedInput schema / properties / action / description
      Previous value: -"What to do: syntax, unit, atc (see the tool description)"New value: +"What to do: syntax (see the tool description)"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "syntax",
      -  "unit",
      -  "atc"
      -]New value: +[
      +  "syntax"
      +]
    • removedInput schema / properties / durations
      Removed value: -{
      -  "description": "unit: Only run test classes of these durations (default: all)",
      -  "items": {
      -    "enum": [
      -      "short",
      -      "medium",
      -      "long"
      -    ],
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • changedInput schema / properties / mainUrl / description
      Previous value: -"syntax: ADT URL of the main object. Default and almost always right: the object itself (url without /source/main) — also for function modules, includes and classes."New value: +"ADT URL of the main object. Default and almost always right: the object itself (url without /source/main) — also for function modules, includes and classes."
    • removedInput schema / properties / maxResults
      Removed value: -{
      -  "description": "atc: Maximum findings (default: 100)",
      -  "type": "number"
      -}
    • removedInput schema / properties / riskLevels
      Removed value: -{
      -  "description": "unit: Only run test classes of these risk levels (default: all)",
      -  "items": {
      -    "enum": [
      -      "harmless",
      -      "dangerous",
      -      "critical"
      -    ],
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • changedInput schema / properties / source / description
      Previous value: -"syntax: The complete ABAP source to check, as it would be saved (not a fragment)"New value: +"The complete ABAP source to check, as it would be saved (not a fragment)"
    • removedInput schema / properties / url / anyOf
      Removed value: -[
      -  {
      -    "description": "ADT source URL of the object being checked (e.g. /sap/bc/adt/programs/programs/ZREPORT/source/main)",
      -    "type": "string"
      -  },
      -  {
      -    "description": "ADT URL of the class or program that holds the tests (e.g. /sap/bc/adt/oo/classes/zcl_order_api)",
      -    "type": "string"
      -  },
      -  {
      -    "description": "ADT URL of the object to check (e.g. /sap/bc/adt/oo/classes/zcl_order_api, /sap/bc/adt/programs/programs/ZREPORT)",
      -    "type": "string"
      -  }
      -]
    • changedInput schema / properties / url / description
      Previous value: -"syntax: ADT source URL of the object being checked (e.g. /sap/bc/adt/programs/programs/ZREPORT/source/main) | unit: ADT URL of the class or program that holds the tests (e.g. /sap/bc/adt/oo/classes/zcl_order_api) | atc: ADT URL of the object to check (e.g. /sap/bc/adt/oo/classes/zcl_order_api, /sap/bc/adt/programs/programs/ZREPORT)"New value: +"ADT source URL of the object being checked (e.g. /sap/bc/adt/programs/programs/ZREPORT/source/main)"
    • addedInput schema / properties / url / type
      Added value: +"string"
    • removedInput schema / properties / variant
      Removed value: -{
      -  "description": "atc: ATC check variant name as configured in the system (default: DEFAULT)",
      -  "type": "string"
      -}
  2. Addedv2.0.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, but the description adds context beyond them: it says the check runs "without saving or locking anything" and "Changes no source", which tells the agent the supplied source is not persisted. It also discloses the return shape (each message as line:column, severity and text, or a no-errors confirmation), which the annotations do not cover.

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 summary line is front-loaded, followed by a single action bullet with required/optional parameters called out, so the agent can scan it quickly. The main inefficiency is the opening enumeration of ABAP Unit and ATC, which is not actionable and creates a false expectation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, and the description usefully compensates by describing the return format and the no-errors case, which suits a read-only checker. The description is not complete because of the mismatch between the advertised action set (syntax, ABAP Unit, ATC) and the single enum value, leaving the agent unsure which capabilities to expect.

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 explains url, source, mainUrl, connectionId and the action enum. The description restates the required/optional split ("Required: url, source. Optional: mainUrl") and adds the notion that source is checked in the context of an existing object, but adds little semantic detail beyond the schema, so the baseline of 3 applies.

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?

The description gives a specific verb and resource ("Run the SAP syntax check on source text you supply, in the context of an existing object") and distinguishes the check from abap_write, so the agent knows what the tool does. However, the opening line advertises three capabilities ("syntax check, ABAP Unit, ATC") while the only supported action is syntax, which overstates the tool's scope.

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?

It gives real routing guidance: run syntax before abap_write(action: "write"), and delegate quality checks to ATC. But that delegation points to abap_test(action: "atc"), an action this tool's enum does not accept, so the agent is directed toward an invalid invocation with no listed alternative.

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