An MCP server for AI agents
- What
- A Model Context Protocol server that lets the company's internal AI agents answer questions about excess inventory, using the decision engine's results.
- Result
- In production for internal users since October 2026. Designed so an agent cannot sound more certain than the data behind its answer.
- My role
- I built the server on the company's shared MCP platform, following its established server pattern and extending it. Afterwards I taught my team to build their own.
Answer
Example product A. Best action: a promotion. Estimated net cashflow is higher than for liquidation or disposal.
- Scope
- One product, US only
- Source
- Rebuilt today
- Limits
- A simulated estimate, not recovered cash
Refused
Example product B. No recommendation. The source data is stale, so no numbers are returned.
- Scope
- One product, US only
- Source
- Last rebuilt 6 days ago
- Limits
- This does not mean there is no excess
An illustration with invented products and data. It shows the two kinds of answer an agent can receive.
Read the full story
The design rests on a few rules:
- The model never writes SQL. The queries are fixed and parameterized, and the agent only chooses the product.
- The server fails closed. It returns numbers only when the source data is fresh, covers the product and is clean. Otherwise it returns a named refusal.
- Freshness is judged by when the source tables were rebuilt, not when they were last touched, because background maintenance can make a stalled job look fresh.
- Every answer carries its evidence, refusals included: scope, source freshness, row counts and stated limitations.
- A wording contract sets what an agent may say about the numbers, and tests check the tool's own messages for forbidden language such as "guaranteed".
This is the same idea as my research on confidence: a system should know, and say, how far its answer can be trusted. After building the server I gave my team a 45-minute session on building their own.
Python, Model Context Protocol, SQL.