81 MCP tools, and none has its own logic
Flair's MCP server has 81 tools, and none of them has its own logic. Each is a business action with one Zod schema, one set of rules and an audit in the database, shared by the API, the web app and Claude.
Say Claude tries to update a customer’s details from a chat it read five minutes ago. Since then, my co-founder has edited the same customer in the web app. Claude’s call comes back refused: “This contact changed after it was opened. Reload it before saving again.”
That’s word for word what she’d see in the web app if she did the same thing. It isn’t a copy of the message. It’s the same code.
In the last part, Claude quoted, created an order and issued a confirmation link from one WhatsApp conversation. The obvious question is what stops it doing something the web app would never allow. The answer is that there’s nothing separate to stop. Claude goes through the same code as everyone else.
The same action, three doors
Each business action in Flair v2 is written once, with defineAction, and serves three doors: our Hono API, the web app staff click through, and the MCP tool Claude calls.
That matters more than it sounds. A rule like “you can’t issue a link for an order with no priced items” lives in one place. Staff clicking a button and Claude calling a tool hit the same check and get the same error message. There is no second, looser copy of the business written just for the AI.
I’d already shared one action between the API, the web app and MCP in Flair v1, so I knew what this needed. In v2 it became the rule for everything.
It’s DRY taken all the way. A new feature is written once, and it gets its API route, its web form check and its MCP tool for a few lines of metadata, not new logic. That saves time on every feature after, and there’s only one place to fix when a rule changes.
Checked once, recorded everywhere
Every action has one Zod schema for its input, kept in a shared package. The Hono route, the MCP tool and the web form all check input against that same schema; for about half the tools, MCP first maps the v1 field names onto it. A bad field comes back to Claude as an ordinary tool error that lists every field it got wrong, so it can fix the call and try again.
That’s the refusal from the start of this post. The business rules live inside the action, each refusal has a name, like contact.stale, and each name has one message.
Then there’s the audit. A trigger on 38 tables records every change, field by field, inside the same transaction as the change itself. Each record also says where the change came from: the web app, mobile, MCP, a webhook, a background job, or the database directly. So when an order changes, I can see whether a person did it in the web app, Claude did it over MCP, or a job did it on its own.
Because the trigger lives in the database, no code path can forget it. A write that rolls back takes its audit with it, so the log never shows a change that didn’t happen.
How the tools are designed
Each action with an MCP block becomes one tool, named verb then noun: list_orders, preview_quote, cancel_delivery. The names are the same as in Flair v1, so Claude only had to reconnect at the switch.
The tools are grouped by module, the same way the code is:
| Group | Tools |
|---|---|
| Orders | 20 |
| Materials, suppliers and costs | 19 |
| Customers, occasions and calendar | 11 |
| Products, recipes and quotes | 10 |
| Chats and quote drafts | 8 |
| Delivery | 6 |
| Design photos | 5 |
| Analytics | 1 |
Each group file adds what a model needs to use a tool well: a title, a description that carries the business rules, a description for each field, and hints. Reads are marked read-only. Writes aren’t, and only the ones safe to repeat say so. Five tools are marked destructive, such as cancelling an order or merging two materials, so the app calling them knows to take care.
A few patterns repeat across the groups:
- Pickers.
list_product_options,list_material_optionsand their kind return a short page of names and ids for choosing something, not full records. - One page shape. Almost every list returns its data with the total, page size, current page and last page.
- Plain results. A tool returns the action’s own data. A design photo comes back as an image.
The lessonWrite the action once. The MCP tool is just one more door onto it.
What I’d tell anyone building an MCP server
- Don’t write tools; expose actions. A tool with its own logic is a second copy of your business that will drift.
- One schema per action, everywhere. The API, the form and the model should all fail on the same bad field, with the same message.
- Put the audit in the database. A trigger can’t be skipped by a code path someone forgot.
- Write tool descriptions for a model. Business rules, field meanings and read-only or destructive hints are how it uses a tool well.
These 81 tools are for people working with Claude. Our WhatsApp agent talks to customers on its own, and it gets a very different set: just ten. Choosing how to build it nearly went another way, twice in one month.
