Skip to main content
Glama

get-folder-contents

List files and subfolders in Autodesk Construction Cloud projects or specific directories to manage project documentation and assets.

Instructions

List contents of a project or a specific subfolder in Autodesk Construction Cloud

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountIdYes
projectIdYes
folderIdNo

Implementation Reference

  • The async callback handler that performs authentication, initializes the DataManagementClient, fetches folder contents or project top folders, and returns formatted content.
    callback: async ({ accountId, projectId, folderId }) => {
        // TODO: add pagination support
        const accessToken = await getAccessToken(["data:read"]);
        const dataManagementClient = new DataManagementClient();
        const contents = folderId
            ? await dataManagementClient.getFolderContents(projectId, folderId, { accessToken })
            : await dataManagementClient.getProjectTopFolders(accountId, projectId, { accessToken });
        if (!contents.data) {
            throw new Error("No contents found");
        }
        return {
            content: contents.data.map((item) => ({ type: "text", text: JSON.stringify(item) }))
        };
    }
  • Input schema defining parameters: accountId (required string), projectId (required string), folderId (optional string).
    const schema = {
        accountId: z.string().nonempty(),
        projectId: z.string().nonempty(),
        folderId: z.string().optional()
    };
  • src/server.ts:12-14 (registration)
    Generic registration loop that adds all tools exported from src/tools/index.ts to the MCP server, including 'get-folder-contents' via its title.
    for (const tool of Object.values(tools)) {
        server.tool(tool.title, tool.description, tool.schema, tool.callback);
    }
  • src/tools/index.ts:3-3 (registration)
    Re-exports the getFolderContents tool from its implementation file for bulk import in server.ts.
    export { getFolderContents } from "./get-folder-contents.js";

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