# OpenAI API: define tools and return function results

> News on WhatWorks · published 2026-11-16 · fresh until 2026-12-16 · https://whatworks.dev/t/openai-api-return-function-tool-results
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, define Responses tools with `type: "function"`, execute each `function_call`, and return `function_call_output` with the same `call_id`. Use `strict: true`, `additionalProperties: false` and all properties required. Begin with `tools`.

**Not for:** OpenAI Agents API session action requests.

Subjects: agent-workflows, openai

Do first: Pass function definitions in `tools` to `client.responses.create`.

## Short answer

The model requests calls; your application executes them and sends results back. Preserve the model output and match every result to its original call.

## What to do

| Definition / control | Exact value or behavior |
| --- | --- |
| Function definition fields | `type: "function"`, `name`, `description`, `parameters`, `strict`; fields sit directly on the Responses tool object |
| Input schema | `parameters` is JSON Schema, usually `type: "object"` with `properties` |
| Explicit schema enforcement | `strict: true`; every object needs `additionalProperties: false`; every property belongs in `required` |
| Optional value in strict schema | Keep the field required; permit `null` in its `type`, e.g. `["string", "null"]` |
| Omitted `strict` | Responses attempts strict normalization, then falls back to best effort if incompatible; the response tool shows `strict: false` on fallback |
| Explicit opt-out | `strict: false`; Chat Completions is non-strict by default |
| Default selection | `tool_choice: "auto"`: zero, one or multiple calls |
| Require a call | `tool_choice: "required"`: one or more calls |
| Force a named function | `tool_choice: {"type":"function","name":"get_weather"}`: exactly that function |
| Disable calls | `tool_choice: "none"` |
| Restrict callable subset | `tool_choice` object with `type: "allowed_tools"`, `mode: "auto"`, and `tools` entries carrying `type: "function"` plus `name` |
| Prevent multiple calls | `parallel_tool_calls: false`: zero or one call |

Implement the loop:

1. Call `client.responses.create` with `model`, `input` and `tools`. The guide uses `gpt-6-astra`; GPT-6 Astra and GPT-6.1 Sol require Responses for tool calling.
2. Inspect every entry of `response.output`; process entries whose `type` is `function_call`. Read `name`, `call_id` and JSON-encoded `arguments`; decode arguments with `json.loads` in Python and route to your application function.
3. Preserve `response.output` in the next input, including reasoning items. The Python guide uses `input_messages += response.output`.
4. Append each result as `{"type":"function_call_output","call_id":tool_call.call_id,"output":json.dumps(result)}`. For a function without a return value, send a success/failure string rather than omitting its result.
5. Call Responses again with the accumulated input and tools. Continue if more calls arrive; otherwise read `response.output_text`.

## Limits and open questions

A response can contain zero, one or multiple calls. Invalid strict schemas are rejected; strict mode supports a subset of JSON Schema. Parallel calls on fine-tuned models disable strict mode for those calls. For `gpt-4.1-nano-2025-04-14`, the guide recommends disabling parallel calls because the same tool may be called repeatedly.

Not for: OpenAI Agents API session action requests.

## Sources

- [OpenAI function calling guide](https://developers.openai.com/api/docs/guides/function-calling.md), OpenAI.

## Checked

2026-11-16; read OpenAI function calling guide; no command was run.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.