Back to guide/General Productivity

Function Calling Schema Design

GPT-4o selects functions based on the description field, so crafting clear one-sentence descriptions is critical. Including enum values and realistic defaults reduces hallucinated parameter values at runtime. The confirm flag for destructive actions is a safety pattern that's easy to forget.

gpt-4o-promptsapplicationDescriptionavailableActionsinteractionPattern
Edit View
Prompt
Design a function calling schema for a {{applicationDescription}} that integrates with GPT-4o.

**Available actions the AI should be able to take:**
{{availableActions}}

**For each function, generate:**
1. Function name (snake_case, descriptive)
2. Description (one sentence — GPT-4o uses this to decide when to call it)
3. Parameters as JSON Schema with:
   - Type, description, and enum values where applicable
   - Required vs optional parameters
   - Realistic default values
4. Example call with realistic parameter values

**Additional requirements:**
- Include error handling parameters where appropriate
- Add a \`confirm\` boolean parameter for destructive actions
- Design for {{interactionPattern}} (single-turn / multi-turn / autonomous)

Output as a complete OpenAI functions array in JSON format, ready to paste into an API call.

Variables to customize

{{applicationDescription}}{{availableActions}}{{interactionPattern}}

Why this prompt works

GPT-4o selects functions based on the description field, so crafting clear one-sentence descriptions is critical. Including enum values and realistic defaults reduces hallucinated parameter values at runtime. The confirm flag for destructive actions is a safety pattern that's easy to forget.

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.