show_listmetadata
Retrieve list properties, parent, and item count from an Anaplan model using workspace, model, and list identifiers.
Instructions
Get list metadata including properties, parent, and item count.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspaceId | Yes | Anaplan workspace ID or name | |
| modelId | Yes | Anaplan model ID or name | |
| listId | Yes | List ID or name |
Implementation Reference
- src/tools/exploration.ts:387-397 (registration)Registration and handler for the show_listmetadata tool on the MCP server. Defines Zod schema for workspaceId, modelId, listId. The handler resolves IDs via NameResolver, fetches list metadata via ListsApi.getMetadata, and returns JSON.
server.tool("show_listmetadata", "Get list metadata including properties, parent, and item count.", { workspaceId: z.string().describe("Anaplan workspace ID or name"), modelId: z.string().describe("Anaplan model ID or name"), listId: z.string().describe("List ID or name"), }, async ({ workspaceId, modelId, listId }) => { const wId = await resolver.resolveWorkspace(workspaceId); const mId = await resolver.resolveModel(wId, modelId); const lId = await resolver.resolveList(wId, mId, listId); const metadata = await apis.lists.getMetadata(wId, mId, lId); return { content: [{ type: "text", text: JSON.stringify(metadata, null, 2) }] }; }); - src/tools/exploration.ts:391-397 (handler)Handler function for show_listmetadata - resolves workspace, model, list IDs, calls the API, and returns the metadata as JSON.
}, async ({ workspaceId, modelId, listId }) => { const wId = await resolver.resolveWorkspace(workspaceId); const mId = await resolver.resolveModel(wId, modelId); const lId = await resolver.resolveList(wId, mId, listId); const metadata = await apis.lists.getMetadata(wId, mId, lId); return { content: [{ type: "text", text: JSON.stringify(metadata, null, 2) }] }; }); - src/tools/exploration.ts:387-390 (schema)Input schema for the show_listmetadata tool with workspaceId, modelId, and listId parameters.
server.tool("show_listmetadata", "Get list metadata including properties, parent, and item count.", { workspaceId: z.string().describe("Anaplan workspace ID or name"), modelId: z.string().describe("Anaplan model ID or name"), listId: z.string().describe("List ID or name"), - src/api/lists.ts:19-24 (helper)ListsApi.getMetadata helper method that makes the HTTP GET call to the Anaplan API to fetch list metadata.
async getMetadata(workspaceId: string, modelId: string, listId: string) { const res = await this.client.get<any>( `/workspaces/${workspaceId}/models/${modelId}/lists/${listId}` ); return res.metadata ?? res; }