show_versions
Retrieve version metadata for a model, including Current and Forecast. Version IDs are needed for set_versionswitchover.
Instructions
List version metadata (Current, Forecast, etc.) for a model. Version IDs are needed for set_versionswitchover. Note: requires model ID (name resolution not supported).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| modelId | Yes | Anaplan model ID (name resolution not supported -- use show_models to find the ID) | |
| limit | No | Max items to return (default 50, max 1000) | |
| search | No | Filter by name or ID (case-insensitive substring match) |
Implementation Reference
- src/tools/exploration.ts:581-592 (handler)The 'show_versions' tool handler: registers the tool with server.tool(), defines the schema (modelId string + paginationParams), and implements the handler that calls apis.versions.list(modelId) and formats results as a table with Name, Current, Actual, and ID columns.
server.tool("show_versions", "List version metadata (Current, Forecast, etc.) for a model. Version IDs are needed for set_versionswitchover. Note: requires model ID (name resolution not supported).", { modelId: z.string().describe("Anaplan model ID (name resolution not supported -- use show_models to find the ID)"), ...paginationParams, }, async ({ modelId, limit, search }) => { const versions = await apis.versions.list(modelId); return tableResult(versions, [ { header: "Name", key: "name" }, { header: "Current", key: "isCurrent" }, { header: "Actual", key: "isActual" }, { header: "ID", key: "id" }, ], "versions", { limit, search }); }); - src/tools/exploration.ts:581-592 (schema)The input schema for 'show_versions' includes modelId (required string with description about name resolution not supported) and paginationParams (optional limit and search). Output is formatted as a text table.
server.tool("show_versions", "List version metadata (Current, Forecast, etc.) for a model. Version IDs are needed for set_versionswitchover. Note: requires model ID (name resolution not supported).", { modelId: z.string().describe("Anaplan model ID (name resolution not supported -- use show_models to find the ID)"), ...paginationParams, }, async ({ modelId, limit, search }) => { const versions = await apis.versions.list(modelId); return tableResult(versions, [ { header: "Name", key: "name" }, { header: "Current", key: "isCurrent" }, { header: "Actual", key: "isActual" }, { header: "ID", key: "id" }, ], "versions", { limit, search }); }); - src/tools/exploration.ts:581-592 (registration)The tool is registered via server.tool('show_versions', ...) inside the registerExplorationTools function in src/tools/exploration.ts.
server.tool("show_versions", "List version metadata (Current, Forecast, etc.) for a model. Version IDs are needed for set_versionswitchover. Note: requires model ID (name resolution not supported).", { modelId: z.string().describe("Anaplan model ID (name resolution not supported -- use show_models to find the ID)"), ...paginationParams, }, async ({ modelId, limit, search }) => { const versions = await apis.versions.list(modelId); return tableResult(versions, [ { header: "Name", key: "name" }, { header: "Current", key: "isCurrent" }, { header: "Actual", key: "isActual" }, { header: "ID", key: "id" }, ], "versions", { limit, search }); }); - src/api/versions.ts:6-9 (helper)The VersionsApi.list() method that performs the HTTP GET request to /models/{modelId}/versions and returns the versions list.
async list(modelId: string) { const res = await this.client.get<any>(`/models/${modelId}/versions`); return res.versions ?? res.versionMetadata ?? []; }