Skip to content

Add code mode forward_output helper#22190

Open
fjord-oai wants to merge 1 commit into
mainfrom
fjord/output
Open

Add code mode forward_output helper#22190
fjord-oai wants to merge 1 commit into
mainfrom
fjord/output

Conversation

@fjord-oai
Copy link
Copy Markdown
Contributor

Summary

Adds a forward_output(...) helper to code-mode execution.

The helper is for the narrow case where code-mode JS wants to directly forward tool output without manually looping over content blocks and calling text(...) / image(...).

Supported shapes:

  • MCP CallToolResult.content
  • function-output content_items / contentItems
  • individual text/image content blocks
  • image-url result objects
  • string output result objects

It intentionally throws for arbitrary arrays/objects or content block types other than text/image, so models stay explicit when preprocessing is needed.

@fjord-oai fjord-oai requested a review from a team as a code owner May 11, 2026 18:53
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