Code mode · Read results and errors
Code mode · Read results and errors from the built-in skills in Executor 2.0.0-beta.79.
This page covers Read results and errors from the built-in skills shipped with Executor 2.0.0-beta.79. It contains code-mode/SKILL.md.
Previous: Code mode
Read results and errors
A completed result has execution.ok. On success, execution.value holds what
the program returned. On failure, execution.error has a kind, a message,
and for Executor errors a response with code, status, message,
recovery and retryable. recovery.action is for the user;
recovery.instructions are for you. retryable means an unchanged repeat may
help and is considered safe. It does not guarantee success. Correcting input,
configuration or access may allow a new attempt even when retryable is false.
Never rerun an entire execute program merely to retry one failed tool.
toolCalls lists every call in order with its outcome.
Promise.all rejects on the first failure. If the program does not catch it,
the program ends, and calls still running are interrupted; calls marked
success did run. To keep the results of the calls that succeed when one
fails, use Promise.allSettled or a .catch on each call.
ParseError,UnsupportedSyntax: fix the program;locationpoints at it.UnknownTool: the path is wrong, its app did not load, or the app was deployed after this execution loaded it. CheckunavailableAppsandsuggestions, then search again in a new execution.InvalidToolInput, or aresponse.codeofInputInvalid: the input does not match the signature; the message names the fields.ToolFailure: the tool or its service failed. Followrecovery.ToolCallLimitExceeded,TimeoutExceeded: split the work into smaller executions.
A remote MCP tool returns its whole result. isError: true there means the
tool says it failed: the call does not throw, and its outcome is failure.
Check isError before using such a result. Other fields, such as ok, mean
what the tool’s description says.
An outcome of success means only that the call returned normally, with no
tool error reported to Executor. It does not show that the intended action
happened: check the returned value, such as isError or the app’s own status
fields, before treating it as done. failure and interrupted calls may have
had effects. Effects are never rolled back. When Executor could not confirm a failed write’s
outcome, its recovery says so: do not repeat it automatically.
Inside a program, a caught tool error’s message is the same JSON as
response, so a program can handle expected failures itself.
status: "capacity-exceeded" means the server is running too many programs.
Wait briefly, then retry.
See images, hear audio and read files
You can look at any image, listen to any audio and read any file a tool gives
you. Wherever the value call or execute returns holds one of these MCP
blocks, at any depth, with its bytes in standard or URL-safe base64, you receive
it as its own content block instead of base64 text:
{ type: "image", mimeType, data }and{ type: "audio", mimeType, data }arrive as media. The JSON shows{ type, mimeType, contentIndex }in place.{ type: "resource", resource: { uri, mimeType, blob } }arrives as a file, such as a PDF, which your client opens or saves for you to read. The JSON shows{ type, resource: { uri, mimeType }, contentIndex }in place.
The same block repeated is sent once. Screenshots from MCP servers already arrive as images, and some tools return files as resources, such as email attachments. Inside the program the block is whole, so its bytes can be passed to another tool.
When a tool returns bytes some other way, such as { base64 }, return them in
one of these shapes from execute: an image block for an image, and otherwise
a resource whose uri ends in the file’s name:
const file = await tools.example.download({ id });
return {
type: "resource",
resource: { uri: "file:///report.pdf", mimeType: "application/pdf", blob: file.base64 },
};
Never return, read, decode or describe base64 as text; return it as a block and
look. The executor CLI writes each block to a file and prints its path
beside its contentIndex.
Send feedback with the Executor app’s feedback.submit tool when Executor gets
in your way or something works especially well; the executor skill says how.