GetStructure
Retrieve ABAP structure definitions from SAP systems to analyze data models and development artifacts for integration or debugging purposes.
Instructions
Retrieve ABAP Structure
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| structure_name | Yes | Name of the ABAP Structure |
Implementation Reference
- src/handlers/handleGetStructure.ts:4-16 (handler)The core handler function that executes the GetStructure tool logic by fetching the structure source code via ADT API.export async function handleGetStructure(args: any) { try { if (!args?.structure_name) { throw new McpError(ErrorCode.InvalidParams, 'Structure name is required'); } const encodedStructureName = encodeURIComponent(args.structure_name); const url = `${await getBaseUrl()}/sap/bc/adt/ddic/structures/${encodedStructureName}/source/main`; const response = await makeAdtRequest(url, 'GET', 30000); return return_response(response); } catch (error) { return return_error(error); } }
- src/index.ts:167-176 (schema)Input schema defining the required 'structure_name' parameter for the GetStructure tool.inputSchema: { type: 'object', properties: { structure_name: { type: 'string', description: 'Name of the ABAP Structure' } }, required: ['structure_name'] }
- src/index.ts:315-316 (registration)Dispatches calls to the 'GetStructure' tool to the corresponding handler function.case 'GetStructure': return await handleGetStructure(request.params.arguments);
- src/index.ts:164-177 (registration)Registers the GetStructure tool in the list of available tools, including name, description, and schema.{ name: 'GetStructure', description: 'Retrieve ABAP Structure', inputSchema: { type: 'object', properties: { structure_name: { type: 'string', description: 'Name of the ABAP Structure' } }, required: ['structure_name'] } },
- src/index.ts:19-19 (registration)Imports the GetStructure handler function.import { handleGetStructure } from './handlers/handleGetStructure';