show_modules
List all modules in an Anaplan model. Filter by name or ID to find specific modules, and control the number of results returned.
Instructions
List all modules in a model. Use show_lineitems to see a module's line items, or show_savedviews to find views for read_cells.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspaceId | Yes | Anaplan workspace ID or name | |
| modelId | Yes | Anaplan model ID or name | |
| 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:129-141 (handler)Handler for show_modules tool. Resolves workspace/model IDs, calls apis.modules.list(), and formats results as a table with name/ID columns and next-step hints.
server.tool("show_modules", "List all modules in a model. Use show_lineitems to see a module's line items, or show_savedviews to find views for read_cells.", { workspaceId: z.string().describe("Anaplan workspace ID or name"), modelId: z.string().describe("Anaplan model ID or name"), ...paginationParams, }, async ({ workspaceId, modelId, limit, search }) => { const wId = await resolver.resolveWorkspace(workspaceId); const mId = await resolver.resolveModel(wId, modelId); const modules = await apis.modules.list(wId, mId); return withNextSteps( tableResult(modules, [{ header: "Name", key: "name" }, { header: "ID", key: "id" }], "modules", { limit, search }), ["Use show_lineitems to see line items, show_savedviews for views, or show_moduledetails for dimension layout."], ); }); - src/tools/exploration.ts:129-141 (registration)Registration of the show_modules tool via server.tool() inside registerExplorationTools().
server.tool("show_modules", "List all modules in a model. Use show_lineitems to see a module's line items, or show_savedviews to find views for read_cells.", { workspaceId: z.string().describe("Anaplan workspace ID or name"), modelId: z.string().describe("Anaplan model ID or name"), ...paginationParams, }, async ({ workspaceId, modelId, limit, search }) => { const wId = await resolver.resolveWorkspace(workspaceId); const mId = await resolver.resolveModel(wId, modelId); const modules = await apis.modules.list(wId, mId); return withNextSteps( tableResult(modules, [{ header: "Name", key: "name" }, { header: "ID", key: "id" }], "modules", { limit, search }), ["Use show_lineitems to see line items, show_savedviews for views, or show_moduledetails for dimension layout."], ); }); - src/tools/exploration.ts:129-132 (schema)Schema definition for show_modules: workspaceId (string), modelId (string), limit (optional number), search (optional string).
server.tool("show_modules", "List all modules in a model. Use show_lineitems to see a module's line items, or show_savedviews to find views for read_cells.", { workspaceId: z.string().describe("Anaplan workspace ID or name"), modelId: z.string().describe("Anaplan model ID or name"), ...paginationParams, - src/api/modules.ts:6-9 (helper)ModulesApi.list() - fetches all modules for a model via the Anaplan REST API. Used by show_modules handler.
async list(workspaceId: string, modelId: string) { return this.client.getAll<any>( `/workspaces/${workspaceId}/models/${modelId}/modules`, "modules" ); - src/tools/exploration.ts:77-77 (registration)Export function that registers the show_modules tool (among others) on the MCP server.
export function registerExplorationTools(server: McpServer, apis: ExplorationApis, resolver: NameResolver) {