Opt-in structured output schema: {stdout, stderr, exitCode} #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally filed by @coilysiren on 2026-05-13T14:19:53Z - https://github.com/coilysiren/cli-mcp/issues/34
Today cli-mcp captures tool stdout/stderr as MCP text content and signals failure via
CallToolResult.IsError. Narrative, easy to read in a chat transcript.njayp/ophis standardizes on a structured output schema for every tool:
Easier for agents to parse programmatically. The exit code in particular is useful: ophis's docs note "Non-zero exit codes indicate command errors (not execution failures)" which lets an agent distinguish between "the tool ran and reported failure" and "the tool itself broke."
Proposal: add an opt-in
Options.StructuredOutput bool(or similar). When set, the tool's MCP output schema becomes the three-field object, andCallToolResult.StructuredContentcarries it. Keep text-content the default so existing consumers don't break.Open question: does anything in cli-mcp's in-process model make exit-code capture awkward?
root.Runreturns anerror, not an int; mapping that to a meaningfulexitCodecleanly is part of the design.