Skip to main content
Glama

GetProgram

Retrieve ABAP program source code from SAP systems by specifying the program name. This tool enables developers to access and review development artifacts within ABAP environments.

Instructions

Retrieve ABAP program source code

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
program_nameYesName of the ABAP program

Implementation Reference

  • The main handler function that retrieves the source code of an ABAP program by constructing an ADT API URL and making a GET request to the SAP backend.
    export async function handleGetProgram(args: any) {
        try {
            if (!args?.program_name) {
                throw new McpError(ErrorCode.InvalidParams, 'Program name is required');
            }
            const encodedProgramName = encodeURIComponent(args.program_name);
            const url = `${await getBaseUrl()}/sap/bc/adt/programs/programs/${encodedProgramName}/source/main`;
    
            const response = await makeAdtRequest(url, 'GET', 30000);
            return return_response(response);
        }
        catch (error) {
            return return_error(error);
        }
    }
  • Input schema definition for the GetProgram tool, specifying the required 'program_name' parameter.
      name: 'GetProgram',
      description: 'Retrieve ABAP program source code',
      inputSchema: {
        type: 'object',
        properties: {
          program_name: {
            type: 'string',
            description: 'Name of the ABAP program'
          }
        },
        required: ['program_name']
      }
    },
  • src/index.ts:307-308 (registration)
    Registration of the GetProgram handler in the tool dispatch switch statement within the CallToolRequest handler.
    case 'GetProgram':
      return await handleGetProgram(request.params.arguments);
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 for behavioral disclosure. 'Retrieve' implies a read operation, but the description doesn't specify whether this requires special permissions, what format the source code is returned in, if there are size limitations, or how errors are handled. For a tool with zero annotation coverage, this is insufficient.

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 that gets straight to the point with zero wasted words. It's appropriately sized for a simple retrieval tool and front-loads the essential information.

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?

For a single-parameter retrieval tool with no output schema and no annotations, the description is minimally adequate. It identifies what's being retrieved but lacks important context about return format, error conditions, and differentiation from sibling tools. The simplicity of the tool keeps it from being completely inadequate.

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 fully documents the single parameter. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., format examples, naming conventions, or valid program types). With complete schema coverage, the 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 tool's purpose with a specific verb ('Retrieve') and resource ('ABAP program source code'), making it immediately understandable. However, it doesn't explicitly differentiate this tool from its siblings like GetClass or GetFunction, which likely retrieve different types of ABAP objects.

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 no guidance on when to use this tool versus alternatives. With multiple sibling tools for retrieving different ABAP objects (GetClass, GetFunction, GetInclude, etc.), there's no indication that this tool is specifically for programs rather than other object types.

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