Skip to main content
Glama

UpdateLocalTypes

Update local types in an ABAP class, managing lock, check, update, unlock, and optional activation.

Instructions

Update local types in an ABAP class (implementations include). Manages lock, check, update, unlock, and optional activation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
class_nameYesParent class name (e.g., ZCL_MY_CLASS).
local_types_codeYesUpdated source code for local types.
transport_requestNoTransport request number.
activate_on_updateNoActivate parent class after updating. Default: false

Implementation Reference

  • Main handler function that updates local types in an ABAP class. Uses AdtClient to manage lock, check, update, unlock, and optional activation.
    export async function handleUpdateLocalTypes(
      context: HandlerContext,
      args: UpdateLocalTypesArgs,
    ) {
      const { connection, logger } = context;
      try {
        const {
          class_name,
          local_types_code,
          transport_request,
          activate_on_update = false,
        } = args as UpdateLocalTypesArgs;
    
        if (!class_name || !local_types_code) {
          return return_error(
            new Error('class_name and local_types_code are required'),
          );
        }
    
        const client = createAdtClient(connection, logger);
        const className = class_name.toUpperCase();
    
        logger?.info(`Updating local types for ${className}`);
    
        try {
          const localTypes = client.getLocalTypes();
          const updateResult = await localTypes.update(
            {
              className,
              localTypesCode: local_types_code,
              transportRequest: transport_request,
            },
            { activateOnUpdate: activate_on_update },
          );
    
          if (!updateResult) {
            throw new Error(`Update did not return a result for ${className}`);
          }
    
          logger?.info(`✅ UpdateLocalTypes completed successfully: ${className}`);
    
          return return_response({
            data: JSON.stringify(
              {
                success: true,
                class_name: className,
                transport_request: transport_request || null,
                activated: activate_on_update,
                message: `Local types updated successfully in ${className}.`,
              },
              null,
              2,
            ),
          } as AxiosResponse);
        } catch (error: any) {
          logger?.error(
            `Error updating local types for ${className}: ${error?.message || error}`,
          );
    
          const detailedError = extractAdtErrorMessage(
            error,
            `Failed to update local types in ${className}`,
          );
          let errorMessage = `Failed to update local types: ${detailedError}`;
    
          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);
      }
    }
  • Input type interface UpdateLocalTypesArgs with class_name, local_types_code, transport_request, and activate_on_update fields.
    interface UpdateLocalTypesArgs {
      class_name: string;
      local_types_code: string;
      transport_request?: string;
      activate_on_update?: boolean;
    }
  • TOOL_DEFINITION export with tool name 'UpdateLocalTypes', description, and JSON Schema input definition.
    export const TOOL_DEFINITION = {
      name: 'UpdateLocalTypes',
      available_in: ['onprem', 'cloud', 'legacy'] as const,
      description:
        'Update local types in an ABAP class (implementations include). Manages lock, check, update, unlock, and optional activation.',
      inputSchema: {
        type: 'object',
        properties: {
          class_name: {
            type: 'string',
            description: 'Parent class name (e.g., ZCL_MY_CLASS).',
          },
          local_types_code: {
            type: 'string',
            description: 'Updated source code for local types.',
          },
          transport_request: {
            type: 'string',
            description: 'Transport request number.',
          },
          activate_on_update: {
            type: 'boolean',
            description: 'Activate parent class after updating. Default: false',
            default: false,
          },
        },
        required: ['class_name', 'local_types_code'],
      },
    } as const;
  • Import of handleUpdateLocalTypes and its TOOL_DEFINITION from the handler file into the HighLevelHandlersGroup.
    import {
      handleUpdateLocalTypes,
      TOOL_DEFINITION as UpdateLocalTypes_Tool,
    } from '../../../handlers/class/high/handleUpdateLocalTypes';
  • Registration of the UpdateLocalTypes tool definition and handler in the high-level handlers group array.
    {
      toolDefinition: UpdateLocalTypes_Tool,
      handler: withContext(handleUpdateLocalTypes),
    },
Behavior3/5

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

With no annotations, the description provides some behavioral context: it states it manages lock, check, update, unlock, and optional activation. However, it omits details on error handling, permissions, or return values.

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 concise sentences without unnecessary words. The first sentence states the core purpose, and the second adds key behavioral steps. No redundancy.

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

Completeness3/5

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

The description is somewhat complete for a simple update tool but lacks details on failure scenarios, output, and integration with transport system. Given no output schema and 4 parameters, more context would be helpful.

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%, so the schema already documents all parameters. The description adds no additional meaning beyond the schema; for example, it does not explain the format of 'local_types_code' or the role of 'transport_request'.

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 updates local types in an ABAP class, and the verb 'Update' along with resource 'LocalTypes' distinguishes it from siblings like DeleteLocalTypes or UpdateLocalDefinitions.

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 UpdateLocalDefinitions or UpdateLocalTestClass. The mention 'implementations include' is ambiguous and does not clarify usage context.

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