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
| Name | Required | Description | Default |
|---|---|---|---|
| accountId | Yes | ||
| projectId | Yes | ||
| folderId | No |
Implementation Reference
- src/tools/get-folder-contents.ts:16-29 (handler)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";