Skip to main content
Glama

CreateUnitTest

Creates local ABAP Unit test classes for an existing ABAP class from provided source and activates the class, enabling tests to be added or replaced outside batch mode.

Instructions

Creates the ABAP Unit test classes of the ABAP class named by class_name, from test_class_source. They are written as the class's local test classes, and the class is activated. Runs outside batch mode.

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>",
      "test_class_source": "<test_class_source>"
    },
    "name": "CreateUnitTest"
  }
}

Input Schema

NameRequiredDescriptionDefault
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
class_nameYesClass that holds the tests. Must already exist.
test_class_sourceYesABAP source of the local test classes: definitions and implementations, FOR TESTING. Replaces what the include holds.
transport_requestNoTransport request, not a task. Required for a transportable object.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv16.0.0
    • addedInput schema / properties / class_name
      Added value: +{
      +  "description": "Class that holds the tests. Must already exist.",
      +  "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"
      -}
    • addedInput schema / properties / test_class_source
      Added value: +{
      +  "description": "ABAP source of the local test classes: definitions and implementations, FOR TESTING. Replaces what the include holds.",
      +  "type": "string"
      +}
    • 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"
      -}
    • addedInput schema / properties / transport_request
      Added value: +{
      +  "description": "Transport request, not a task. Required for a transportable object.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "tests"
      -]New value: +[
      +  "class_name",
      +  "test_class_source"
      +]
  2. First observed

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and does disclose meaningful traits: it creates local test classes, activates the owning class, and runs outside batch mode. It does not explicitly state overwrite/replacement behavior in the description itself, though the schema's test_class_source parameter notes replacement of the include contents.

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?

The description is two tight sentences, front-loaded with the core action and resource. Every clause contributes useful information about output form, activation side effect, and execution mode.

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?

For a mutation tool with no annotations and no output schema, the description covers what is created, where it is written, the activation side effect, and the batch-mode constraint. It does not describe return values or error behavior, but the core invocation context is complete.

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 defines all four parameters clearly, including class_name, test_class_source, detail, and transport_request. The description names class_name and test_class_source but adds no additional 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?

The description uses a specific verb ('Creates') and names the exact resource ('ABAP Unit test classes of the ABAP class named by class_name') and source. It also clarifies that the created tests become the class's local test classes, which distinguishes it from broader unit-test tools such as CreateProgramUnitTest or UpdateUnitTest.

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?

The create semantics imply usage versus update/delete siblings, but the description does not explicitly say when to choose this tool over alternatives like UpdateUnitTest, UpdateLocalTestClass, or CreateProgramUnitTest. The class-activation and non-batch requirements are stated, which helps contextualize use.

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