Skip to main content
Glama

GetFunction

Retrieve ABAP Function Module source code by specifying the function name and group. This tool helps developers access and review ABAP development artifacts from SAP systems.

Instructions

Retrieve ABAP Function Module source code

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
function_nameYesName of the function module
function_groupYesName of the function group

Implementation Reference

  • The handler function that implements the GetFunction tool logic, fetching the source code of an ABAP function module from the SAP ADT API using the provided function name and group.
    export async function handleGetFunction(args: any) { try { if (!args?.function_name || !args?.function_group) { throw new McpError(ErrorCode.InvalidParams, 'Function name and group are required'); } const encodedFunctionName = encodeURIComponent(args.function_name); const encodedFunctionGroup = encodeURIComponent(args.function_group); const url = `${await getBaseUrl()}/sap/bc/adt/functions/groups/${encodedFunctionGroup}/fmodules/${encodedFunctionName}/source/main`; const response = await makeAdtRequest(url, 'GET', 30000); return return_response(response); } catch (error) { return return_error(error); } }
  • The input schema definition for the GetFunction tool, specifying required parameters: function_name and function_group.
    name: 'GetFunction', description: 'Retrieve ABAP Function Module source code', inputSchema: { type: 'object', properties: { function_name: { type: 'string', description: 'Name of the function module' }, function_group: { type: 'string', description: 'Name of the function group' } }, required: ['function_name', 'function_group'] }
  • src/index.ts:311-312 (registration)
    Registration of the GetFunction tool handler in the CallToolRequest switch statement.
    case 'GetFunction': return await handleGetFunction(request.params.arguments);
  • src/index.ts:17-17 (registration)
    Import statement for the GetFunction handler.
    import { handleGetFunction } from './handlers/handleGetFunction';

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