Home/Agentic AI/Function Schemas/JSON Schema Basics

Function Schemas

Understanding JSON Schema structure

JSON Schema Anatomy

Every function schema has four essential properties that define how AI agents interact with your tools.

🔧Interactive Property Explorer

Click each property to learn its role

🏷️ name

Function identifier

"get_weather"
📋 Rules:
Use lowercase with underscores
Be descriptive and specific
Avoid generic names like "function1"

📄 Complete Schema Example

{
  "name": "get_weather",
  "description": "Get current weather for a location",
  "parameters": {
    "type": "object",
    "properties": {
      "location": {
        "type": "string",
        "description": "City name or coordinates"
      },
      "unit": {
        "type": "string",
        "enum": ["celsius", "fahrenheit"],
        "description": "Temperature unit"
      }
    },
    "required": ["location"]
  }
}
Agent reads this to:
Understand what the tool does
Runtime validates:
Parameters match the schema

🔄 Platform Variations

OpenAI: Uses standard JSON Schema with "function" wrapper
Anthropic: Similar structure with "input_schema" property
LangChain: Wraps schemas in Tool classes with additional metadata