Skip to main content
Glama

GetObjectsList

Retrieves a recursive list of all child ABAP repository objects for a specified parent object, including nested subcomponents.

Instructions

[read-only] Recursively retrieves all child ABAP repository objects for a given parent — programs (PROG), function groups (FUGR), classes (CLAS), packages (DEVC), and other composite objects — including nested includes and subcomponents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parent_nameYes[read-only] Parent object name
parent_tech_nameYes[read-only] Parent technical name
parent_typeYes[read-only] Parent object type (e.g. PROG/P, FUGR)
with_short_descriptionsNo[read-only] Include short descriptions (default: true)

Implementation Reference

  • The main handler function for GetObjectsList. It validates input parameters, creates an ADT client, recursively traverses ADT node structure starting from root node_id '000000', collects all valid objects, caches the result, and returns formatted JSON content.
    export async function handleGetObjectsList(context: HandlerContext, args: any) {
      const { connection, logger } = context;
      try {
        const {
          parent_name,
          parent_tech_name,
          parent_type,
          with_short_descriptions,
        } = args;
    
        if (
          !parent_name ||
          typeof parent_name !== 'string' ||
          parent_name.trim() === ''
        ) {
          throw new McpError(
            ErrorCode.InvalidParams,
            'Parameter "parent_name" (string) is required and cannot be empty.',
          );
        }
        if (
          !parent_tech_name ||
          typeof parent_tech_name !== 'string' ||
          parent_tech_name.trim() === ''
        ) {
          throw new McpError(
            ErrorCode.InvalidParams,
            'Parameter "parent_tech_name" (string) is required and cannot be empty.',
          );
        }
        if (
          !parent_type ||
          typeof parent_type !== 'string' ||
          parent_type.trim() === ''
        ) {
          throw new McpError(
            ErrorCode.InvalidParams,
            'Parameter "parent_type" (string) is required and cannot be empty.',
          );
        }
    
        const withDescriptions =
          with_short_descriptions !== undefined
            ? Boolean(with_short_descriptions)
            : true;
    
        // Create AdtClient and get utilities
        const client = createAdtClient(connection, logger);
        const utils = client.getUtils();
    
        // Begin traversal from node_id '000000' (the root node)
        const objects = await collectValidObjectsStrict(
          utils,
          parent_name.toUpperCase(),
          parent_type,
          '000000',
          withDescriptions,
          new Set(),
        );
    
        // Format the aggregated data as JSON
        const result = {
          parent_name,
          parent_tech_name,
          parent_type,
          total_objects: objects.length,
          objects,
        };
    
        // Persist the result inside the in-memory cache
        objectsListCache.setCache(result);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2),
            },
          ],
          // Expose the cache snapshot for potential reuse by other modules
          cache: objectsListCache.getCache(),
        };
      } catch (error) {
        // MCP-compliant error response: always return content[] with type "text"
        return {
          isError: true,
          content: [
            {
              type: 'text',
              text: `ADT error: ${String(error)}`,
            },
          ],
        };
      }
    }
  • TOOL_DEFINITION for GetObjectsList - defines the tool name, availability (onprem/cloud), description, and input schema with required parameters (parent_name, parent_tech_name, parent_type) and optional with_short_descriptions.
    export const TOOL_DEFINITION = {
      name: 'GetObjectsList',
      available_in: ['onprem', 'cloud'] as const,
      description:
        '[read-only] Recursively retrieves all child ABAP repository objects for a given parent — programs (PROG), function groups (FUGR), classes (CLAS), packages (DEVC), and other composite objects — including nested includes and subcomponents.',
      inputSchema: {
        type: 'object',
        properties: {
          parent_name: {
            type: 'string',
            description: '[read-only] Parent object name',
          },
          parent_tech_name: {
            type: 'string',
            description: '[read-only] Parent technical name',
          },
          parent_type: {
            type: 'string',
            description: '[read-only] Parent object type (e.g. PROG/P, FUGR)',
          },
          with_short_descriptions: {
            type: 'boolean',
            description: '[read-only] Include short descriptions (default: true)',
          },
        },
        required: ['parent_name', 'parent_tech_name', 'parent_type'],
      },
    } as const;
  • Registration of GetObjectsList as a handler entry in SearchHandlersGroup, binding the TOOL_DEFINITION to the handleGetObjectsList function.
    {
      toolDefinition: GetObjectsList_Tool,
      handler: (args: any) => {
        return handleGetObjectsList(
          this.context,
          args as { object_type: string },
        );
      },
    },
  • In-memory cache singleton for GetObjectsList results, used to store and retrieve cached object list data between handler invocations.
    // In-memory cache for GetObjectsList
    
    type ObjectsListCacheType = any | null;
    
    class ObjectsListCache {
      private cache: ObjectsListCacheType = null;
    
      setCache(data: any) {
        this.cache = data;
      }
    
      getCache(): ObjectsListCacheType {
        return this.cache;
      }
    
      clearCache() {
        this.cache = null;
      }
    }
    
    export const objectsListCache = new ObjectsListCache();
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses key behaviors: the tool is read-only, recursive, and includes nested includes and subcomponents. This is sufficient for a simple read operation, though it could mention potential depth or performance considerations.

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 and front-loaded with '[read-only]'. It efficiently communicates the core functionality in a single sentence without unnecessary detail.

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 the tool's simplicity and lack of output schema, the description adequately covers the purpose and behavior. It explains the recursive nature and object types. However, it could be more complete by noting the result format or error scenarios.

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 description coverage is 100%, so baseline is 3. The description does not add extra meaning beyond the schema's parameter descriptions (e.g., 'Parent object name'). No improvement over schema.

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 that it recursively retrieves all child ABAP repository objects for a given parent, listing example types (PROG, FUGR, CLAS, DEVC). This is specific and informative, but it does not explicitly differentiate from similar sibling tools like GetPackageContents or GetObjectsByType.

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 guidance is provided on when to use this tool vs alternatives. While the description implies recursive retrieval, it does not mention scenarios where a flat list (e.g., GetPackageContents) might be preferred or excluded.

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