OpenAI-style function calling: tools, tool_calls and finish_reason
Answer: In the Chat Completions API, tools is an optional parameter that carries function specifications so the model can generate arguments that match them. The API does not actually execute any function calls; developers execute them using the model outputs.
Response shape
When a function is used, the response has "finish_reason": "tool_calls" and a tool_calls object with the function name and generated arguments. By default the model decides when to use a function; tool_choice can force a specific function or "none".
Same format on open models
vLLM's OpenAI-compatible server accepts the same tools request, started with --enable-auto-tool-choice and a --tool-call-parser such as llama3_json. Its quickstart points the OpenAI client at base_url="http://localhost:8000/v1".
See also
- ao-tools-tool-choice-across-providers
- ao-tools-vllm-tool-parsers
- ao-idlehw-openai-compatible-servers
- ao-tools-gemini-function-calling
Claims
- id: C1 claim: tools carries function specifications. source: S1 evidence: "
toolsis an optional parameter in the Chat Completion API"
- id: C2 claim: A used function sets finish_reason tool_calls. source: S1 evidence: "\"finish_reason\": \"tool_calls\""
- id: C3 claim: vLLM needs auto tool choice enabled. source: S2 evidence: "--enable-auto-tool-choice"
Sources
- [S1] How to call functions with chat models. openai/openai-cookbook (GitHub). https://github.com/openai/openai-cookbook/blob/main/examples/How_to_call_functions_with_chat_models.ipynb . License: MIT. Accessed 2026-11-16.
- [S2] Tool calling (vLLM docs). vllm-project/vllm (GitHub). https://github.com/vllm-project/vllm/blob/main/docs/features/tool_calling.md . License: Apache-2.0. Accessed 2026-11-16.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: openai/openai-cookbook (GitHub), How to call functions with chat models, MIT (https://raw.githubusercontent.com/openai/openai-cookbook/main/LICENSE). Copyright (c) 2025 OpenAI; vllm-project/vllm (GitHub), Tool calling (vLLM docs), Apache-2.0 (https://raw.githubusercontent.com/vllm-project/vllm/main/LICENSE). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: openai/openai-cookbook (GitHub), How to call functions with chat models, MIT (https://raw.githubusercontent.com/openai/openai-cookbook/main/LICENSE). Copyright (c) 2025 OpenAI; vllm-project/vllm (GitHub), Tool calling (vLLM docs), Apache-2.0 (https://raw.githubusercontent.com/vllm-project/vllm/main/LICENSE).
Cite this
iinventedlight. 2026. "OpenAI-style function calling: tools, tool_calls and finish_reason." iinventedlight Library, iil:note:ka0gkwjh, version of 2026-11-16. https://iinventedlight.com/library/notes/ao-tools-openai-function-calling/. License: CC-BY-4.0.
@misc{iil_note_ka0gkwjh,
author = {{iinventedlight}},
title = {{OpenAI-style function calling: tools, tool\_calls and finish\_reason}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-16},
url = {https://iinventedlight.com/library/notes/ao-tools-openai-function-calling/},
note = {Permanent ID iil:note:ka0gkwjh. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/ao-tools-openai-function-calling.md.