tdx-cmdb-get
Retrieve configuration item details from the TDX CMDB using a specific ID to access IT asset information.
Instructions
Get a TDX configuration item by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appId | No | TDX app ID (defaults to env TDX_APP_ID) | |
| id | Yes | CI ID |
Implementation Reference
- src/tools/cmdb.ts:61-69 (handler)The handler function for 'tdx-cmdb-get' that retrieves a CI by ID.
async (params) => { const app = params.appId ?? defaultAppId; try { const result = await client.get(`/${app}/cmdb/${params.id}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (e: unknown) { return { content: [{ type: "text", text: String(e) }], isError: true }; } } - src/tools/cmdb.ts:57-60 (schema)Zod schema for the input parameters of 'tdx-cmdb-get'.
{ appId: z.number().optional().describe("TDX app ID (defaults to env TDX_APP_ID)"), id: z.number().describe("CI ID"), }, - src/tools/cmdb.ts:54-70 (registration)Tool registration for 'tdx-cmdb-get' in the MCP server.
server.tool( "tdx-cmdb-get", "Get a TDX configuration item by ID", { appId: z.number().optional().describe("TDX app ID (defaults to env TDX_APP_ID)"), id: z.number().describe("CI ID"), }, async (params) => { const app = params.appId ?? defaultAppId; try { const result = await client.get(`/${app}/cmdb/${params.id}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (e: unknown) { return { content: [{ type: "text", text: String(e) }], isError: true }; } } );