Skip to content

Keep the returned value in MCP content when output was emitted - #1511

Merged
RhysSullivan merged 1 commit into
mainfrom
fix/emit-return-drop
Jul 31, 2026
Merged

Keep the returned value in MCP content when output was emitted#1511
RhysSullivan merged 1 commit into
mainfrom
fix/emit-return-drop

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

A script that both emit()s output and returns a value only carried the return value in structuredContent, so clients that ignore structuredContent dropped it entirely — the opposite of what the execute skill documented. Reported in #1509 (comment).

Now the rendered return value (plus logs, as before) is appended to the tool-result content after the emitted items. Skill wording updated to describe emit/return as composing rather than claiming emitted output is invisible to the model.

Covers the second half of #1509; the base64/ToolFile sandbox gap in the main report is separate.

@RhysSullivan
RhysSullivan marked this pull request as ready for review July 31, 2026 20:35
@RhysSullivan
RhysSullivan merged commit 7eb795d into main Jul 31, 2026
16 of 19 checks passed
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant