GetInterface
Retrieve ABAP interface source code from SAP systems to analyze or implement development artifacts.
Instructions
Retrieve ABAP interface source code
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| interface_name | Yes | Name of the ABAP interface |
Implementation Reference
- src/handlers/handleGetInterface.ts:4-16 (handler)The main handler function for the 'GetInterface' tool. It validates the interface_name parameter, constructs the ADT URL, makes a GET request to fetch the interface source code, and returns the response or error.export async function handleGetInterface(args: any) { try { if (!args?.interface_name) { throw new McpError(ErrorCode.InvalidParams, 'Interface name is required'); } const encodedInterfaceName = encodeURIComponent(args.interface_name); const url = `${await getBaseUrl()}/sap/bc/adt/oo/interfaces/${encodedInterfaceName}/source/main`; const response = await makeAdtRequest(url, 'GET', 30000); return return_response(response); } catch (error) { return return_error(error); } }
- src/index.ts:289-298 (schema)Input schema definition for the GetInterface tool, specifying the required 'interface_name' parameter.inputSchema: { type: 'object', properties: { interface_name: { type: 'string', description: 'Name of the ABAP interface' } }, required: ['interface_name'] }
- src/index.ts:286-299 (registration)Registration of the GetInterface tool in the ListTools response, including name, description, and input schema.{ name: 'GetInterface', description: 'Retrieve ABAP interface source code', inputSchema: { type: 'object', properties: { interface_name: { type: 'string', description: 'Name of the ABAP interface' } }, required: ['interface_name'] } }
- src/index.ts:329-330 (registration)Dispatch logic in the CallToolRequest handler that routes 'GetInterface' calls to the handleGetInterface function.case 'GetInterface': return await handleGetInterface(request.params.arguments);
- src/index.ts:24-24 (helper)Import statement for the GetInterface handler function.import { handleGetInterface } from './handlers/handleGetInterface';