GetInclude
Retrieve ABAP include source code from SAP systems to access development artifacts for analysis or integration purposes.
Instructions
Retrieve ABAP Include Source Code
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_name | Yes | Name of the ABAP Include |
Implementation Reference
- src/handlers/handleGetInclude.ts:4-16 (handler)The handler function that implements the logic for the GetInclude tool. It validates the include_name argument, constructs the ADT API URL, performs a GET request to fetch the source code, and returns the response or handles errors.export async function handleGetInclude(args: any) { try { if (!args?.include_name) { throw new McpError(ErrorCode.InvalidParams, 'Include name is required'); } const encodedIncludeName = encodeURIComponent(args.include_name); const url = `${await getBaseUrl()}/sap/bc/adt/programs/includes/${encodedIncludeName}/source/main`; const response = await makeAdtRequest(url, 'GET', 30000); return return_response(response); } catch (error) { return return_error(error); } }
- src/index.ts:239-252 (registration)Registration of the GetInclude tool in the ListTools response, including its name, description, and input schema definition.{ name: 'GetInclude', description: 'Retrieve ABAP Include Source Code', inputSchema: { type: 'object', properties: { include_name: { type: 'string', description: 'Name of the ABAP Include' } }, required: ['include_name'] } },
- src/index.ts:325-326 (registration)Dispatch logic in the CallToolRequest handler that routes GetInclude calls to the handleGetInclude function.case 'GetInclude': return await handleGetInclude(request.params.arguments);
- src/index.ts:242-251 (schema)Input schema definition for the GetInclude tool, specifying the required 'include_name' parameter.inputSchema: { type: 'object', properties: { include_name: { type: 'string', description: 'Name of the ABAP Include' } }, required: ['include_name'] }