show_workspaces
List all accessible Anaplan workspaces, optionally with size and quota details. Start here to explore workspaces before models.
Instructions
List all accessible Anaplan workspaces. Use tenantDetails=true for size/quota info. Start here, then use show_models.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max items to return (default 50, max 1000) | |
| search | No | Filter by name or ID (case-insensitive substring match) | |
| tenantDetails | No | Include workspace size and quota information |
Implementation Reference
- src/tools/exploration.ts:78-91 (handler)The MCP tool handler for 'show_workspaces' - defines the tool with pagination and tenantDetails params, calls apis.workspaces.list(), formats results as a table, and returns next-step hints.
server.tool("show_workspaces", "List all accessible Anaplan workspaces. Use tenantDetails=true for size/quota info. Start here, then use show_models.", { ...paginationParams, tenantDetails: z.boolean().optional().describe("Include workspace size and quota information"), }, async ({ limit, search, tenantDetails }) => { const workspaces = await apis.workspaces.list(tenantDetails); const columns = [{ header: "Name", key: "name" }, { header: "ID", key: "id" }, { header: "Active", key: "active" }]; if (tenantDetails) { columns.push({ header: "Size", key: "sizeAllowance" }, { header: "Quota", key: "currentSize" }); } return withNextSteps( tableResult(workspaces, columns, "workspaces", { limit, search }), ["Use show_models with a workspaceId to explore a workspace's models."], ); }); - src/tools/exploration.ts:79-81 (schema)Input schema for show_workspaces: pagination params (limit, search) and optional tenantDetails boolean.
...paginationParams, tenantDetails: z.boolean().optional().describe("Include workspace size and quota information"), }, async ({ limit, search, tenantDetails }) => { - src/tools/exploration.ts:78-91 (registration)Tool registration via server.tool() call with name 'show_workspaces'. The function registerExplorationTools is called from src/server.ts:54.
server.tool("show_workspaces", "List all accessible Anaplan workspaces. Use tenantDetails=true for size/quota info. Start here, then use show_models.", { ...paginationParams, tenantDetails: z.boolean().optional().describe("Include workspace size and quota information"), }, async ({ limit, search, tenantDetails }) => { const workspaces = await apis.workspaces.list(tenantDetails); const columns = [{ header: "Name", key: "name" }, { header: "ID", key: "id" }, { header: "Active", key: "active" }]; if (tenantDetails) { columns.push({ header: "Size", key: "sizeAllowance" }, { header: "Quota", key: "currentSize" }); } return withNextSteps( tableResult(workspaces, columns, "workspaces", { limit, search }), ["Use show_models with a workspaceId to explore a workspace's models."], ); }); - src/api/workspaces.ts:7-10 (helper)WorkspacesApi.list() fetches all workspaces via the Anaplan REST API with optional tenant details. Called by the show_workspaces handler.
async list(tenantDetails = false) { const suffix = tenantDetails ? "?tenantDetails=true" : ""; return this.client.getAll<any>(`/workspaces${suffix}`, "workspaces"); }