Skip to main content
Glama

get-issue-comments

Retrieve comments for an issue in Autodesk Construction Cloud projects to track discussions and resolve problems.

Instructions

Retrieves a list of comments associated with an issue in Autodesk Construction Cloud.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes
issueIdYes

Implementation Reference

  • The async callback function implementing the core logic of the 'get-issue-comments' tool: authenticates, fetches issue comments using IssuesClient, and formats the response.
    callback: async ({ projectId, issueId }) => {
        // 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 comments = await issuesClient.getComments(projectId, issueId, { accessToken})
        if (!comments.results) {
            throw new Error("No comments found");
        }
        return {
            content: comments.results.map((comment) => ({ type: "text", text: JSON.stringify(comment) }))
        };
    }
  • Zod schema defining the input parameters for the tool: projectId and issueId as non-empty strings.
    const schema = {
        projectId: z.string().nonempty(),
        issueId: z.string().nonempty()
    };
  • src/server.ts:12-14 (registration)
    Dynamic registration of all tools (including 'get-issue-comments') to the MCP server using a loop over imported tools from './tools/index.js', calling server.tool with title, description, schema, and callback.
    for (const tool of Object.values(tools)) {
        server.tool(tool.title, tool.description, tool.schema, tool.callback);
    }
  • src/tools/index.ts:8-8 (registration)
    Re-export of the getIssueComments tool from its implementation file, allowing bulk import in src/server.ts.
    export { getIssueComments } from "./get-issue-comments.js";
  • Complete tool object definition for 'get-issue-comments', including title, description, schema reference, and handler callback.
    export const getIssueComments: Tool<typeof schema> = {
        title: "get-issue-comments",
        description: "Retrieves a list of comments associated with an issue in Autodesk Construction Cloud.",
        schema,
        callback: async ({ projectId, issueId }) => {
            // 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 comments = await issuesClient.getComments(projectId, issueId, { accessToken})
            if (!comments.results) {
                throw new Error("No comments found");
            }
            return {
                content: comments.results.map((comment) => ({ type: "text", text: JSON.stringify(comment) }))
            };
        }
    };

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/petrbroz/aps-mcp-server'

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