Tool Calling Basics

Understanding tool schemas and how LLMs interpret function definitions

Tool Schemas

A tool schema is how you tell an LLM what a function does and what inputs it expects. It's the contract between your code and the AI.

📋Schema Format Comparison

Click each format to see the same tool in different schema styles

{
  "name": "get_weather",
  "description": "Get current weather for a location",
  "parameters": {
    "type": "object",
    "properties": {
      "location": {
        "type": "string",
        "description": "City name, e.g. Tokyo"
      },
      "unit": {
        "type": "string",
        "enum": ["celsius", "fahrenheit"],
        "description": "Temperature unit"
      }
    },
    "required": ["location"]
  }
}
� Note:
Most common format, uses JSON Schema for parameters

🔑 Essential Schema Elements

nameClear, action-oriented function name (e.g., get_weather, not weather)
descriptionExplains WHAT the tool does and WHEN to use it
parametersJSON Schema defining inputs with types and descriptions
requiredList of mandatory parameters (optional parameters are flexible)

✅ Schema Best Practices

✓ DO:
  • • Use verb-first names (get, create, update)
  • • Write clear, specific descriptions
  • • Include examples in descriptions
  • • Use enum for fixed options
✗ DON'T:
  • • Use vague names (handler, process)
  • • Write one-word descriptions
  • • Omit parameter descriptions
  • • Make everything required