Skip to main content
Glama

UpdateLocalDefinitions

Update local definitions in an ABAP class by supplying new source code; automatically manages lock, check, unlock, and optional activation.

Instructions

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

Input Schema

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

Implementation Reference

  • Tool definition (schema) for UpdateLocalDefinitions — defines name, description, inputSchema with class_name, definitions_code, transport_request, activate_on_update.
    export const TOOL_DEFINITION = {
      name: 'UpdateLocalDefinitions',
      available_in: ['onprem', 'cloud', 'legacy'] as const,
      description:
        'Update local definitions in an ABAP class (definitions 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).',
          },
          definitions_code: {
            type: 'string',
            description: 'Updated source code for local definitions.',
          },
          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', 'definitions_code'],
      },
    } as const;
  • TypeScript interface UpdateLocalDefinitionsArgs for the tool's input arguments.
    interface UpdateLocalDefinitionsArgs {
      class_name: string;
      definitions_code: string;
      transport_request?: string;
      activate_on_update?: boolean;
    }
  • Main handler function handleUpdateLocalDefinitions — validates inputs, creates ADT client, calls client.getLocalDefinitions().update(), handles errors, returns response.
    export async function handleUpdateLocalDefinitions(
      context: HandlerContext,
      args: UpdateLocalDefinitionsArgs,
    ) {
      const { connection, logger } = context;
      try {
        const {
          class_name,
          definitions_code,
          transport_request,
          activate_on_update = false,
        } = args as UpdateLocalDefinitionsArgs;
    
        if (!class_name || !definitions_code) {
          return return_error(
            new Error('class_name and definitions_code are required'),
          );
        }
    
        const client = createAdtClient(connection, logger);
        const className = class_name.toUpperCase();
    
        logger?.info(`Updating local definitions for ${className}`);
    
        try {
          const localDefinitions = client.getLocalDefinitions();
          const updateResult = await localDefinitions.update(
            {
              className,
              definitionsCode: definitions_code,
              transportRequest: transport_request,
            },
            { activateOnUpdate: activate_on_update },
          );
    
          if (!updateResult) {
            throw new Error(`Update did not return a result for ${className}`);
          }
    
          logger?.info(
            `✅ UpdateLocalDefinitions 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 definitions updated successfully in ${className}.`,
              },
              null,
              2,
            ),
          } as AxiosResponse);
        } catch (error: any) {
          logger?.error(
            `Error updating local definitions for ${className}: ${error?.message || error}`,
          );
    
          const detailedError = extractAdtErrorMessage(
            error,
            `Failed to update local definitions in ${className}`,
          );
          let errorMessage = `Failed to update local definitions: ${detailedError}`;
    
          if (error.response?.status === 404) {
            errorMessage = `Local definitions 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);
      }
    }
  • Import of handleUpdateLocalDefinitions and its TOOL_DEFINITION from the handler file, aliased as UpdateLocalDefinitions_Tool.
    import {
      handleUpdateLocalDefinitions,
      TOOL_DEFINITION as UpdateLocalDefinitions_Tool,
    } from '../../../handlers/class/high/handleUpdateLocalDefinitions';
  • Registration of UpdateLocalDefinitions tool in the HighLevelHandlersGroup with its tool definition and wrapped handler (withContext).
    {
      toolDefinition: UpdateLocalDefinitions_Tool,
      handler: withContext(handleUpdateLocalDefinitions),
    },
Behavior3/5

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

No annotations are provided, so the description must cover behavior. It mentions locking, checking, updating, unlocking, and optional activation, which adds useful behavioral context. However, it does not detail what happens in failure cases or whether lock is released automatically.

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 concise: two sentences that clearly state purpose and process. No redundant words.

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?

Given there is no output schema and no annotations, the description is fairly complete. It covers the process lifecycle and optional activation. Missing details about transport request handling (e.g., required only if activated?) but schema shows it's not required.

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 description does not need to add much. The description provides no extra meaning beyond the schema descriptions for class_name, definitions_code, transport_request, and activate_on_update. Baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 definitions in an ABAP class and mentions the process steps (lock, check, update, unlock, activation). It distinguishes from siblings like DeleteLocalDefinitions and GetLocalDefinitions. However, the phrase 'definitions include' is slightly ambiguous.

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?

The description does not provide any guidance on when to use this tool versus alternatives like UpdateClass or other sibling tools. No context on prerequisites or when not to use it.

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