Skip to main content
Glama

DeleteLocalTestClass

Deletes a local test class from an ABAP class by clearing the testclasses include, and optionally activates the parent class.

Instructions

Delete a local test class from an ABAP class by clearing the testclasses include. Manages lock, update, unlock, and optional activation of parent class.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
class_nameYesParent class name (e.g., ZCL_MY_CLASS).
transport_requestNoTransport request number (required for transportable objects).
activate_on_deleteNoActivate parent class after deleting test class. Default: false

Implementation Reference

  • Main handler function handleDeleteLocalTestClass - uses AdtClient.getLocalTestClass().delete() to delete local test class, with optional parent class activation.
    export async function handleDeleteLocalTestClass(
      context: HandlerContext,
      args: DeleteLocalTestClassArgs,
    ) {
      const { connection, logger } = context;
      try {
        const {
          class_name,
          transport_request,
          activate_on_delete = false,
        } = args as DeleteLocalTestClassArgs;
    
        // Validation
        if (!class_name) {
          return return_error(new Error('class_name is required'));
        }
    
        const client = createAdtClient(connection, logger);
        const className = class_name.toUpperCase();
    
        logger?.info(`Deleting local test class for ${className}`);
    
        try {
          // Delete local test class using AdtClient (updates with empty code)
          const localTestClass = client.getLocalTestClass();
          const deleteResult = await localTestClass.delete({
            className,
            transportRequest: transport_request,
          });
    
          if (!deleteResult) {
            throw new Error(
              `Delete did not return a result for local test class in ${className}`,
            );
          }
    
          // If activation requested, activate parent class
          if (activate_on_delete) {
            await client.getClass().activate({ className });
          }
    
          logger?.info(
            `✅ DeleteLocalTestClass completed successfully: ${className}`,
          );
    
          return return_response({
            data: JSON.stringify(
              {
                success: true,
                class_name: className,
                transport_request: transport_request || null,
                activated: activate_on_delete,
                message: `Local test class deleted successfully from ${className}.`,
              },
              null,
              2,
            ),
          } as AxiosResponse);
        } catch (error: any) {
          logger?.error(
            `Error deleting local test class for ${className}: ${error?.message || error}`,
          );
    
          // Parse error message
          let errorMessage = `Failed to delete local test class: ${error.message || String(error)}`;
    
          if (error.response?.status === 404) {
            errorMessage = `Local test class for ${className} not found.`;
          } else if (error.response?.status === 423) {
            errorMessage = `Class ${className} is locked by another user.`;
          }
    
          return return_error(new Error(errorMessage));
        }
      } catch (error: any) {
        return return_error(error);
      }
    }
  • TOOL_DEFINITION constant with name 'DeleteLocalTestClass', inputSchema (class_name required, transport_request optional, activate_on_delete optional bool), and availability spec.
    export const TOOL_DEFINITION = {
      name: 'DeleteLocalTestClass',
      available_in: ['onprem', 'cloud', 'legacy'] as const,
      description:
        'Delete a local test class from an ABAP class by clearing the testclasses include. Manages lock, update, unlock, and optional activation of parent class.',
      inputSchema: {
        type: 'object',
        properties: {
          class_name: {
            type: 'string',
            description: 'Parent class name (e.g., ZCL_MY_CLASS).',
          },
          transport_request: {
            type: 'string',
            description:
              'Transport request number (required for transportable objects).',
          },
          activate_on_delete: {
            type: 'boolean',
            description:
              'Activate parent class after deleting test class. Default: false',
            default: false,
          },
        },
        required: ['class_name'],
      },
    } as const;
  • TypeScript interface DeleteLocalTestClassArgs defining the shape of input arguments.
    interface DeleteLocalTestClassArgs {
      class_name: string;
      transport_request?: string;
      activate_on_delete?: boolean;
    }
  • Import of DeleteLocalTestClass_Tool (TOOL_DEFINITION) and handleDeleteLocalTestClass from handler file.
    import {
      TOOL_DEFINITION as DeleteLocalTestClass_Tool,
      handleDeleteLocalTestClass,
    } from '../../../handlers/class/high/handleDeleteLocalTestClass';
  • Registration of the tool in HighLevelHandlersGroup: maps toolDefinition: DeleteLocalTestClass_Tool to handler: withContext(handleDeleteLocalTestClass).
    {
      toolDefinition: DeleteLocalTestClass_Tool,
      handler: withContext(handleDeleteLocalTestClass),
    },
Behavior3/5

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

No annotations provided, so description must stand alone. It mentions managing lock, update, unlock, and optional activation, but does not disclose destructive nature, required authorizations, or error handling behavior.

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?

Two sentences efficiently convey the core action and supporting steps (lock, update, unlock) without unnecessary detail.

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

Completeness2/5

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

No output schema exists, yet description does not mention return values or success/failure indicators. Lacks information on what happens when the class does not exist or other error conditions.

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 descriptions in schema already explain parameters. The description adds minimal extra meaning beyond restating 'optional activation' for the activate_on_delete parameter.

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 clearly states the tool deletes a local test class from an ABAP class by clearing the testclasses include, distinguishing it from siblings like 'DeleteClass' which deletes the entire class.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives like 'UpdateLocalTestClass' or 'DeleteClass'. The description lacks context for selecting this tool over others.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fr0ster/mcp-abap-adt'

If you have feedback or need assistance with the MCP directory API, please join our Discord server