Tracing Allocations with an MCP-Connected AI Agent
Once you’ve connected an AI agent to your workspace over the Model Context Protocol (MCP), you can ask it — in plain language — to trace cost through your allocation steps. You don’t run a report or write SQL: you ask a question, and the agent calls PlaidCloud’s allocation-tracing tools to find the model, explain a change, walk the chain, and answer what-if questions.
This works from any MCP-connected client — a chat agent (Claude Desktop, ChatGPT) or a coding agent (Claude Code, Cursor) — since they all reach the same tools over the MCP server.
Prerequisites
Section titled “Prerequisites”- A project containing allocation steps (
allocation_split,allocation_rules, orallocation_dim). - An AI agent connected to your workspace over MCP — see Getting Started with AI Coding Agents.
What You Can Ask
Section titled “What You Can Ask”| Ask the agent … | What it does | Tool behind it |
|---|---|---|
| “What allocation models are in this project?” | Lists each model, its stages, and the result tables it produces | allocation_model_find |
“How is cost_line_rev calculated?” |
Shows the cost pool being split, the driver it is split by, and the target table | allocation_describe |
“Why did cost_line_rev change from 2025 to 2026?” |
Compares the two periods and attributes the change to the pool size versus the driver mix, with the top contributing accounts | allocation_root_cause |
“What feeds cost_line_rev?” |
Walks the upstream chain — drivers, source pools, and imports | allocation_lineage |
“Where is revenue_by_line used as a driver?” |
Lists every allocation that splits by that table | allocation_driver_usage |
| “What happens if US revenue rises by $1M?” | Splits the change across each affected result by its current share of the pool — additive across a fan-out, not a worst-case per table | allocation_forward_impact |
| “What if the Assembly cost centre’s headcount driver rose by 10?” | Reslices the fixed pool under the new driver weights — exact, showing which targets gain and which lose, netting to zero | allocation_driver_scenario |
Worked Example
Section titled “Worked Example”A finance analyst notices a revenue-driven cost line has fallen year on year and asks one question. The agent answers it end to end, calling several allocation tools behind the scenes.
You ask: Our revenue-based cost allocation (
cost_line_rev) looks down in 2026 versus 2025. What happened, what is it built from, and what would a +$1M US revenue swing do?
The agent replies:
What it is.
cost_line_revis the revenue-driven stage of your Activity-Based Costing (ABC) model. It takes a cost pool (group_amount, limited to a set of P&L accounts) and splits it by revenue fromrevenue_by_line, weighted within each entity, year, and month.Why it dropped (US, 2025 → 2026). US-allocated cost fell from $7.12M to $2.99M — a $4.13M drop (−58.0%). This is not a mix shift: the US share of the pool held steady at about 23% in both years. The driver is the total cost pool shrinking, concentrated in a few accounts:
Account 2025 2026 Change 700000 $2.58M $1.09M −$1.49M 701000 $1.85M $0.77M −$1.08M 610000 $1.71M $0.72M −$0.99M 670000 $0.68M $0.29M −$0.39M 702000 $0.30M $0.13M −$0.18M Those five accounts explain essentially all of the move.
What feeds it.
cost_line_revis built fromrevenue_by_line(the split driver) andgl_pool_entity(the cost pool).Heads-up — that driver is shared.
revenue_by_linealso drivescost_line_csandcost_line_admin, so a revenue restatement ripples into all three.Your +$1M US scenario. The $1M is spread across the results that share this driver by each one’s current share of the pool, so the per-table estimates add up to the change rather than each repeating the full $1M — you get a figure for
cost_line_rev,cost_line_cs, andcost_line_adminthat you can total. Narrow the question to a single target and the estimate is applied to just that slice.
The analyst gets a complete answer — the size of the change, the accounts behind it, the lineage, and the blast radius of a what-if — without opening a single table.
How Far to Trust an Answer
Section titled “How Far to Trust an Answer”A fluent answer isn’t automatically a correct one. Every “why did this change” answer now comes with a plain-language read on how far to trust it, so a plausible-but-shaky number is flagged before you act on it rather than buried in the prose. Alongside the explanation, the agent tells you:
- A confidence level — high, medium, or low — reflecting how cleanly the change decomposes. A change driven by one clear cause reads high; one where several causes overlap, or where the figures don’t fully reconcile, reads lower. When a result is built from several allocation branches, the confidence weighs each branch by how much of the change it accounts for — so one small, shaky branch doesn’t drag down an otherwise-clean answer — but a branch whose number is itself in doubt (an unreconciled split, stale data, or something that can’t be attributed) still holds the whole answer’s confidence down.
- Caveats in plain words — for example: the cause is a mix of overlapping factors rather than a single one; the answer rests on the current hierarchy or driver weights; part of a change may be a data-completeness artefact (a period that hasn’t finished loading) rather than a real movement; the pool or driver feeding the allocation hasn’t been reloaded recently, so the figure may rest on out-of-date data; or a what-if figure can’t be added across targets.
When the agent can’t stand behind a precise cause, it says so and points you at the scope or filter that would let it answer cleanly — instead of inventing a confident story. And because the confidence and caveats are part of the answer, they travel with it: if you ask a follow-up agent to summarise, the trust signals don’t get quietly dropped.
Good to Know
Section titled “Good to Know”- Refer to tables by their name (
cost_line_rev) or their id — both work. - For a change question, name the periods to compare (for example 2025 versus 2026) and, where useful, a breakdown dimension such as account or entity.
- Start broad (“what allocation models are in this project?”) and drill in; the agent keeps the thread, so follow-up questions build on the same model.
- There are two kinds of what-if: a value change (“this pool rises by $1M”) is estimated by today’s shares and adds up across targets; a driver change (“reweight this driver”) is resliced exactly and nets to zero. Phrase the question for the one you mean.
Related
Section titled “Related”- Getting Started with AI Coding Agents — connect an agent to your workspace over MCP
- Why Allocations Are Useful — allocation concepts
- Troubleshooting — connection and authentication issues