get_structure
Fetch the definition of a Data Dictionary (DDIC) structure from an SAP system. Provide the structure name and optionally the system ID to specify the target system.
Instructions
Fetch DDIC structure definition from SAP system
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Structure name (e.g. BAPISDHD1) | |
| system_id | No | SAP system ID (e.g. DEV). Omit to use default system. |
Implementation Reference
- src/mcp-server.ts:1007-1013 (handler)Handler for the 'get_structure' tool. Parses the structure name from the input, then calls client.getSource() with the ADT URI for DDIC structures to fetch the source code.
case "get_structure": { const { name: structName } = NameSchema.parse(args); const source = await client.getSource( `/sap/bc/adt/ddic/structures/${encodeURIComponent(structName.toUpperCase())}/source/main` ); return { content: [{ type: "text", text: source }] }; } - src/mcp-server.ts:209-217 (registration)Registration of the 'get_structure' tool in the ListToolsRequestSchema handler, defining its name, description, and input schema (requires 'name' parameter for the structure name).
{ name: "get_structure", description: "Fetch DDIC structure definition from SAP system", inputSchema: { type: "object" as const, properties: { name: { type: "string", description: "Structure name (e.g. BAPISDHD1)" }, ...SYSTEM_ID_PROP }, required: ["name"], }, }, - src/adt-client.ts:56-62 (helper)The getSource() helper method on AdtClient that performs the actual HTTP GET request to fetch source code from SAP ADT, used by the get_structure handler.
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-14 (schema)The NameSchema Zod schema used to validate the 'name' parameter passed to get_structure (and other tools).
const NameSchema = z.object({ name: z.string() }); const FunctionModuleSchema = z.object({