← All notes

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

Claims

Sources

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

Permanent ID: iil:note:ka0gkwjh

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.},
}

Markdown

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.