Skip to main content
Glama

Run ABAP Unit Tests

run_unit_tests

Executes ABAP Unit test classes for a class or program and reports each test method as passed or failed with alert details and a total, with optional risk-level and duration filters.

Instructions

Run the ABAP Unit test classes of an object and report each test method as passed or failed with its alert details, plus a total. A class with no method results is reported as unknown, not passed. By default runs all risk levels and durations; narrow with riskLevels and durations. Executes the test code on the SAP system, which can change data if the tests do; use abap_run_class to run a console class instead and run_atc_analysis for static checks.

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": {
      "url": "<url>"
    },
    "name": "run_unit_tests"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesADT URL of the class or program that holds the tests (e.g. /sap/bc/adt/oo/classes/zcl_order_api)
durationsNoOnly run test classes of these durations (default: all)
riskLevelsNoOnly run test classes of these risk levels (default: all)
connectionIdNoSAP system connection ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.16.2
    • changedInput schema / properties / url / description
      Previous value: -"ADT URL of the object containing unit tests"New value: +"ADT URL of the class or program that holds the tests (e.g. /sap/bc/adt/oo/classes/zcl_order_api)"
  2. First observedv1.16.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and openWorldHint=true, but the description adds the crucial nuance that test code actually executes on the SAP system and can mutate data if the tests do — a caveat that destructiveHint=false alone would understate. It also discloses a non-obvious reporting rule (empty result set = unknown, not passed). Remaining gap is minor: no note on runtime/volume expectations for long test runs.

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?

Four tight sentences, front-loaded with what it does and how it reports. Each subsequent sentence adds a distinct piece of information (unknown-status rule, filter defaults, execution side effects plus alternatives) with no repetition of the schema.

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?

No output schema exists, so the description carries the return-value burden and does so: per-method pass/fail with alert details, a total, and the unknown case. Combined with a fully documented input schema and annotations covering safety/open-world traits, an agent has everything needed to call this correctly.

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 coverage is 100% and the schema already documents url, durations, riskLevels, and connectionId including their 'default: all' behavior. The description restates the filter-default semantics and the enum values at a high level but adds no new meaning such as URL format requirements or how filters combine. Baseline 3 is appropriate when the schema does the heavy lifting.

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 and resource ("Run the ABAP Unit test classes of an object") and immediately defines the output shape: each test method as passed/failed with alert details plus a total. The 'unknown, not passed' rule and the explicit contrast with abap_run_class and run_atc_analysis make it unmistakable against siblings.

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 explicit when-to-use context (unit tests of an object), when-to-use-something-else (abap_run_class for console classes, run_atc_analysis for static checks), and how filtering defaults behave. Both named alternatives map to real sibling tools, so routing is unambiguous.

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