Skip to main content
Glama

DescribeByList

Batch describe ABAP objects by providing a list of object names and optional types.

Instructions

[read-only] Batch description for a list of ABAP objects. Input: objects: Array<{ name: string, type?: string }>. Each object may be of type: PROG/P, FUGR, PROG/I, CLAS/OC, FUGR/FC, INTF/OI, TABLE, STRUCTURE, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
objectsYes

Implementation Reference

  • TOOL_DEFINITION for DescribeByList: defines name, description, inputSchema with required 'objects' array (each having name and optional type).
    export const TOOL_DEFINITION = {
      name: 'DescribeByList',
      available_in: ['onprem', 'cloud'] as const,
      description:
        '[read-only] Batch description for a list of ABAP objects. Input: objects: Array<{ name: string, type?: string }>. Each object may be of type: PROG/P, FUGR, PROG/I, CLAS/OC, FUGR/FC, INTF/OI, TABLE, STRUCTURE, etc.',
      inputSchema: {
        type: 'object',
        properties: {
          objects: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                name: {
                  type: 'string',
                  description:
                    '[read-only] Object name (required, must be valid ABAP object name or mask)',
                },
                type: {
                  type: 'string',
                  description:
                    '[read-only] Optional type (e.g. PROG/P, CLAS/OC, etc.)',
                },
              },
            },
          },
        },
        required: ['objects'],
      },
    } as const;
  • handleDescribeByList: main handler that iterates over objects, calls handleSearchObject for each (with optional type retry), aggregates results, and returns content array.
    export async function handleDescribeByList(context: HandlerContext, args: any) {
      const { connection, logger } = context;
      const objects = args?.objects;
      if (!args || !Array.isArray(objects) || objects.length === 0) {
        const err = new Error(
          'Missing or invalid parameters: objects (array) is required and must not be empty.',
        );
        // @ts-expect-error
        err.status = 400;
        // @ts-expect-error
        err.body = {
          error: {
            message:
              'Missing or invalid parameters: objects (array) is required and must not be empty.',
            code: 'INVALID_PARAMS',
          },
        };
        throw err;
      }
      logger?.info(`Describing ${objects.length} objects via search`);
      const results: any[] = [];
      try {
        for (const obj of objects) {
          const type = obj.type;
          let res = await handleSearchObject(context, {
            object_name: obj.name,
            object_type: type,
          });
          let parsed: any;
          try {
            parsed = typeof res === 'string' ? JSON.parse(res) : res;
    
            // If the response is empty or flagged as an error, retry without explicit type
            let tryWithoutType = false;
            if (
              parsed == null ||
              parsed.isError === true ||
              (parsed.content &&
                Array.isArray(parsed.content) &&
                parsed.content.length === 0)
            ) {
              tryWithoutType = true;
            }
    
            if (tryWithoutType) {
              res = await handleSearchObject(context, { object_name: obj.name });
              parsed = typeof res === 'string' ? JSON.parse(res) : res;
              // If it still fails or comes back empty, skip this object
              if (
                parsed == null ||
                parsed.isError === true ||
                (parsed.content &&
                  Array.isArray(parsed.content) &&
                  parsed.content.length === 0)
              ) {
                continue;
              }
            }
    
            // When content is a non-empty array
            if (parsed.content && Array.isArray(parsed.content)) {
              const contentArr = parsed.content;
              if (contentArr.length === 0) {
                continue;
              }
              // Handle SearchObject-style payloads containing a results array
              let allResults: any[] = [];
              for (const item of contentArr) {
                try {
                  const parsedItem =
                    typeof item.text === 'string'
                      ? JSON.parse(item.text)
                      : item.text;
                  if (parsedItem?.results && Array.isArray(parsedItem.results)) {
                    allResults = allResults.concat(parsedItem.results);
                  } else {
                    allResults.push(parsedItem);
                  }
                } catch {
                  allResults.push(item);
                }
              }
              results.push({
                type: 'text',
                text: JSON.stringify({
                  name: obj.name,
                  results: allResults,
                }),
              });
              continue;
            }
    
            // Otherwise handle direct object payloads (e.g., DTEL)
            if (typeof parsed === 'object' && parsed !== null) {
              results.push({ type: 'text', text: JSON.stringify(parsed) });
            }
          } catch {}
        }
        // Return isError: false even when nothing matched
        return {
          isError: false,
          content: results,
        };
      } catch (e) {
        logger?.error('Failed to describe objects list', e as any);
        return { isError: true, content: [] };
      }
    }
  • Import of TOOL_DEFINITION and handleDescribeByList into the SystemHandlersGroup.
    import { TOOL_DEFINITION as DescribeByList_Tool } from '../../../handlers/system/readonly/handleDescribeByList';
    import { handleDescribeByList } from '../../../handlers/system/readonly/handleDescribeByList.js';
  • Registration of DescribeByList tool in the SystemHandlersGroup with toolDefinition and handler binding.
    {
      toolDefinition: DescribeByList_Tool,
      handler: (args: any) => {
        return handleDescribeByList(
          this.context,
          args as
            | { object_type: string; object_name: string }
            | {
                object_type: string;
                object_name: string;
                cache_type: string;
              },
        );
      },
Behavior3/5

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

The description flags the tool as '[read-only]', indicating non-destructive behavior, which adds value beyond the absent annotations. However, it omits details like error handling, rate limits, or what happens if objects don't exist, leaving some behavioral gaps.

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 extremely concise: two sentences front-loading the purpose and input format with no extraneous words. Every sentence serves a clear purpose.

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?

Given the tool is a batch operation with no output schema and no annotations, the description covers purpose and input but lacks information about return values, error handling, and partial failure behavior, making it incomplete for complex use cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds example object types (e.g., PROG/P, CLAS/OC) that are not present in the input schema's type description for the 'type' parameter. Since schema description coverage is 0%, the description compensates by providing concrete examples, though it largely restates the schema structure.

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 '[read-only] Batch description for a list of ABAP objects', specifying the verb 'Describe' and the resource 'list of ABAP objects', and distinguishes it from sibling tools like GetObjectInfo or GetObjectsByType by being batch and read-only.

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 provides input format but does not explicitly state when to use this tool versus alternatives, nor does it mention when not to use it or any prerequisites. This leaves the agent without clear usage guidance.

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