Skip to content

Conversation

@jlowin
Copy link
Owner

@jlowin jlowin commented Oct 16, 2025

This PR addresses issue #2115 by clarifying the documentation around how Image, Audio, and File helper objects can be returned from tools.

The current behavior is intentional: these helper objects are only converted to MCP content blocks when returned directly or in a top-level list/tuple. They cannot be nested inside dictionaries or other containers.

Closes #2115

Adds warning in tools documentation clarifying that Image, Audio, and File
helper objects cannot be nested in dictionaries or other containers. They
must be returned directly or in top-level lists/tuples.

Provides clear examples of what works vs what doesn't, and offers
alternatives using MCP native types or ToolResult for complex scenarios.

Closes #2115
@jlowin jlowin added the enhancement Improvement to existing functionality. For issues and smaller PR improvements. label Oct 16, 2025
@marvin-context-protocol marvin-context-protocol bot added documentation Updates to docs, examples, or guides. Primary change is documentation-related. and removed enhancement Improvement to existing functionality. For issues and smaller PR improvements. labels Oct 16, 2025
@jlowin jlowin merged commit 2f841c3 into main Oct 16, 2025
10 checks passed
@jlowin jlowin deleted the docs/clarify-image-container-limitations branch October 16, 2025 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Updates to docs, examples, or guides. Primary change is documentation-related.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image objects not serializing properly in MCP tool responses

2 participants