show_lineitem_dimensions
Retrieve dimension IDs for a line item, required for writing data to cells or listing dimension items.
Instructions
List dimensions for a line item. Returns dimensionId values needed by write_cells and show_dimensionitems. 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) | |
| lineItemId | Yes | Line item ID (from show_lineitems or show_alllineitems) |
Implementation Reference
- src/tools/exploration.ts:487-499 (handler)The actual tool registration and handler for 'show_lineitem_dimensions'. It calls apis.transactional.getLineItemDimensions(modelId, lineItemId) and returns the results as a table.
server.tool("show_lineitem_dimensions", "List dimensions for a line item. Returns dimensionId values needed by write_cells and show_dimensionitems. 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)"), lineItemId: z.string().describe("Line item ID (from show_lineitems or show_alllineitems)"), }, async ({ modelId, lineItemId }) => { const dims = await apis.transactional.getLineItemDimensions(modelId, lineItemId); return withNextSteps( tableResult(dims, [ { header: "Name", key: "name" }, { header: "ID", key: "id" }, ], "dimensions"), ["Use show_dimensionitems with each dimensionId to get itemIds for write_cells."], ); }); - src/tools/exploration.ts:487-499 (schema)Input schema definition: expects modelId (string) and lineItemId (string) parameters, both using z.string().
server.tool("show_lineitem_dimensions", "List dimensions for a line item. Returns dimensionId values needed by write_cells and show_dimensionitems. 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)"), lineItemId: z.string().describe("Line item ID (from show_lineitems or show_alllineitems)"), }, async ({ modelId, lineItemId }) => { const dims = await apis.transactional.getLineItemDimensions(modelId, lineItemId); return withNextSteps( tableResult(dims, [ { header: "Name", key: "name" }, { header: "ID", key: "id" }, ], "dimensions"), ["Use show_dimensionitems with each dimensionId to get itemIds for write_cells."], ); }); - src/tools/exploration.ts:77-77 (registration)The 'show_lineitem_dimensions' tool is registered via registerExplorationTools() which calls server.tool(...) on the McpServer instance.
export function registerExplorationTools(server: McpServer, apis: ExplorationApis, resolver: NameResolver) { - src/api/transactional.ts:41-46 (helper)The getLineItemDimensions API method that fetches dimensions for a line item from the Anaplan API endpoint /models/{modelId}/lineItems/{lineItemId}/dimensions.
async getLineItemDimensions(modelId: string, lineItemId: string) { const res = await this.client.get<any>( `/models/${modelId}/lineItems/${lineItemId}/dimensions` ); return res.dimensions ?? []; } - src/server.ts:54-57 (registration)The call to registerExplorationTools(server, {...apis...}, resolver) which wires up the exploration tools including show_lineitem_dimensions.
registerExplorationTools(server, { workspaces, models, modules, lists, imports, exports, processes, files, actions, transactional, modelManagement, dimensions, calendar, versions, users, }, resolver);