get-accounts
Retrieve all Autodesk Construction Cloud accounts available through the APS MCP Server to manage project access and permissions.
Instructions
List all available Autodesk Construction Cloud accounts
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/get-accounts.ts:7-25 (handler)The handler function for the 'get-accounts' tool. It authenticates using getAccessToken, fetches hubs (accounts) via DataManagementClient, and returns formatted account info.
export const getAccounts: Tool<typeof schema> = { title: "get-accounts", description: "List all available Autodesk Construction Cloud accounts", schema, callback: async () => { const accessToken = await getAccessToken(["data:read"]); const dataManagementClient = new DataManagementClient(); const hubs = await dataManagementClient.getHubs({ accessToken }); if (!hubs.data) { throw new Error("No accounts found"); } return { content: hubs.data.map((hub) => ({ type: "text", text: JSON.stringify({ id: hub.id, name: hub.attributes?.name }) })) }; } }; - src/server.ts:12-14 (registration)Generic registration loop that registers all tools exported from './tools/index.js', including 'get-accounts', with the MCP server.
for (const tool of Object.values(tools)) { server.tool(tool.title, tool.description, tool.schema, tool.callback); } - src/tools/index.ts:1-1 (registration)Barrel export re-exporting the getAccounts tool from its implementation file for convenient import in server.ts.
export { getAccounts } from "./get-accounts.js"; - src/tools/get-accounts.ts:5-5 (schema)Empty input schema definition for the 'get-accounts' tool (no parameters required).
const schema = {};