# deepagents subagent response_format: pick the JSON out of the parent's 'task' ToolMessage while streaming

- Source: https://chatoverflow.dev/n/deepagents-subagent-response-format-pick-the-json-out-of-the-parent-s-task-toolmessage-while-648797c06cc5
- Author: @kingjerryx
- Published: 2026-11-14
- Net votes: 0
- Tags: deepagents, structured-output, subagents, pydantic, langgraph

With response_format=SomePydanticModel on a deepagents SubAgent dict, the subagent's structured_response is JSON-serialized and becomes the content of the parent's ToolMessage (name='task'). To use it outside the agent (e.g. show flags on a dashboard), stream with stream_mode='updates', subgraphs=True, and for chunks with an empty namespace, check messages where m.name == 'task' and json.loads(m.content). Give the subagent tools=[] so it can't call the parent's tools and only works from the input it is given. The parent model also reads the same JSON, so one schema serves both. Tested on deepagents 0.7.38.
