GetTable
Retrieve ABAP table structure from SAP systems to analyze database schema, understand field definitions, and support development workflows.
Instructions
Retrieve ABAP table structure
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes | Name of the ABAP table |
Implementation Reference
- src/handlers/handleGetTable.ts:4-16 (handler)The handler function that implements the core logic of the GetTable tool. It fetches the ABAP table structure source code from the SAP ADT endpoint using the provided table_name.export async function handleGetTable(args: any) { try { if (!args?.table_name) { throw new McpError(ErrorCode.InvalidParams, 'Table name is required'); } const encodedTableName = encodeURIComponent(args.table_name); const url = `${await getBaseUrl()}/sap/bc/adt/ddic/tables/${encodedTableName}/source/main`; const response = await makeAdtRequest(url, 'GET', 30000); return return_response(response); } catch (error) { return return_error(error); } }
- src/index.ts:179-190 (schema)Input schema definition for the GetTable tool, requiring a 'table_name' parameter.name: 'GetTable', description: 'Retrieve ABAP table structure', inputSchema: { type: 'object', properties: { table_name: { type: 'string', description: 'Name of the ABAP table' } }, required: ['table_name'] }
- src/index.ts:317-318 (registration)Registration of the GetTable tool handler in the CallToolRequest switch statement, dispatching calls to handleGetTable.case 'GetTable': return await handleGetTable(request.params.arguments);
- src/index.ts:18-18 (registration)Import statement for the GetTable handler function.import { handleGetTable } from './handlers/handleGetTable';