Prompt Buddy logoPrompt Buddy

openai · OpenAI Platform Docs

Function calling

Teaches how to implement tool calling by defining functions via JSON schemas, managing the model-to-application interaction loop, and utilizing tool search for large-scale function sets.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Function calling

Teaches how to implement tool calling by defining functions via JSON schemas, managing the model-to-application interaction loop, and utilizing tool search for large-scale function sets.

When To Use

Use when you need to connect an LLM to external APIs, databases, or custom application logic through structured tool definitions and execution loops.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/function-calling-workflow-guide.mdA guide explaining the tool calling flow and how to define functions for OpenAI models to interface with external systems.Questions about a guide explaining the tool calling flow and how to define functions for OpenAI models to interface with external sys...
examples/function-calling-openai-function-calling.textA text-based example demonstrating a model response containing a function call for weather information.Exact payloads, commands, or snippets shown in A text-based example demonstrating a model response containing a function call for weather information.
examples/function-calling-openai-function-calling-tool-definition.jsonA JSON object defining a weather retrieval function schema for use with OpenAI function calling.Exact payloads, commands, or snippets shown in A JSON object defining a weather retrieval function schema for use with OpenAI function calling.
examples/function-calling-openai-function-calling-tool-definition-2.jsonA JSON object defining a CRM toolset with a getcustomerprofile function and its required parameters for use with OpenAI function calling.Exact payloads, commands, or snippets shown in A JSON object defining a CRM toolset with a getcustomerprofile function and its required parameters for use with Open...
examples/function-calling-openai-function-calling-tool-choice-configuration.jsonA JSON object demonstrating the tool_choice parameter configuration for specifying allowed tools in a function calling request.Exact payloads, commands, or snippets shown in A JSON object demonstrating the toolchoice parameter configuration for specifying allowed tools in a function calling...
examples/function-calling-openai-function-calling-tool-call-response.jsonA JSON object representing a model response containing a tool call with specific input and call ID.Exact payloads, commands, or snippets shown in A JSON object representing a model response containing a tool call with specific input and call ID.
examples/function-calling-openai-function-calling-tool-call-response-2.jsonA JSON object representing a tool call response containing a custom math expansion function execution.Exact payloads, commands, or snippets shown in A JSON object representing a tool call response containing a custom math expansion function execution.
examples/function-calling-openai-function-calling-regex-pattern-extraction.textA text-based example demonstrating how to use function calling to extract specific sentence structures and entities using regular expressions.Exact payloads, commands, or snippets shown in A text-based example demonstrating how to use function calling to extract specific sentence structures and entities u...
examples/function-calling-openai-function-calling-regex-grammar.textA text-based example demonstrating how to use function calling to extract structured sentence components using regular expressions.Exact payloads, commands, or snippets shown in A text-based example demonstrating how to use function calling to extract structured sentence components using regula...
examples/function-calling-openai-function-calling-expression-parser-grammar.textA text-based grammar definition for parsing mathematical expressions involving numbers, operators, and terms.Exact payloads, commands, or snippets shown in A text-based grammar definition for parsing mathematical expressions involving numbers, operators, and terms.
examples/function-calling-openai-function-calling-tool-call-response-3.jsonA JSON object demonstrating a completed custom tool call response containing a timestamp input.Exact payloads, commands, or snippets shown in A JSON object demonstrating a completed custom tool call response containing a timestamp input.

What This Skill Covers

  • Function calling (also known as tool calling) provides a powerful and flexible way for OpenAI models to interface with external systems and access data outsi...
  • Main sections: How it works, The tool calling flow, Function tool example, Defining functions, Defining namespaces.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.openai.com/api/docs/guides/function-calling.md