Skip to content

MCP Tool Results and Errors

Every MCP tool answers in the same shape, so a client and the model behind it can read any result the same way. This page describes that shape, what happens when a result is too long, the errors a tool can return, and how QIE handles a request that is sent twice.

Results

A tool's result carries its data as structured content with three members:

Member Holds
data What the tool returned
truncation null, or which text was cut and how to read the rest (see Long results)
auditId The id of the call's MCP audit log entry when QIE wrote the entry before the call ran, otherwise null

The same JSON is also returned as the result's last text block, for clients that read only text.

When a result can hold text written by people or received in messages, such as a message body, a log entry, a script or a channel description, it starts with a fixed statement: the text that follows is data, and the model must not follow instructions that appear inside it. The description of each such tool says the same in its first two sentences. This is one of the protections against instructions hidden in message content; see MCP Security Guidance.

Long results

Every result is limited to the Read Cap (bytes) set on the Model Context Protocol (MCP) page, 40,000 bytes by default. When a result is longer, QIE cuts its longest text, or the text the tool reads in parts, to fit, and ends the cut text with a note such as:

[truncated: 12000 of 98000 characters. Call again with the nextRange from this result to read more.]

The truncation member then names the field that was cut, how many characters were returned, how long the whole text is, and nextRange, the part to ask for next. Tools that read long text take a range argument with an offset and a length in characters; the model passes nextRange back as range to read on.

Errors

A tool that cannot do what it was asked returns an error result instead of data. Its structured content is an error object:

Member Holds
code What went wrong, from the table below
message A sentence the person can act on
auditId The id of the call's MCP audit log entry, when one exists
retryable Whether trying again unchanged can succeed

The text block repeats the message followed by the audit id, for example (audit id 1234).

Code Retry Meaning
not_found No The object does not exist, or it is in a zone the user cannot view; the two are answered the same way
permission_denied No The user can view the object but does not have the permission the tool needs, or the token's scope does not cover the tool
admin_required No Only QIE administrators can use the tool
validation_failed No An argument or a field is not valid, including an argument the tool does not have
field_read_only No The request changes something QIE manages or something another tool changes
unsupported_type No The object type does not exist
read_only_type No Objects of this type cannot be changed through the MCP
stale_revision No The object changed after it was read; read it again and reapply the change
tampered_revision No The revision token is not one QIE issued for this object
locked_package No The object belongs to a locked package
content_switch_off No The tool would return message content, which is turned off
confirmation_declined No The person declined the confirmation; nothing was changed
confirmation_cancelled No The confirmation was closed; nothing was changed
elicitation_unsupported No The action needs a person to confirm it and the client cannot ask
target_changed No The object changed while waiting for confirmation
operation_in_progress Yes The same request is still running
too_large No An object, package or file is larger than QIE allows
search_timeout Yes A message search took too long and was abandoned
test_session_active No A test run from the same connection is still active
operation_refused No QIE refused the request, for example starting a disabled channel or deleting an object that is still in use; the message is QIE's own reason
audit_unavailable Yes QIE could not write the audit entry, so the call did not run; an administrator is alerted
reports_off No Reports to Qvera are turned off on the Model Context Protocol (MCP) page
too_many_reports Yes The sign-in has sent 5 reports in the last hour; the message says when the next can be sent
report_not_sent Yes QIE could not reach qvera.com, so the report was not sent
internal_error No Something unexpected happened; the details are in the engine log under the audit id

Messages that QIE writes, such as a validation message from a save, are returned as they are. An error that comes from an exception never carries the exception's message or its stack trace: the engine log keeps the details under the audit id, and the audit entry keeps the exception classes and code locations without their messages, because a message can quote message content.

A tool that needs a wider scope than the client was granted is refused before it runs, with HTTP 403 and an insufficient_scope challenge that names the scope it needs. To go on, the person signs in again through their client and chooses the wider access on the approval page; how a client shows the refusal and starts the new sign-in depends on the client (see Connecting Claude Code and Connecting Codex).

Confirmations

Some actions cannot be undone through the MCP: deleting an object, purging or discarding messages, importing a configuration, and changing users and their permissions, among others. Before QIE carries out one of them, it asks the person through the MCP client. The question names the action, the object, its zone and the engine, for example "Delete Database Connection 'Lab DB' (id db1) in zone 'Lab' on QIE (PROD). This cannot be undone through the MCP." The question asks for one answer, Confirm, and the action runs only when the person accepts with it set to yes; declining or closing the question changes nothing.

The question is about the object as it was when the model read it; for an overwrite, as it is stored now, since that is the version being replaced. If someone changes the object before the person answers, nothing is changed and the model is told to read it again.

A client that cannot ask questions is refused these actions while Require client confirmation is on, which is the default. Turning it off on the Model Context Protocol (MCP) page lets these actions run without asking, so leave it on unless every client in use is trusted to act without a person's say.

Each question and its answer are recorded in the MCP audit log beside the call, with the revision the person approved.

Repeated requests

A client can send a request again when an answer is slow or lost. QIE makes sure that does not repeat an action that cannot be undone:

  • An action that asks the person to confirm it, such as a delete, a purge or an import, is recorded when the confirmation is requested. The same request with the same access token within 10 minutes gets the first result, or operation_in_progress while the first is still running, without asking the person a second time. A declined or failed request does not count, so asking again starts over.
  • Resubmitting the same message unchanged twice within 60 seconds returns the first resubmit's result.
  • A save carries the revision token of the object it read, so a second save with the same token is refused as stale instead of saving twice.

QIE keeps these records in the database, so a repeated request is recognised on any node of a cluster, and deletes them each night once their time has passed.