Skip to main content
Glama

Run ABAP Class (Console)

abap_run_class
Destructive

Executes an active ABAP class implementing IF_OO_ADT_CLASSRUN and returns its MAIN method's console output; use runId to collect output from long-running runs.

Instructions

Run a class that implements IF_OO_ADT_CLASSRUN (ADT's 'Run as ABAP Application (Console)') and return what its MAIN method wrote to OUT. Runs the class's current active version, in a session of its own. The class decides what happens — it can post documents and commit — so read it before running it. Never retried automatically after a lost session. A run that takes longer than waitSeconds keeps running in SAP and answers with a runId: call again with runId to wait for it and get the output.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "abap_run_class"
  }
}

Input Schema

NameRequiredDescriptionDefault
runIdNoCollect a run that was still going (from an earlier answer) instead of starting one.
classNameNoClass name, e.g. ZCL_MY_RUNNER. Must implement IF_OO_ADT_CLASSRUN and be active. Starts a new run.
waitSecondsNoHow long this call waits for the run to finish (default 25, max 40); the run itself keeps going.
connectionIdNoSAP system connection ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.16.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already flag destructive/openWorld/non-idempotent, and the description adds genuinely new behavioral facts beyond them: it runs in its own session, uses the active version, may commit and post documents, is never retried automatically after a lost session, and continues server-side past waitSeconds returning a runId. That is real disclosure an agent could not get from the annotations.

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?

Front-loaded with the core action and return value, followed by risk warning, retry caveat, and the timeout/runId continuation in descending order of importance. No filler sentences; every clause carries distinct information.

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?

With no output schema, the description still states what comes back (MAIN's OUT output, or a runId for in-flight runs) and covers session isolation, activity requirement, and side-effect risk. Nothing essential for correct invocation 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 coverage is 100%, so the individual parameters are documented; the description still adds the relational semantics between waitSeconds and runId (timeout returns a runId, which is then passed back to collect the still-running job). That state-machine context goes beyond the schema's isolated field descriptions.

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 names a specific verb and resource (run a class implementing IF_OO_ADT_CLASSRUN), ties it to the exact ADT menu action, and states precisely what is returned (OUT output from MAIN). The interface requirement alone distinguishes it from siblings like run_unit_tests or run_atc_analysis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

It gives clear conditions: the class must implement IF_OO_ADT_CLASSRUN and be active, the current active version is used, and it advises reading the source before running because the class may post documents and commit. It also explains the poll pattern via runId when waitSeconds expires. No sibling alternatives are named, which keeps it short of a 5.

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