tdx-attributes-get
Retrieve custom attribute definitions for TDX components like tickets, assets, or CIs to enable accurate data entry when creating or updating items with custom fields.
Instructions
Get custom attribute definitions for a TDX component (e.g. tickets, assets, CIs). Returns attribute IDs, names, types, and choices needed for creating/updating items with custom attributes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| componentId | Yes | Component ID (e.g. 9=Ticket, 27=Asset, 63=CI, 39=KBArticle, 2=Project) | |
| appId | No | TDX app ID (defaults to env TDX_APP_ID) | |
| associatedTypeId | No | Filter by associated type ID |
Implementation Reference
- src/tools/attributes.ts:14-26 (handler)The handler function that executes the logic for the 'tdx-attributes-get' tool.
async (params) => { const app = params.appId ?? client.appId; const query: Record<string, string> = {}; if (params.associatedTypeId !== undefined) { query.associatedTypeId = String(params.associatedTypeId); } try { const result = await client.get(`/attributes/custom?componentId=${params.componentId}&appId=${app}`, query); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (e: unknown) { return { content: [{ type: "text", text: String(e) }], isError: true }; } } - src/tools/attributes.ts:9-13 (schema)Input schema definition for the 'tdx-attributes-get' tool.
{ componentId: z.number().describe("Component ID (e.g. 9=Ticket, 27=Asset, 63=CI, 39=KBArticle, 2=Project)"), appId: z.number().optional().describe("TDX app ID (defaults to env TDX_APP_ID)"), associatedTypeId: z.number().optional().describe("Filter by associated type ID"), }, - src/tools/attributes.ts:6-27 (registration)Registration of the 'tdx-attributes-get' tool on the MCP server.
server.tool( "tdx-attributes-get", "Get custom attribute definitions for a TDX component (e.g. tickets, assets, CIs). Returns attribute IDs, names, types, and choices needed for creating/updating items with custom attributes.", { componentId: z.number().describe("Component ID (e.g. 9=Ticket, 27=Asset, 63=CI, 39=KBArticle, 2=Project)"), appId: z.number().optional().describe("TDX app ID (defaults to env TDX_APP_ID)"), associatedTypeId: z.number().optional().describe("Filter by associated type ID"), }, async (params) => { const app = params.appId ?? client.appId; const query: Record<string, string> = {}; if (params.associatedTypeId !== undefined) { query.associatedTypeId = String(params.associatedTypeId); } try { const result = await client.get(`/attributes/custom?componentId=${params.componentId}&appId=${app}`, query); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (e: unknown) { return { content: [{ type: "text", text: String(e) }], isError: true }; } } );