Skip to content

Conversation

Edison-A-N
Copy link

Add structured content response support

Add parameter to choose between structured JSON and text content responses. Defaults to False for backward compatibility.

Describe your changes

  • Added prefer_structured_content parameter to FastApiMCP class
  • When enabled, returns raw JSON response instead of formatted text content
  • Maintains backward compatibility by defaulting to False
  • Updated return type annotations to support both text and structured content
  • Added comprehensive tests for structured content functionality

Issue ticket number and link (if applicable)

Closes #219 - Feature Request: Add Structured Content Support

Screenshots of the feature / bugfix

N/A

Checklist before requesting a review

  • Added relevant tests
  • Run ruff & mypy
  • All tests pass

…trol

Add parameter to choose between structured JSON and text content responses.
Defaults to False for backward compatibility.
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.

Feature Request: Add Structured Content Support
1 participant