Skip to main content
Glama

DeleteLocalTypes

Clears local type definitions from an ABAP class's implementation include. Manages object locking and optional activation.

Instructions

Delete local types from an ABAP class by clearing the implementations include. Manages lock, update, unlock, and optional activation.

Input Schema

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

Implementation Reference

  • The main handler function `handleDeleteLocalTypes` that executes the DeleteLocalTypes tool logic: creates ADT client, deletes local types via the client, optionally activates the class, and returns result.
    export async function handleDeleteLocalTypes(
      context: HandlerContext,
      args: DeleteLocalTypesArgs,
    ) {
      const { connection, logger } = context;
      try {
        const {
          class_name,
          transport_request,
          activate_on_delete = false,
        } = args as DeleteLocalTypesArgs;
    
        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 types for ${className}`);
    
        try {
          const localTypes = client.getLocalTypes();
          const deleteResult = await localTypes.delete({
            className,
            transportRequest: transport_request,
          });
    
          if (!deleteResult) {
            throw new Error(`Delete did not return a result for ${className}`);
          }
    
          if (activate_on_delete) {
            await client.getClass().activate({ className });
          }
    
          logger?.info(`✅ DeleteLocalTypes 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 types deleted successfully from ${className}.`,
              },
              null,
              2,
            ),
          } as AxiosResponse);
        } catch (error: any) {
          logger?.error(
            `Error deleting local types for ${className}: ${error?.message || error}`,
          );
    
          let errorMessage = `Failed to delete local types: ${error.message || String(error)}`;
    
          if (error.response?.status === 404) {
            errorMessage = `Local types 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 the tool name 'DeleteLocalTypes', inputSchema (class_name required, transport_request optional, activate_on_delete optional with default false), and description.
    export const TOOL_DEFINITION = {
      name: 'DeleteLocalTypes',
      available_in: ['onprem', 'cloud', 'legacy'] as const,
      description:
        'Delete local types from an ABAP class by clearing the implementations include. Manages lock, update, unlock, and optional activation.',
      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.',
          },
          activate_on_delete: {
            type: 'boolean',
            description: 'Activate parent class after deleting. Default: false',
            default: false,
          },
        },
        required: ['class_name'],
      },
    } as const;
  • TypeScript interface `DeleteLocalTypesArgs` defining arguments for the handler.
    interface DeleteLocalTypesArgs {
      class_name: string;
      transport_request?: string;
      activate_on_delete?: boolean;
    }
  • Import of TOOL_DEFINITION (aliased as DeleteLocalTypes_Tool) and handleDeleteLocalTypes from the handler file into HighLevelHandlersGroup.
    import {
      TOOL_DEFINITION as DeleteLocalTypes_Tool,
      handleDeleteLocalTypes,
    } from '../../../handlers/class/high/handleDeleteLocalTypes';
  • Registration of DeleteLocalTypes_Tool and its handler (with context) in the HighLevelHandlersGroup tool list.
    {
      toolDefinition: DeleteLocalTypes_Tool,
      handler: withContext(handleDeleteLocalTypes),
    },
Behavior3/5

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

The description mentions that the tool manages lock, update, unlock, and optional activation, providing some behavioral insight. However, with no annotations, it could detail side effects, failure scenarios, or the exact impact on the class. The description gives a basic process but lacks depth.

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 very concise—two sentences, no unnecessary words. The first sentence states the primary action, and the second lists the managed steps. It is well-structured and front-loaded.

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 delete tool with no output schema and 3 fully documented parameters, the description provides sufficient context about its actions and process. However, it assumes ABAP-specific knowledge (e.g., 'implementations include') which might be opaque to an AI agent, but within the tool ecosystem it is likely adequate.

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?

The input schema has 100% description coverage, so the schema itself documents parameters. The description does not add additional meaning or context beyond what the schema provides, meeting the baseline.

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 action (Delete), the resource (local types from an ABAP class), and the method (by clearing the implementations include). It distinguishes itself from sibling tools like DeleteLocalDefinitions and DeleteLocalMacros.

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 description implies when to use the tool (to delete local types) but does not provide explicit guidance on when not to use or how to choose between alternatives like DeleteLocalDefinitions or DeleteLocalTestClass.

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