Skip to main content
Glama

ActivateInterface

Activate an ABAP interface after creation or update if the object remains inactive.

Instructions

Activate an ABAP interface. Use after CreateInterface or UpdateInterface if the object remains inactive.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
interface_nameYesInterface name (e.g., ZIF_MY_INTERFACE).
session_idNoSession ID from GetSession. If not provided, a new session will be created.
session_stateNoSession state from GetSession (cookies, csrf_token, cookie_store). Required if session_id is provided.

Implementation Reference

  • Main handler function for the ActivateInterface tool. Uses AdtClient.activateInterface to activate an ABAP interface, parses the activation response, and returns status, messages, warnings, and errors.
    export async function handleActivateInterface(
      context: HandlerContext,
      args: ActivateInterfaceArgs,
    ) {
      const { connection, logger } = context;
      try {
        const { interface_name, session_id, session_state } =
          args as ActivateInterfaceArgs;
    
        // Validation
        if (!interface_name) {
          return return_error(new Error('interface_name is required'));
        }
    
        const client = createAdtClient(connection, logger);
    
        // Restore session state if provided
        if (session_id && session_state) {
          await restoreSessionInConnection(connection, session_id, session_state);
        }
    
        const interfaceName = interface_name.toUpperCase();
    
        logger?.info(`Starting interface activation: ${interfaceName}`);
    
        try {
          // Activate interface
          const activateState = await client
            .getInterface()
            .activate({ interfaceName: interfaceName });
          const response = activateState.activateResult;
    
          if (!response) {
            throw new Error(
              `Activation did not return a response for interface ${interfaceName}`,
            );
          }
    
          // Parse activation response
          const activationResult = parseActivationResponse(response.data);
          const success = activationResult.activated && activationResult.checked;
    
          // Get updated session state after activation
    
          logger?.info(`✅ ActivateInterface completed: ${interfaceName}`);
          logger?.debug(
            `Activated: ${activationResult.activated}, Checked: ${activationResult.checked}, Messages: ${activationResult.messages.length}`,
          );
    
          return return_response({
            data: JSON.stringify(
              {
                success,
                interface_name: interfaceName,
                activation: {
                  activated: activationResult.activated,
                  checked: activationResult.checked,
                  generated: activationResult.generated,
                },
                messages: activationResult.messages,
                warnings: activationResult.messages.filter(
                  (m) => m.type === 'warning' || m.type === 'W',
                ),
                errors: activationResult.messages.filter(
                  (m) => m.type === 'error' || m.type === 'E',
                ),
                session_id: session_id || null,
                session_state: null, // Session state management is now handled by auth-broker,
                message: success
                  ? `Interface ${interfaceName} activated successfully`
                  : `Interface ${interfaceName} activation completed with ${activationResult.messages.length} message(s)`,
              },
              null,
              2,
            ),
          } as AxiosResponse);
        } catch (error: any) {
          logger?.error(
            `Error activating interface ${interfaceName}: ${error?.message || error}`,
          );
    
          // Parse error message
          let errorMessage = `Failed to activate interface: ${error.message || String(error)}`;
    
          if (error.response?.status === 404) {
            errorMessage = `Interface ${interfaceName} not found.`;
          } else if (
            error.response?.data &&
            typeof error.response.data === 'string'
          ) {
            try {
              const { XMLParser } = require('fast-xml-parser');
              const parser = new XMLParser({
                ignoreAttributes: false,
                attributeNamePrefix: '@_',
              });
              const errorData = parser.parse(error.response.data);
              const errorMsg =
                errorData['exc:exception']?.message?.['#text'] ||
                errorData['exc:exception']?.message;
              if (errorMsg) {
                errorMessage = `SAP Error: ${errorMsg}`;
              }
            } catch (_parseError) {
              // Ignore parse errors
            }
          }
    
          return return_error(new Error(errorMessage));
        }
      } catch (error: any) {
        return return_error(error);
      }
    }
  • TOOL_DEFINITION constant with inputSchema for ActivateInterfaceLow. Requires interface_name, optional session_id and session_state.
    export const TOOL_DEFINITION = {
      name: 'ActivateInterfaceLow',
      available_in: ['onprem', 'cloud', 'legacy'] as const,
      description:
        'Operation: Activate, Create, Update. Subject: Interface. Will be useful for activating, creating, or updating interface. [low-level] Activate an ABAP interface. Returns activation status and any warnings/errors. Can use session_id and session_state from GetSession to maintain the same session.',
      inputSchema: {
        type: 'object',
        properties: {
          interface_name: {
            type: 'string',
            description: 'Interface name (e.g., ZIF_MY_INTERFACE).',
          },
          session_id: {
            type: 'string',
            description:
              'Session ID from GetSession. If not provided, a new session will be created.',
          },
          session_state: {
            type: 'object',
            description:
              'Session state from GetSession (cookies, csrf_token, cookie_store). Required if session_id is provided.',
            properties: {
              cookies: { type: 'string' },
              csrf_token: { type: 'string' },
              cookie_store: { type: 'object' },
            },
          },
        },
        required: ['interface_name'],
      },
    } as const;
  • ActivateInterfaceArgs TypeScript interface defining the arguments shape for the handler.
    interface ActivateInterfaceArgs {
      interface_name: string;
      session_id?: string;
      session_state?: {
        cookies?: string;
        csrf_token?: string;
        cookie_store?: Record<string, string>;
      };
    }
  • Registration of ActivateInterface tool in HighLevelHandlersGroup. Uses the low-level TOOL_DEFINITION but overrides name to 'ActivateInterface' and provides a high-level description.
    {
      toolDefinition: {
        ...ActivateInterface_Tool,
        name: 'ActivateInterface',
        description:
          'Activate an ABAP interface. Use after CreateInterface or UpdateInterface if the object remains inactive.',
      },
      handler: withContext(handleActivateInterface),
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it activates an interface but does not disclose side effects, error conditions, required permissions, or behavior if already active.

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 sentences, front-loads the purpose, and contains no unnecessary words. Every sentence adds value.

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?

The tool has 3 parameters and no output schema. The description lacks explanation of return values, success/failure indicators, or what happens when the interface is already active. Given the lack of annotations, more completeness is needed.

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 provides descriptions for all parameters. The description adds no extra parameter-specific information, meeting the baseline for high coverage.

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 verb ('Activate') and resource ('ABAP interface'), and distinguishes from sibling tools by specifying it is used after CreateInterface or UpdateInterface when the object remains inactive.

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

Usage Guidelines4/5

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

The description explicitly says when to use the tool ('Use after CreateInterface or UpdateInterface if the object remains inactive'). It does not provide explicit when-not-to-use or alternatives, but the context is clear enough.

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