get-issue-root-causes
Retrieve supported root cause categories and causes for issues in Autodesk Construction Cloud. Use this tool to accurately allocate root causes by providing the required project ID.
Instructions
Retrieves a list of supported root cause categories and root causes that you can allocate to an issue in Autodesk Construction Cloud.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes |
Implementation Reference
- src/tools/get-issue-root-causes.ts:14-26 (handler)The main handler function that executes the tool: authenticates, fetches root cause categories for the given project using Autodesk Construction Cloud IssuesClient, and returns JSON stringified results.callback: async ({ projectId }) => { // TODO: add pagination support const accessToken = await getAccessToken(["data:read"]); const issuesClient = new IssuesClient(); projectId = projectId.replace("b.", ""); // the projectId should not contain the "b." prefix const rootCauses = await issuesClient.getRootCauseCategories(projectId, { accessToken }); if (!rootCauses.results) { throw new Error("No root causes found"); } return { content: rootCauses.results.map((rootCause) => ({ type: "text", text: JSON.stringify(rootCause) })) }; }
- Input schema validation using Zod: requires a non-empty projectId string.const schema = { projectId: z.string().nonempty() };
- src/server.ts:12-14 (registration)Generic registration loop that registers this tool (and all others) with the MCP server using server.tool(title, description, schema, callback). Enabled by import * as tools from "./tools/index.js"; on line 3.for (const tool of Object.values(tools)) { server.tool(tool.title, tool.description, tool.schema, tool.callback); }
- src/tools/index.ts:7-7 (registration)Re-exports the getIssueRootCauses tool for bulk import in server.ts.export { getIssueRootCauses } from "./get-issue-root-causes.js";