Skip to main content
Glama

GetPackage

Retrieve ABAP package details from SAP systems to access development artifacts and table structures for analysis and integration.

Instructions

Retrieve ABAP package details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
package_nameYesName of the ABAP package

Implementation Reference

  • The handler function that executes the GetPackage tool: validates input, queries SAP ADT repository for package node structure, parses XML response, extracts object details, and returns JSON.
    export async function handleGetPackage(args: any) {
        try {
            if (!args?.package_name) {
                throw new McpError(ErrorCode.InvalidParams, 'Package name is required');
            }
    
            const nodeContentsUrl = `${await getBaseUrl()}/sap/bc/adt/repository/nodestructure`;
            const encodedPackageName = encodeURIComponent(args.package_name);
            const nodeContentsParams = {
                parent_type: "DEVC/K",
                parent_name: encodedPackageName,
                withShortDescriptions: true
            };
    
            const package_structure_response = await makeAdtRequest(nodeContentsUrl, 'POST', 30000, undefined, nodeContentsParams);
            const result = convert.xml2js(package_structure_response.data, {compact: true});
            
            const nodes = result["asx:abap"]?.["asx:values"]?.DATA?.TREE_CONTENT?.SEU_ADT_REPOSITORY_OBJ_NODE || [];
            const extractedData = (Array.isArray(nodes) ? nodes : [nodes]).filter(node => 
                node.OBJECT_NAME?._text && node.OBJECT_URI?._text
            ).map(node => ({
                OBJECT_TYPE: node.OBJECT_TYPE._text,
                OBJECT_NAME: node.OBJECT_NAME._text,
                OBJECT_DESCRIPTION: node.DESCRIPTION?._text,
                OBJECT_URI: node.OBJECT_URI._text
            }));
    
            return {
                isError: false,
                content: [{
                    type: 'text',
                    text: JSON.stringify(extractedData)
                }]
            };
    
        } catch (error) {
            return return_error(error);
        }
    }
  • Input schema definition for the GetPackage tool in the ListTools response, requiring 'package_name' string.
    name: 'GetPackage',
    description: 'Retrieve ABAP package details',
    inputSchema: {
      type: 'object',
      properties: {
        package_name: {
          type: 'string',
          description: 'Name of the ABAP package'
        }
      },
      required: ['package_name']
    }
  • src/index.ts:321-322 (registration)
    Dispatches calls to the GetPackage handler in the CallToolRequest switch statement.
    case 'GetPackage':
      return await handleGetPackage(request.params.arguments);
  • src/index.ts:21-21 (registration)
    Import of the GetPackage handler function.
    import { handleGetPackage } from './handlers/handleGetPackage';
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what the tool does, not how it behaves. It lacks information on permissions needed, error handling, rate limits, or what 'details' include, which is critical for a read operation without output schema.

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 a single, efficient sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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?

Given no annotations and no output schema, the description is incomplete for a tool that retrieves details. It doesn't specify what details are returned, error cases, or behavioral context, leaving significant gaps for agent understanding.

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 the schema already documents the single parameter 'package_name'. The description adds no additional meaning beyond implying retrieval of details, which aligns with the schema but doesn't enhance parameter understanding. Baseline 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 verb 'Retrieve' and the resource 'ABAP package details', making the purpose understandable. It distinguishes from siblings like GetClass or GetTable by specifying package details, but doesn't explicitly contrast with other package-related tools (none listed).

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 versus alternatives. The description doesn't mention prerequisites, context, or comparisons to sibling tools like SearchObject, leaving the agent to infer usage scenarios.

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/mario-andreschak/mcp-abap-adt'

If you have feedback or need assistance with the MCP directory API, please join our Discord server