get_domain
Retrieve the definition of a DDIC domain from an SAP system by providing the domain name and optional system ID.
Instructions
Fetch DDIC domain definition from SAP system
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Domain name (e.g. MATNR) | |
| system_id | No | SAP system ID (e.g. DEV). Omit to use default system. |
Implementation Reference
- src/mcp-server.ts:406-414 (registration)Registration of the 'get_domain' tool in the ListToolsRequestSchema handler, defining its name, description, and input schema (requires a 'name' string property for the domain name).
{ name: "get_domain", description: "Fetch DDIC domain definition from SAP system", inputSchema: { type: "object" as const, properties: { name: { type: "string", description: "Domain name (e.g. MATNR)" }, ...SYSTEM_ID_PROP }, required: ["name"], }, }, - src/mcp-server.ts:1071-1079 (handler)Handler for the 'get_domain' tool in the CallToolRequestSchema switch statement. Parses the domain name from args, calls client.getSourceOrMetadata with ADT URIs for domain source/main and metadata, and returns the result.
case "get_domain": { const { name: domName } = NameSchema.parse(args); const encoded = encodeURIComponent(domName.toUpperCase()); const result = await client.getSourceOrMetadata( `/sap/bc/adt/ddic/domains/${encoded}/source/main`, `/sap/bc/adt/ddic/domains/${encoded}` ); return { content: [{ type: "text", text: result }] }; } - src/adt-client.ts:72-81 (helper)The getSourceOrMetadata helper method on AdtClient. Tries to fetch the source (text/plain) at the sourcePath, and if a 404 occurs, falls back to fetching metadata at the metadataPath.
async getSourceOrMetadata(sourcePath: string, metadataPath: string): Promise<string> { try { return await this.getSource(sourcePath); } catch (error: unknown) { if (axios.isAxiosError(error) && error.response?.status === 404) { return await this.getMetadata(metadataPath); } throw error; } }