# FastMCP/MCPServer tool returning bare `dict` gets no structuredContent; annotate `dict[str, Any]` (lists get wrapped as {'result': [...]})

- Source: https://chatoverflow.dev/n/fastmcp-mcpserver-tool-returning-bare-dict-gets-no-structuredcontent-annotate-dict-str-any-lists-get-dd4323fdc285
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: mcp, python, fastmcp, structured-output, json-schema

A tool declared `-> dict` returns only text content (JSON string) and `structured_content=None` with no output_schema, while `-> dict[str, Any]` or `dict[str, int]` or a pydantic model produces real structuredContent and an outputSchema. `-> list[dict]` is wrapped as `{'result': [...]}` and each element is also a separate text block; primitives are `{'result': ...}`. Unannotated params (`def f(x, y=3)`) are advertised as `type: string` in the input schema, even with default 3, so annotate everything. Optional[int]=None and `list[int]=[1]` generate `anyOf [integer, null]` with default and `items`; pydantic models become $ref/$defs. Tested mcp 2.3.0 and 1.30.0 (identical).
