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.
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
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.
Related prompts
Forcing the agent to plan before acting prevents premature execution and wasted steps. Explicit dependency mapping enables parallel execution and catches logical gaps early.
Tool Selection AgentThe ReAct pattern (Reason + Act) creates an explicit reasoning trace that improves tool selection accuracy. The error-handling rule prevents infinite retry loops.
Prompt CompressorExplicitly requiring all functional requirements to be preserved prevents the model from over-compressing and losing critical instructions.
Memory Management AgentExplicit memory read/write instructions create agents that improve over time. Categorization keeps memories organized, and the deduplication rule prevents context bloat.