Skip to main content
Glama

GetAdtTypes

Retrieve all valid ADT object types or validate a specific type name to ensure correct usage in ABAP development.

Instructions

[read-only] Retrieve all valid ADT object types (CLAS, TABL, PROG, DEVC, FUGR, INTF, DDLS, DTEL, DOMA, SRVD, SRVB, BDEF, DDLX, etc.) or validate a specific type name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
validate_typeNoType name to validate (optional)

Implementation Reference

  • Main handler function for the GetAdtTypes tool. Creates an ADT client, fetches all object types from the SAP system via getAllTypes(), parses the XML response using extractNamedItems(), and returns the list of type names and descriptions as JSON content.
    export async function handleGetAdtTypes(context: HandlerContext, _args: any) {
      const { connection, logger } = context;
      try {
        const client = createAdtClient(connection, logger);
        const response = await client
          .getUtils()
          .getAllTypes(999, '*', 'usedByProvider');
        logger?.info('Fetched ADT object types list');
        const items = extractNamedItems(response.data);
        return {
          isError: false,
          content: [
            {
              type: 'text',
              text: JSON.stringify(items),
            },
          ],
        };
      } catch (error) {
        logger?.error('Failed to fetch ADT object types', error as any);
        return {
          isError: true,
          content: [
            {
              type: 'text',
              text: `ADT error: ${String(error)}`,
            },
          ],
        };
      }
    }
  • Tool definition/input schema for GetAdtTypes. Defines the tool name, description, and optional 'validate_type' input property. Available in both onprem and cloud environments.
    export const TOOL_DEFINITION = {
      name: 'GetAdtTypes',
      available_in: ['onprem', 'cloud'] as const,
      description:
        '[read-only] Retrieve all valid ADT object types (CLAS, TABL, PROG, DEVC, FUGR, INTF, DDLS, DTEL, DOMA, SRVD, SRVB, BDEF, DDLX, etc.) or validate a specific type name.',
      inputSchema: {
        type: 'object',
        properties: {
          validate_type: {
            type: 'string',
            description: 'Type name to validate (optional)',
          },
        },
        required: [],
      },
    } as const;
  • Registration of GetAdtTypes in SystemHandlersGroup. Maps the toolDefinition (GetAdtTypes_Tool) to the handler (handleGetAdtTypes) with argument type casting.
    // Dynamic import handlers
    {
      toolDefinition: GetAdtTypes_Tool,
      handler: (args: any) => {
        return handleGetAdtTypes(this.context, args as { type_name: string });
      },
    },
  • Helper function extractNamedItems() that parses XML response from the nameditem:namedItemList structure to extract name/description pairs for ADT object types.
    function extractNamedItems(xml: string) {
      const parser = new XMLParser({
        ignoreAttributes: false,
        attributeNamePrefix: '',
        parseAttributeValue: true,
        trimValues: true,
      });
      const result = parser.parse(xml);
      const items: Array<{ name: string; description: string }> = [];
      const namedItems = result['nameditem:namedItemList']?.['nameditem:namedItem'];
      if (Array.isArray(namedItems)) {
        for (const item of namedItems) {
          items.push({
            name: item['nameditem:name'],
            description: item['nameditem:description'],
          });
        }
      } else if (namedItems) {
        items.push({
          name: namedItems['nameditem:name'],
          description: namedItems['nameditem:description'],
        });
      }
      return items;
    }
  • Helper function _parseObjectTypesXml() that parses XML for ADT object types from the opr:objectTypes structure. Defined but not used by the main handler (the extractNamedItems function is used instead).
    function _parseObjectTypesXml(xml: string) {
      const parser = new XMLParser({
        ignoreAttributes: false,
        attributeNamePrefix: '',
        parseAttributeValue: true,
        trimValues: true,
      });
      const result = parser.parse(xml);
      const types: { name: string; description: string; provider: string }[] = [];
      const objects = result['opr:objectTypes']?.['opr:objectType'];
      if (Array.isArray(objects)) {
        for (const obj of objects) {
          types.push({
            name: obj.name,
            description: obj.text,
            provider: obj.provider,
          });
        }
      } else if (objects) {
        types.push({
          name: objects.name,
          description: objects.text,
          provider: objects.provider,
        });
      }
      return types;
    }
Behavior4/5

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

Declares '[read-only]' upfront, signaling safe operation. No annotations, so description provides needed behavioral info; could mention no side effects.

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?

One sentence with front-loaded read-only marker and concise examples. No unnecessary 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?

Adequate for a simple lookup tool with one optional parameter. Lacks return format description, but overall complete given lack of output schema.

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?

Single parameter described in schema as 'Type name to validate (optional)'. Description confirms and adds example types, but schema already covers meaning sufficiently.

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?

Description clearly states 'Retrieve all valid ADT object types' and lists examples, differentiating from siblings that retrieve specific objects.

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?

Indicates when to use: to get full list or validate a specific type. No explicit exclusions or alternatives, but context is clear.

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