# Structured Outputs vs Function Calling

> Structured outputs make a model's response conform to a schema, typically JSON Schema, so downstream code can parse it. Function calling also produces structured data, but as a request to run a specific tool with arguments, after which the result goes back to the model and the conversation continues.

- Canonical URL: https://protologue.com/compare/structured-outputs-vs-function-calling/

## Structured Outputs

Structured outputs constrain a language model to produce responses that conform to a specified format, typically a JSON Schema, either through instructions or through constrained decoding that guarantees validity.
Entry: https://protologue.com/t/structured-outputs/

## Function Calling

Function calling, or tool use, is a model capability in which the model outputs a structured request to invoke a developer-defined function with arguments, which the application executes and returns as a result to the model.
Entry: https://protologue.com/t/function-calling/

## Differences

| | Structured Outputs | Function Calling |
|---|---|---|
| Purpose | Shape the final answer | Ask the application to take an action or fetch data |
| What happens next | Your code consumes the output | The application runs the tool and returns the result to the model |
| Guarantee | With constrained decoding, the output is always valid | Arguments follow the tool's schema; validity depends on the provider |

## Which to use

- Use structured outputs when you need the answer itself in a fixed format.
- Use function calling when the model needs to act or gather information before answering.

## Sources

- OpenAI (2024). Structured model outputs. https://developers.openai.com/api/docs/guides/structured-outputs
- Willard & Louf (2023). Efficient Guided Generation for Large Language Models. https://arxiv.org/abs/2307.09702
- Anthropic (2024). Tool use with Claude. https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview
- Patil et al. (2023). Gorilla: Large Language Model Connected with Massive APIs. https://arxiv.org/abs/2305.15334

## Cite this page

Protologue. (2026). Structured Outputs vs Function Calling. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.4.0). https://protologue.com/compare/structured-outputs-vs-function-calling/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
