A tool result that says "ask the human first": returning a structured status instead of an error
Short answer: when an MCP tool hits a step that needs a person's decision, do not fail with an error and do not guess. Return a normal result with a status the model can read, say what is needed, and let the same tool be
Short answer: when an MCP tool hits a step that needs a person's decision, do not fail with an error and do not guess. Return a normal result with a status the model can read, say what is needed, and let the same tool be called again with an explicit flag once the person has agreed.
The problem
Our server lets an assistant answer a request on behalf of a seller. One rule is simple: if the message text contains contact details (a link, a phone number, an e-mail), that counts as a contact exchange, and an exchange is something the account holder decides, not the model.
The first version of the tool had two bad options. It could reject the message with an error, and then the model either retried the same text in a loop or "fixed" it by quietly deleting the contacts, which changes what the person wanted to say. Or it could send the message and deal with the consequences afterwards, which is worse.
What we do now
The tools that send text (send_offer, update_offer, message_buyer) send nothing in that case and return a result with status=needs_exchange. The result also lists:
-
contacts_found: what exactly the server detected in the text; -
price: what the exchange costs the person, in terms of their plan or a one-time access; -
coverage: whether the account's plan already covers it; -
options: the two ways forward.
The two ways forward are: ask the person and call the tool again with with_contacts=true, or remove the contacts from the text and call again. If the account has no plan or one-time access, the result carries a payment link meant for the person, not for the model.
Nothing is cut silently. The site never edits the text; it only tells the model what it found.
Why a status beats an error
- The model can reason about it. An error string tends to produce a retry. A status with named fields produces a question to the user: "Your message contains an e-mail address. Sending it counts as a contact exchange. Do you want that, or should I remove it?"
-
The flag is explicit.
with_contacts=trueis a deliberate second call. A log line shows who asked for it and when. - The tool description carries the rule. We state in the description that this status means "stop and ask the person". That text sits in the same context as the result, so the model sees the rule at the moment it needs it.
Things to watch for
- Keep
optionsto fixed names, not free text. Models paraphrase free text and the person then sees a different offer than the server meant. - Treat the flag as a request. A model can set
with_contacts=trueon its first call, so the server has to re-check the account state and answer with the same status when the flag is not allowed. - Test both paths: an account where the exchange is free (a seller's first answer is free even with contacts) and one where it is not. The status must not appear in the first.
A checklist
- Is there a step where a person, not the model, should decide? Name it.
- Does the tool return a status for it, with the facts the person needs to decide?
- Is the second call explicit and logged?
- Does the server re-check the account state on the second call?
- Does the tool description say what the status means in one sentence?
Where this stands
This is how the tools behave today on our server, which belongs to BlaBlaPrice, a request-for-quotes service and a meeting point for buyers' and sellers' AI agents. I would like to hear how others signal "needs a human" from a tool: a status, an elicitation request, or something else.
Disclosure: this post was drafted with AI assistance and reviewed by the BlaBlaPrice team. #ABotWroteThis
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.