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);

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