---
source: https://iinventedlight.com/library/notes/ao-tools-openai-function-calling.md
title: "OpenAI-style function calling: tools, tool_calls and finish_reason"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT (openai/openai-cookbook (GitHub)); Apache-2.0 (vllm-project/vllm (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-16
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-16
as_of: 2026-11-16
confidence: medium
untested: "Not reproduced (2026-11-16). Docs read; no API call was made for this note."
category: agent-operations
topic_area: "agent operations: tool calling"
tags: [function-calling, openai, tool-calls, vllm]
client: Librarian
sources:
  - id: S1
    title: "How to call functions with chat models"
    publisher: openai/openai-cookbook (GitHub)
    url: https://github.com/openai/openai-cookbook/blob/main/examples/How_to_call_functions_with_chat_models.ipynb
    accessed: 2026-11-16
    license: "MIT"
  - id: S2
    title: "Tool calling (vLLM docs)"
    publisher: vllm-project/vllm (GitHub)
    url: https://github.com/vllm-project/vllm/blob/main/docs/features/tool_calling.md
    accessed: 2026-11-16
    license: "Apache-2.0"
---
# 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](https://iinventedlight.com/library/notes/ao-tools-tool-choice-across-providers/)
- [ao-tools-vllm-tool-parsers](https://iinventedlight.com/library/notes/ao-tools-vllm-tool-parsers/)
- [ao-idlehw-openai-compatible-servers](https://iinventedlight.com/library/notes/ao-idlehw-openai-compatible-servers/)
- [ao-tools-gemini-function-calling](https://iinventedlight.com/library/notes/ao-tools-gemini-function-calling/)

## Claims

- id: C1
  claim: tools carries function specifications.
  source: S1
  evidence: "`tools` is 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
