feat: Return structured content from MCP tool responses#3
Merged
dankelleher merged 6 commits intomainfrom Feb 11, 2026
Merged
Conversation
- Add etc/scripts/push-to-ecr.sh for building and pushing multi-arch images to dev/prod ECR - Add etc/scripts/promote.sh for promoting images from dev to prod ECR using crane - Pin Dockerfile base images to SHA digests for supply-chain security - Upgrade all dependencies to latest versions via uv lock --upgrade
Unquoted echo is intentional here — shell word splitting converts the tab-separated aws sts output to spaces so cut -d' ' works.
Tools now return raw Python data (dict/str) instead of pre-serialized List[TextContent]. FastMCP auto-generates both content (backward-compat text) and structuredContent (raw JSON object) from return type annotations, plus outputSchema in list_tools responses. - Add to_jsonable() helper for PostgreSQL type conversion via orjson - Refactor all 9 tools to return dict[str, Any] or str - Let exceptions propagate for FastMCP error handling - Update top_queries_calc to return list[dict] and raise on missing extension
…ured-content-tool-responses
Define TypedDict classes for all dict-returning tools so FastMCP
generates JSON schemas with explicit properties and types instead
of opaque {"type": "object", "additionalProperties": true}.
Uses only primitive types and dict[str, Any] to stay within MCP's
JSON Schema subset (no $defs/$ref/anyOf).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
dict[str, Any]orstr) instead of pre-serializedList[TextContent]content(backward-compat text) andstructuredContent(raw JSON object) from return type annotationsoutputSchemais now included inlist_toolsresponses for all toolsto_jsonable()helper for converting PostgreSQL types (Decimal, timedelta, bytes) to JSON-native Python typesisError: trueerror responsestop_queries_calcreturnslist[dict[str, Any]]and raisesValueErrorwhen pg_stat_statements is missing