get_function_group
Retrieve ABAP function group source code from SAP system by specifying the function group name and optional system ID.
Instructions
Fetch ABAP function group source code from SAP system
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Function group name (e.g. SVAT) | |
| system_id | No | SAP system ID (e.g. DEV). Omit to use default system. |
Implementation Reference
- src/mcp-server.ts:370-378 (registration)Registration of the get_function_group tool in the ListToolsRequestSchema handler, defining its name, description, and input schema.
{ name: "get_function_group", description: "Fetch ABAP function group source code from SAP system", inputSchema: { type: "object" as const, properties: { name: { type: "string", description: "Function group name (e.g. SVAT)" }, ...SYSTEM_ID_PROP }, required: ["name"], }, }, - src/mcp-server.ts:1039-1045 (handler)Handler implementation for the get_function_group tool in the CallToolRequestSchema handler. Parses the 'name' argument, constructs the ADT URI for function groups, and calls client.getSource to fetch the source code.
case "get_function_group": { const { name: fgName } = NameSchema.parse(args); const source = await client.getSource( `/sap/bc/adt/functions/groups/${encodeURIComponent(fgName.toUpperCase())}/source/main` ); return { content: [{ type: "text", text: source }] }; } - src/mcp-server.ts:13-16 (schema)The NameSchema used by get_function_group for validation (validates the 'name' parameter as a string).
const NameSchema = z.object({ name: z.string() }); const FunctionModuleSchema = z.object({ function_group: z.string(), function_name: z.string(),