Function Schema Builder
Build function/tool schemas for OpenAI and Anthropic function calling
Function Definition
Parameters
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City and country, e.g., 'London, UK'"
},
"unit": {
"type": "string",
"description": "Temperature unit",
"enum": [
"celsius",
"fahrenheit"
]
}
},
"required": [
"location"
]
}
}
}Related Tools
OpenAI API Builder
Construct OpenAI API requests visually and export code in multiple languages
Rate Limit Calculator
Calculate allowed requests and tokens per minute based on tier limits
AI Response Parser
Parse and visualize complex JSON responses from LLM APIs
Retry Strategy Generator
Generate exponential backoff and retry logic code for robust API calls
Streaming Response Simulator
Simulate and test UI handling of streaming LLM responses (SSE)
Tool Definition Generator
Generate standardized tool definitions for AI agents from code
Function Schema Builder: Create Tool Definitions for LLM Function Calling
Function calling (also called tool use) allows LLMs to invoke external functions and APIs. This builder helps you create properly formatted function schemas for both OpenAI and Anthropic, ensuring your tools work correctly with each provider's API.
Define your function's name, description, and parameters, and the builder will generate the correct JSON schema for each provider.
Best Practices for Function Definitions
Function Names
Use snake_case and be descriptive: get_weather, search_documents, create_calendar_event. Avoid generic names
like do_action.
Descriptions
Clear descriptions help the model decide when to use the function. Include what it does, when to use it, and any important constraints.
Parameter Descriptions
Include examples in descriptions: "City and country, e.g., 'London, UK'" is better than just "Location". Use enum when there are fixed valid values.
