Available
All articles

MCP

Letting a model query live inventory and orders is powerful and risky. The pattern that keeps it useful: typed tools, validated inputs and scoped access.
6 min read
Ali Kazim

Giving an LLM safe access to your warehouse data

Warehouse data is some of the most useful data a business has, and some of the hardest to reach. Stock levels, order status and shipment progress usually live in a system built for people clicking through screens. When someone wants an answer, they log in, filter, export and copy. Point an AI model at that and it cannot help, because it cannot see any of it.

The obvious fix is to give the model access. The obvious mistake is to give it too much. The pattern I use keeps the model useful and the warehouse safe, and it comes down to three things: typed tools, validated inputs and scoped access.

Why raw access is the wrong starting point

The fastest way to connect a model to a database is to hand it a connection string and let it write queries. It demos beautifully. It is also a bad idea in production. A model that can write any query can read any table, join things it should not, and run something slow enough to hurt the people who actually use the system. It will also, sooner or later, misread a column name and return an answer that looks right and is not.

The problem is not that models are careless. It is that an open door gives you nothing to check. If every request is a free-form query, you cannot say in advance what the model is allowed to do, and you cannot tell afterwards whether it did the right thing.

The pattern: typed tools, validated inputs, scoped access

Instead of a door, give the model a counter with a short menu. Each item on the menu is a tool that does one job well.

  • Typed tools. A handful of named actions like search orders, check stock for a product or get shipment status. Each one runs a query you wrote and tested, not one the model invented.
  • Validated inputs. Every tool declares exactly what it accepts: an order status from a fixed list, a date range, a product code in a known format. Anything that does not match is rejected before it reaches the warehouse system.
  • Scoped access. The server decides who can call which tool and on what data. A support agent might see orders but not supplier costs. The model never holds the credentials, so it cannot go around the rules.

This is how I built Eva MCP, which runs in production against an existing warehouse management system. It exposes a small set of typed tools for orders, stock and shipments, validates every call against a schema and only allows scoped access. The model gets reliable answers in plain English, and it never touches the warehouse system directly.

A model with a query window is a guess engine with a database attached. A model with five good tools is a colleague who knows exactly which questions to ask.

Choosing the first tools

Start with the questions people already ask. Sit with the team for an afternoon and write down what they look up, how often, and what they do with the answer. You will usually find the same few questions again and again: where is this order, how much of this do we have, what is running late. Those become your first tools.

Keep them narrow. A tool that answers one question well is easier to test, easier to secure and easier for the model to choose correctly than one broad tool with a dozen optional filters. If a question needs two steps, let the model call two tools. That is what it is good at.

Read first, then write

Every first version I build is read-only. The model can look things up but cannot change anything. That gives the team time to see how it behaves with real questions and real data before it is trusted with anything that has consequences.

When writing does come, it comes one action at a time, with its own tool, its own validation and a log entry for every call. Changing an order status or flagging a shipment is a deliberate step you add, not something the model gets by accident because it had a connection string.

If your warehouse data is stuck behind screens and your team is exporting spreadsheets to answer everyday questions, I would be glad to talk through what a small, safe first version could look like. Sometimes the answer is a better report rather than a model, and that is worth knowing too.

If you want to go deeper on MCP or explore how it could apply to your stack, the tools directory is a good starting point, or reach out directly if you have a specific question.

Written by Ali Kazim

Independent AI engineer, Melbourne.

Previously senior backend engineer at Cm3 (then Wesfarmers-owned), where he built core systems including OnSite and its voice assistant, and won three consecutive AWS-hosted hackathons at first place.

Skip the agency queue.Start building this week.

Melbourne-based. Founder-first. Available for the right problem.