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';
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Retrieve' implies a read operation, it doesn't specify whether this requires special permissions, what format the source code returns in, whether there are size limitations, or if there are rate limits. For a tool that accesses potentially sensitive source code, 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 immediately communicates the core purpose without any wasted words. It's perfectly front-loaded and appropriately sized for this type of retrieval tool.

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?

For a tool that retrieves source code with no annotations and no output schema, the description is inadequate. It doesn't explain what format the source code returns in (raw text, structured data), whether it includes metadata, or how to handle large function modules. Given the complexity of source code retrieval and lack of structured output documentation, more context is needed.

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?

The schema has 100% description coverage, with both parameters clearly documented in the schema itself. The description doesn't add any additional context about parameter semantics beyond what's already in the schema, so it meets the baseline for high schema coverage.

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 Function Module source code', making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from its sibling 'GetFunctionGroup' which might retrieve related metadata rather than source code.

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 like 'GetFunctionGroup' or 'SearchObject'. There's no mention of prerequisites, typical use cases, or comparison with sibling tools that might retrieve similar ABAP objects.

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