tdx-cmdb-search
Search and filter configuration items in TDX CMDB by text, type, status, department, or location to find specific IT assets and resources.
Instructions
Search TDX configuration items with filters
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appId | No | TDX app ID (defaults to env TDX_APP_ID) | |
| searchText | No | Full-text search query | |
| typeIds | No | Filter by CI type IDs | |
| isActive | No | Filter by active status | |
| owningDepartmentIds | No | Filter by owning department IDs | |
| locationIds | No | Filter by location IDs | |
| maxResults | No | Max results to return (default 25) |
Implementation Reference
- src/tools/cmdb.ts:109-137 (handler)The tdx-cmdb-search tool is defined and registered in registerCmdbTools within src/tools/cmdb.ts. It accepts search filters and calls the /cmdb/search endpoint on the TDX client.
server.tool( "tdx-cmdb-search", "Search TDX configuration items with filters", { appId: z.number().optional().describe("TDX app ID (defaults to env TDX_APP_ID)"), searchText: z.string().optional().describe("Full-text search query"), typeIds: z.array(z.number()).optional().describe("Filter by CI type IDs"), isActive: z.boolean().optional().describe("Filter by active status"), owningDepartmentIds: z.array(z.number()).optional().describe("Filter by owning department IDs"), locationIds: z.array(z.number()).optional().describe("Filter by location IDs"), maxResults: z.number().optional().describe("Max results to return (default 25)"), }, async (params) => { const app = params.appId ?? defaultAppId; const body: Record<string, unknown> = {}; if (params.searchText !== undefined) body.SearchText = params.searchText; if (params.typeIds !== undefined) body.TypeIDs = params.typeIds; if (params.isActive !== undefined) body.IsActive = params.isActive; if (params.owningDepartmentIds !== undefined) body.OwningDepartmentIDs = params.owningDepartmentIds; if (params.locationIds !== undefined) body.LocationIDs = params.locationIds; if (params.maxResults !== undefined) body.MaxResults = params.maxResults; try { const result = await client.post(`/${app}/cmdb/search`, body); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (e: unknown) { return { content: [{ type: "text", text: String(e) }], isError: true }; } } );