Structured output constrains the model's final answer to a JSON schema you send. Use it when you want data in a fixed shape: extract invoice fields, or classify a ticket with a reason. In the Microsoft.Extensions.AI package (the standard .NET AI abstractions), IChatClient.GetResponseAsync<T>() generates the schema from T and deserialises the reply into ChatResponse<T>. A valid shape can still hold wrong data, so validate the values (ranges, enums, totals that add up) with FluentValidation or data annotations, and retry or reject on failure.
Tools (function calling) are C# methods you describe to the model with AIFunctionFactory.Create. The model asks to call them mid-conversation to fetch live data ("look up order 123") or take an action, and your code runs them and returns the result. Use tools only when the model needs something it doesn't have. Structured output is one call with fewer failure modes than a tool loop.
Checks they pick the simplest mechanism for the job and never trust model output without validation.
Green flags
Red flags
Last updated 23 Nov 2026.