Skip to main content
Glama
umzcio
by umzcio

tdx-asset-create

Create new assets in TeamDynamix by specifying required details like name, status, and optional attributes for IT inventory management.

Instructions

Create a new TDX asset

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdNoTDX app ID (defaults to env TDX_APP_ID)
formIdNoForm ID
statusIdYesStatus ID
nameYesAsset name
serialNumberNoSerial number
modelIdNoModel ID
manufacturerIdNoManufacturer ID
supplierIdNoSupplier ID
locationIdNoLocation ID
locationRoomIdNoLocation room ID
owningDepartmentIdNoOwning department ID
owningCustomerIdNoOwning customer UID
requestingCustomerIdNoRequesting customer UID
requestingDepartmentIdNoRequesting department ID
purchaseCostNoPurchase cost
acquisitionDateNoAcquisition date (ISO)
expectedReplacementDateNoExpected replacement date (ISO)
externalIdNoExternal ID
attributesNoCustom attributes

Implementation Reference

  • The handler logic for 'tdx-asset-create' that prepares the body and calls the client's post method.
    async (params) => {
      const app = params.appId ?? defaultAppId;
      const body: Record<string, unknown> = {
        StatusID: params.statusId,
        Name: params.name,
      };
      if (params.formId !== undefined) body.FormID = params.formId;
      if (params.serialNumber !== undefined) body.SerialNumber = params.serialNumber;
      if (params.modelId !== undefined) body.ModelID = params.modelId;
      if (params.manufacturerId !== undefined) body.ManufacturerID = params.manufacturerId;
      if (params.supplierId !== undefined) body.SupplierID = params.supplierId;
      if (params.locationId !== undefined) body.LocationID = params.locationId;
      if (params.locationRoomId !== undefined) body.LocationRoomID = params.locationRoomId;
      if (params.owningDepartmentId !== undefined) body.OwningDepartmentID = params.owningDepartmentId;
      if (params.owningCustomerId !== undefined) body.OwningCustomerID = params.owningCustomerId;
      if (params.requestingCustomerId !== undefined) body.RequestingCustomerID = params.requestingCustomerId;
      if (params.requestingDepartmentId !== undefined) body.RequestingDepartmentID = params.requestingDepartmentId;
      if (params.purchaseCost !== undefined) body.PurchaseCost = params.purchaseCost;
      if (params.acquisitionDate !== undefined) body.AcquisitionDate = params.acquisitionDate;
      if (params.expectedReplacementDate !== undefined) body.ExpectedReplacementDate = params.expectedReplacementDate;
      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}/assets`, body);
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      } catch (e: unknown) {
        return { content: [{ type: "text", text: String(e) }], isError: true };
      }
    }
  • The Zod schema definition for 'tdx-asset-create' inputs.
    {
      appId: z.number().optional().describe("TDX app ID (defaults to env TDX_APP_ID)"),
      formId: z.number().optional().describe("Form ID"),
      statusId: z.number().describe("Status ID"),
      name: z.string().describe("Asset name"),
      serialNumber: z.string().optional().describe("Serial number"),
      modelId: z.number().optional().describe("Model ID"),
      manufacturerId: z.number().optional().describe("Manufacturer ID"),
      supplierId: z.number().optional().describe("Supplier ID"),
      locationId: z.number().optional().describe("Location ID"),
      locationRoomId: z.number().optional().describe("Location room ID"),
      owningDepartmentId: z.number().optional().describe("Owning department ID"),
      owningCustomerId: z.string().optional().describe("Owning customer UID"),
      requestingCustomerId: z.string().optional().describe("Requesting customer UID"),
      requestingDepartmentId: z.number().optional().describe("Requesting department ID"),
      purchaseCost: z.number().optional().describe("Purchase cost"),
      acquisitionDate: z.string().optional().describe("Acquisition date (ISO)"),
      expectedReplacementDate: z.string().optional().describe("Expected replacement date (ISO)"),
      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"),
    },
  • Registration of the 'tdx-asset-create' tool with the MCP server.
    server.tool(
      "tdx-asset-create",
      "Create a new TDX asset",
      {
        appId: z.number().optional().describe("TDX app ID (defaults to env TDX_APP_ID)"),
        formId: z.number().optional().describe("Form ID"),
        statusId: z.number().describe("Status ID"),
        name: z.string().describe("Asset name"),
        serialNumber: z.string().optional().describe("Serial number"),
        modelId: z.number().optional().describe("Model ID"),
        manufacturerId: z.number().optional().describe("Manufacturer ID"),
        supplierId: z.number().optional().describe("Supplier ID"),
        locationId: z.number().optional().describe("Location ID"),
        locationRoomId: z.number().optional().describe("Location room ID"),
        owningDepartmentId: z.number().optional().describe("Owning department ID"),
        owningCustomerId: z.string().optional().describe("Owning customer UID"),
        requestingCustomerId: z.string().optional().describe("Requesting customer UID"),
        requestingDepartmentId: z.number().optional().describe("Requesting department ID"),
        purchaseCost: z.number().optional().describe("Purchase cost"),
        acquisitionDate: z.string().optional().describe("Acquisition date (ISO)"),
        expectedReplacementDate: z.string().optional().describe("Expected replacement date (ISO)"),
        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> = {
          StatusID: params.statusId,
          Name: params.name,
        };
        if (params.formId !== undefined) body.FormID = params.formId;
        if (params.serialNumber !== undefined) body.SerialNumber = params.serialNumber;
        if (params.modelId !== undefined) body.ModelID = params.modelId;
        if (params.manufacturerId !== undefined) body.ManufacturerID = params.manufacturerId;
        if (params.supplierId !== undefined) body.SupplierID = params.supplierId;
        if (params.locationId !== undefined) body.LocationID = params.locationId;
        if (params.locationRoomId !== undefined) body.LocationRoomID = params.locationRoomId;
        if (params.owningDepartmentId !== undefined) body.OwningDepartmentID = params.owningDepartmentId;
        if (params.owningCustomerId !== undefined) body.OwningCustomerID = params.owningCustomerId;
        if (params.requestingCustomerId !== undefined) body.RequestingCustomerID = params.requestingCustomerId;
        if (params.requestingDepartmentId !== undefined) body.RequestingDepartmentID = params.requestingDepartmentId;
        if (params.purchaseCost !== undefined) body.PurchaseCost = params.purchaseCost;
        if (params.acquisitionDate !== undefined) body.AcquisitionDate = params.acquisitionDate;
        if (params.expectedReplacementDate !== undefined) body.ExpectedReplacementDate = params.expectedReplacementDate;
        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}/assets`, 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