MCP tools that can't leak your users' data: numbers and closed enums only
When you let ChatGPT or Claude call your app through the Model Context Protocol, every tool response leaves your service and lands in someone else's context window. The assistant may quote it, summarise it or keep it in
When you let ChatGPT or Claude call your app through the Model Context Protocol, every tool response leaves your service and lands in someone else's context window. The assistant may quote it, summarise it or keep it in a conversation you'll never see.
We build Le Confidant, which analyses personal chats, so we treat our MCP tools as an export boundary, not as another API. This post shows the design rules, using a made-up example throughout: a support-chat analyser that reports how a support team handles conversations. The fields, values and labels below are invented for this post.
Rule 1: numbers and closed enums, never text
The simplest way to avoid leaking text is to never return any. A tool in the fictional analyser could answer "how is this conversation going?" like this:
{
"conversation": { "messages": 128, "days": 6, "participants": 2 },
"responsiveness": {
"A": { "medianReplyMinutes": 4 },
"B": { "medianReplyMinutes": 37 }
},
"tone": { "label": "mostly_positive", "trend": "improving" },
"findings": { "positive": 5, "concerning": 1 }
}
Everything in it is a count, a duration or a label from a fixed list. There's no message text, no names and no paragraph written by a model. The assistant can still explain the result in its own words, and it has nothing private to quote.
Closed enums matter as much as numbers. A free-text field like "summary" or "note" is where private details sneak back in, one helpful sentence at a time.
Rule 2: people are A and B
Names are the most identifying thing in a conversation, so they never cross the boundary. Participants appear as A and B, consistently, and the user knows who is who.
Rule 3: read what's already computed
A tool call should never start new analysis. It reads stored results and returns them, or says they aren't ready. That keeps two promises at once: an assistant can't trigger model spend on your side, and it can't get a fresh view of the raw data that the product itself never showed.
Rule 4: access follows the user's own access
Connecting an assistant should never outlive the user's right to the data:
- The user connects explicitly, with an OAuth consent screen, and only for data they own.
- Tokens are bound to one MCP URL, so a token issued for one endpoint is useless at another.
- Only assistants you've verified can connect. Adding a new client is a deliberate decision, not a config flag.
- Access ends when the user's access ends, and the user can disconnect at any time.
Rule 5: keep public tools apart
Some tools don't need user data at all, such as formatting or link helpers. They can be public, but they never touch a user's data, and their inputs aren't logged. Mixing the two kinds in one tool is how a convenience feature becomes a leak.
Rule 6: your output schema is a contract
Assistant stores review the tools you publish, including what they return. Adding a new enum value or reshaping a field can mean a new review. So design the output carefully up front, add new information as optional fields or new tools, and treat a breaking change to a schema like a breaking change to a public API.
The trade-off
Numbers-only tools are less impressive in a demo than a tool that returns a ready-made summary. But they let users bring their data into the assistant they already use without handing that assistant anything you wouldn't publish. For a product built on personal conversations, that's the only version worth shipping.
If you're curious how this looks for users, there's a short guide to connecting Le Confidant to Claude or ChatGPT.
This article was written with the help of AI and reviewed by the Mnemonica team. The support-chat examples are fictional.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.