Skip to main content
Glama

RunUnitTest

Executes ABAP Unit tests for a specified class and returns the results; use async to wait within a bound for long suites or sync for a finished result in one request.

Instructions

[read-only] Runs the ABAP Unit tests of the ABAP class named by class_name and returns the result. runner async (default): the run is started and waited for within a bound, and a run that outlasts it returns its run_id, whose status and result are read by run_id; suited to long suites. runner sync: one request that returns the finished result. When runner is sync, recordable: in batch mode a call is recorded under the next number and answers with empty content; its answer is read by number after the batch ends.

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": {
      "class_name": "<class_name>"
    },
    "name": "RunUnitTest"
  }
}

Input Schema

NameRequiredDescriptionDefault
scopeNoWhich tests the run covers, sent with either runner. Foreign tests are test classes linked to the object by an ABAP Doc @testing relation (a function module's tests are often linked so). With runner sync they execute only with foreign_tests true: with the defaults (foreign_tests false, add_foreign_tests_as_preview true) SAP lists them as a preview, unexecuted. Runner async executes them with the defaults as well.
detailNoHow much of the answer to return: "terse" (default, the fields you need to act), "full" (the whole parse), "raw" (the document as ADT sent it).terse
runnerNoasync (default): starts the run, waits for it within a bound and returns the result, or the run_id of a run that outlasts the bound, whose status and result are read by run_id; suited to long suites. sync: one request that returns the finished result.async
class_nameYesClass whose tests run.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv20.1.0
    • addedInput schema / properties / runner
      Added value: +{
      +  "default": "async",
      +  "description": "async (default): starts the run, waits for it within a bound and returns the result, or the run_id of a run that outlasts the bound, whose status and result are read by run_id; suited to long suites. sync: one request that returns the finished result.",
      +  "enum": [
      +    "async",
      +    "sync"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / scope
      Added value: +{
      +  "description": "Which tests the run covers, sent with either runner. Foreign tests are test classes linked to the object by an ABAP Doc @testing relation (a function module's tests are often linked so). With runner sync they execute only with foreign_tests true: with the defaults (foreign_tests false, add_foreign_tests_as_preview true) SAP lists them as a preview, unexecuted. Runner async executes them with the defaults as well.",
      +  "properties": {
      +    "add_foreign_tests_as_preview": {
      +      "description": "List the foreign tests as a preview, unexecuted (default true).",
      +      "type": "boolean"
      +    },
      +    "foreign_tests": {
      +      "description": "Execute the foreign tests, those linked by an ABAP Doc @testing relation (default false).",
      +      "type": "boolean"
      +    },
      +    "own_tests": {
      +      "description": "Include the object's own tests (default true).",
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed9 schema fields changedv16.0.0
    • addedInput schema / properties / class_name
      Added value: +{
      +  "description": "Class whose tests run.",
      +  "type": "string"
      +}
    • removedInput schema / properties / context
      Removed value: -{
      -  "description": "Optional context string shown in SAP tools.",
      -  "type": "string"
      -}
    • addedInput schema / properties / detail
      Added value: +{
      +  "default": "terse",
      +  "description": "How much of the answer to return: \"terse\" (default, the fields you need to act), \"full\" (the whole parse), \"raw\" (the document as ADT sent it).",
      +  "enum": [
      +    "terse",
      +    "full",
      +    "raw"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / properties / duration
      Removed value: -{
      -  "properties": {
      -    "long": {
      -      "type": "boolean"
      -    },
      -    "medium": {
      -      "type": "boolean"
      -    },
      -    "short": {
      -      "type": "boolean"
      -    }
      -  },
      -  "type": "object"
      -}
    • removedInput schema / properties / risk_level
      Removed value: -{
      -  "properties": {
      -    "critical": {
      -      "type": "boolean"
      -    },
      -    "dangerous": {
      -      "type": "boolean"
      -    },
      -    "harmless": {
      -      "type": "boolean"
      -    }
      -  },
      -  "type": "object"
      -}
    • removedInput schema / properties / scope
      Removed value: -{
      -  "properties": {
      -    "add_foreign_tests_as_preview": {
      -      "type": "boolean"
      -    },
      -    "foreign_tests": {
      -      "type": "boolean"
      -    },
      -    "own_tests": {
      -      "type": "boolean"
      -    }
      -  },
      -  "type": "object"
      -}
    • removedInput schema / properties / tests
      Removed value: -{
      -  "description": "List of container/test class pairs to execute.",
      -  "items": {
      -    "properties": {
      -      "container_class": {
      -        "description": "Class that owns the test include (e.g., ZCL_MAIN_CLASS).",
      -        "type": "string"
      -      },
      -      "test_class": {
      -        "description": "Test class name inside the include (e.g., LTCL_MAIN_CLASS).",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "container_class",
      -      "test_class"
      -    ],
      -    "type": "object"
      -  },
      -  "type": "array"
      -}
    • removedInput schema / properties / title
      Removed value: -{
      -  "description": "Optional title for the ABAP Unit run.",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "tests"
      -]New value: +[
      +  "class_name"
      +]
  3. First observed

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so well: it declares read-only behavior, explains the async bound and run_id fallback, states that sync is a single request returning the finished result, and discloses the batch-mode empty-answer/recordable side effect. These are precisely the behavioral details an agent needs before invoking it.

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 the core action and scope, then explains runner modes and batch behavior efficiently. The single dense paragraph is information-dense but slightly hard to scan; every sentence still contributes necessary context.

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

Completeness4/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 explains the return shape sufficiently: the finished result, or a run_id for long-running async executions, plus how to read the answer after a batch. The remaining gap is that the internal structure of the 'result' is not described, but for a test-runner tool the key operational behavior is covered.

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 fully documents class_name, scope, detail, and runner. The description restates the runner semantics and adds the batch-mode recordable caveat, but adds little parameter-level meaning beyond what the schema provides.

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 ('Runs') and resource ('ABAP Unit tests of the ABAP class named by class_name'), immediately distinguishing it from the program/function-group/CDS unit test runners in the sibling list. An agent can tell what it does and which object type it targets without opening the schema.

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?

Gives clear guidance on choosing between runner async (suited to long suites) and runner sync, including the trade-offs and batch recordable caveat. It does not explicitly name alternatives such as GetUnitTestResult for retrieving an async run, but the implied workflow is understandable.

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

Deploy Server

Other Tools