Self-referencing types (e.g., Pydantic models or dataclasses that contain a field referencing themselves)…
Self-referencing types (e.g., Pydantic models or dataclasses that contain a field referencing themselves)…: a task in LegoFlow-SWE (Harbor dataset). When a tool's return type is a Pydantic model or dataclass containing a self-referencing field (e.g., list "ReturnThing" ), FastMCP incorrectly…
The task
When a tool's return type is a Pydantic model or dataclass containing a self-referencing field (e.g., `list["ReturnThing"]`), FastMCP incorrectly treats it as a primitive type and wraps the result in a `{"result": ...}` envelope instead of returning the structured object directly.
Part of Lego-X/LegoFlow-SWE.