get_interface
Retrieve the full source code of an ABAP interface from an SAP system. Provide the interface name and optionally the system ID to access the interface definition.
Instructions
Fetch ABAP interface source code from SAP system
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Interface name (e.g. IF_ABAP_TIMER_HANDLER) | |
| system_id | No | SAP system ID (e.g. DEV). Omit to use default system. |
Implementation Reference
- src/mcp-server.ts:389-396 (registration)Tool registration for 'get_interface' in the ListToolsRequestSchema handler, defining the tool name, description, and input schema.
name: "get_interface", description: "Fetch ABAP interface source code from SAP system", inputSchema: { type: "object" as const, properties: { name: { type: "string", description: "Interface name (e.g. IF_ABAP_TIMER_HANDLER)" }, ...SYSTEM_ID_PROP }, required: ["name"], }, }, - src/mcp-server.ts:59-62 (schema)The input schema used by the 'change_interface' tool (which references get_interface in its description), but the 'get_interface' tool itself uses NameSchema (name only).
const ChangeInterfaceSchema = z.object({ name: z.string(), source: z.string(), }); - src/mcp-server.ts:1055-1061 (handler)Handler implementation for 'get_interface'. Parses the interface name, constructs the ADT URI for interfaces, and makes an HTTP GET request via AdtClient.getSource() to fetch the ABAP interface source code.
case "get_interface": { const { name: ifName } = NameSchema.parse(args); const source = await client.getSource( `/sap/bc/adt/oo/interfaces/${encodeURIComponent(ifName.toUpperCase())}/source/main` ); return { content: [{ type: "text", text: source }] }; } - src/adt-client.ts:56-62 (helper)The getSource() helper method on AdtClient that performs the actual HTTP GET request to fetch source code from an ADT endpoint. Used by the get_interface handler.
async getSource(path: string): Promise<string> { const response = await this.http.get<string>(path, { headers: { Accept: "text/plain" }, responseType: "text", }); return response.data; }