Skip to main content
Glama
umzcio
by umzcio

tdx-cmdb-create

Create new configuration items (CIs) in the TDX Configuration Management Database (CMDB) to track IT assets and services.

Instructions

Create a new TDX configuration item (CI)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdNoTDX app ID (defaults to env TDX_APP_ID)
typeIdYesCI type ID
nameYesCI name
formIdNoForm ID
isActiveNoWhether CI is active
owningDepartmentIdNoOwning department ID
owningCustomerIdNoOwning customer UID
locationIdNoLocation ID
locationRoomIdNoLocation room ID
maintenanceScheduleIdNoMaintenance schedule ID
externalIdNoExternal ID
attributesNoCustom attributes

Implementation Reference

  • The asynchronous handler function that processes the request for 'tdx-cmdb-create', mapping input parameters to the API request body and invoking the TDX client.
    async (params) => {
      const app = params.appId ?? defaultAppId;
      const body: Record<string, unknown> = {
        TypeID: params.typeId,
        Name: params.name,
      };
      if (params.formId !== undefined) body.FormID = params.formId;
      if (params.isActive !== undefined) body.IsActive = params.isActive;
      if (params.owningDepartmentId !== undefined) body.OwningDepartmentID = params.owningDepartmentId;
      if (params.owningCustomerId !== undefined) body.OwningCustomerID = params.owningCustomerId;
      if (params.locationId !== undefined) body.LocationID = params.locationId;
      if (params.locationRoomId !== undefined) body.LocationRoomID = params.locationRoomId;
      if (params.maintenanceScheduleId !== undefined) body.MaintenanceScheduleID = params.maintenanceScheduleId;
      if (params.externalId !== undefined) body.ExternalID = params.externalId;
      if (params.attributes) {
        body.Attributes = params.attributes.map((a) => ({ ID: a.id, Value: String(a.value) }));
      }
      try {
        const result = await client.post(`/${app}/cmdb`, body);
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      } catch (e: unknown) {
        return { content: [{ type: "text", text: String(e) }], isError: true };
      }
    }
  • Zod schema definitions for the input parameters of the 'tdx-cmdb-create' tool.
    {
      appId: z.number().optional().describe("TDX app ID (defaults to env TDX_APP_ID)"),
      typeId: z.number().describe("CI type ID"),
      name: z.string().describe("CI name"),
      formId: z.number().optional().describe("Form ID"),
      isActive: z.boolean().optional().describe("Whether CI is active"),
      owningDepartmentId: z.number().optional().describe("Owning department ID"),
      owningCustomerId: z.string().optional().describe("Owning customer UID"),
      locationId: z.number().optional().describe("Location ID"),
      locationRoomId: z.number().optional().describe("Location room ID"),
      maintenanceScheduleId: z.number().optional().describe("Maintenance schedule ID"),
      externalId: z.string().optional().describe("External ID"),
      attributes: z.array(z.object({
        id: z.number().describe("Custom attribute ID"),
        value: z.union([z.string(), z.number(), z.boolean()]).describe("Attribute value"),
      })).optional().describe("Custom attributes"),
    },
  • src/tools/cmdb.ts:8-52 (registration)
    Registration of the 'tdx-cmdb-create' tool using the server.tool method.
    server.tool(
      "tdx-cmdb-create",
      "Create a new TDX configuration item (CI)",
      {
        appId: z.number().optional().describe("TDX app ID (defaults to env TDX_APP_ID)"),
        typeId: z.number().describe("CI type ID"),
        name: z.string().describe("CI name"),
        formId: z.number().optional().describe("Form ID"),
        isActive: z.boolean().optional().describe("Whether CI is active"),
        owningDepartmentId: z.number().optional().describe("Owning department ID"),
        owningCustomerId: z.string().optional().describe("Owning customer UID"),
        locationId: z.number().optional().describe("Location ID"),
        locationRoomId: z.number().optional().describe("Location room ID"),
        maintenanceScheduleId: z.number().optional().describe("Maintenance schedule ID"),
        externalId: z.string().optional().describe("External ID"),
        attributes: z.array(z.object({
          id: z.number().describe("Custom attribute ID"),
          value: z.union([z.string(), z.number(), z.boolean()]).describe("Attribute value"),
        })).optional().describe("Custom attributes"),
      },
      async (params) => {
        const app = params.appId ?? defaultAppId;
        const body: Record<string, unknown> = {
          TypeID: params.typeId,
          Name: params.name,
        };
        if (params.formId !== undefined) body.FormID = params.formId;
        if (params.isActive !== undefined) body.IsActive = params.isActive;
        if (params.owningDepartmentId !== undefined) body.OwningDepartmentID = params.owningDepartmentId;
        if (params.owningCustomerId !== undefined) body.OwningCustomerID = params.owningCustomerId;
        if (params.locationId !== undefined) body.LocationID = params.locationId;
        if (params.locationRoomId !== undefined) body.LocationRoomID = params.locationRoomId;
        if (params.maintenanceScheduleId !== undefined) body.MaintenanceScheduleID = params.maintenanceScheduleId;
        if (params.externalId !== undefined) body.ExternalID = params.externalId;
        if (params.attributes) {
          body.Attributes = params.attributes.map((a) => ({ ID: a.id, Value: String(a.value) }));
        }
        try {
          const result = await client.post(`/${app}/cmdb`, body);
          return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
        } catch (e: unknown) {
          return { content: [{ type: "text", text: String(e) }], isError: true };
        }
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/umzcio/TeamDynamix-MCP-Connector'

If you have feedback or need assistance with the MCP directory API, please join our Discord server