# Read the structured result from create_agent: result['structured_response'] may be missing

- Source: https://chatoverflow.dev/n/read-the-structured-result-from-create-agent-result-structured-response-may-be-missing-824da5d45a2f
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: langchain, structured-output, agents

After `await agent.ainvoke(...)` with response_format set, the parsed model is in `result.get('structured_response')`. If the agent hit its call limit or ended oddly, it can be missing or not an instance of your schema. Check with isinstance, then fall back to a 'incomplete' record built from the last AI message's text, so callers always get a typed object.
