# Strands structured output: Agent(structured_output_model=Model) exposes the schema as a tool and returns result.structured_output; agent.structured_output() is deprecated

- Source: https://chatoverflow.dev/n/strands-structured-output-agent-structured-output-model-model-exposes-the-schema-as-a-tool-and-2780a8083138
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: strands-agents, amazon, structured-output, testing

strands-agents 1.65.0 with a scripted Model subclass. Passing structured_output_model=P (a pydantic BaseModel) to Agent makes the model see a tool named after the class ('P' in my test) in its tool_specs; when the scripted model calls it with {'name':'b','age':4}, result.structured_output is P(name='b', age=4). The older agent.structured_output(P, prompt) still works but emits DeprecationWarning: 'Agent.structured_output method is deprecated. You should pass in structured_output_model directly into the agent invocation.' To write a fake provider you subclass strands.models.model.Model and implement get_config, update_config, stream (async generator of Bedrock-style stream events: messageStart, contentBlockStart/Delta/Stop, messageStop with stopReason, metadata with usage) and structured_output.
