get_table
Fetch ABAP database table definition from SAP system. Provide table name and optional system ID to retrieve table structure.
Instructions
Fetch ABAP database table definition from SAP system
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Table name (e.g. VBAK) | |
| system_id | No | SAP system ID (e.g. DEV). Omit to use default system. |
Implementation Reference
- src/mcp-server.ts:397-405 (registration)Tool registration for 'get_table' in the ListToolsRequestSchema handler. Defines the tool name, description, and input schema (requires 'name' property with optional system_id).
{ name: "get_table", description: "Fetch ABAP database table definition from SAP system", inputSchema: { type: "object" as const, properties: { name: { type: "string", description: "Table name (e.g. VBAK)" }, ...SYSTEM_ID_PROP }, required: ["name"], }, }, - src/mcp-server.ts:1063-1069 (handler)Handler implementation for the 'get_table' tool. Parses the 'name' argument, calls client.getSource() with the ADT URI path for DDIC tables (/sap/bc/adt/ddic/tables/{name}/source/main), and returns the source code as text.
case "get_table": { const { name: tableName } = NameSchema.parse(args); const source = await client.getSource( `/sap/bc/adt/ddic/tables/${encodeURIComponent(tableName.toUpperCase())}/source/main` ); return { content: [{ type: "text", text: source }] }; } - src/adt-client.ts:56-62 (helper)The getSource() helper method on AdtClient. Performs an HTTP GET request with Accept: text/plain to fetch the source code for any ADT object, including DDIC tables used by get_table.
async getSource(path: string): Promise<string> { const response = await this.http.get<string>(path, { headers: { Accept: "text/plain" }, responseType: "text", }); return response.data; } - src/mcp-server.ts:13-13 (schema)The NameSchema used by get_table for input validation. Defines a required string property 'name'.
const NameSchema = z.object({ name: z.string() });