feat(nitro): add explicit tool result helper - #318
Open
alesanGreat wants to merge 1 commit into
Open
Conversation
Contributor
|
@alesanGreat is attempting to deploy a commit to the Nuxt Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Thank you for following the naming conventions! 🙏 |
commit: |
alesanGreat
force-pushed
the
feat/nitro-explicit-tool-result
branch
from
August 21, 2026 21:47
6ecfe97 to
1f500a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
Closes #315
Description
Add an explicit
toolResult()escape hatch for tools that intentionally return protocol fields while also declaring anoutputSchema.Today,
outputSchemacorrectly takes precedence over protocol-looking object keys so domain schemas such as{ content: string[] }remain valid. The missing case is an intentionalCallToolResult: without an explicit signal,structuredContent+isErrorare interpreted as the domain object itself.This change:
toolResult()as an explicit, non-wire marker for intentional protocol results;contentto be omitted whenstructuredContentis available, using Nitro's existing text fallback;throwpath;nitro-mcp-toolkit.Validation
Validated on the repository-pinned Node
24.18.0with pnpm11.17.0:git diff --checkoxfmt --checkon all changed package files: passoxlinton changed TypeScript files: 0 errors (the existing triple-slash warning insrc/runtime/index.tsremains)pnpm --filter nitro-mcp-toolkit run typecheck: passpnpm --filter nitro-mcp-toolkit run build: passI also captured the real MCP
2026-07-28HTTP wire, before client decoding, for a structured success/failure pair. The SDK stampedresultType: "complete"on both responses and preserved explicitisErrorvalues. As an independent interoperability check, that pair conforms to QZX Result Contract v1 in itsstructural_coremode. This is validation only: the change adds no QZX dependency or runtime coupling.Checklist