The 4-Step Tool Creation Flow

1. Basics

Name the tool (e.g., get_weather) and write a detailed Description for the AI's understanding.

2. Request

Define the Endpoint URL (e.g., https://api.../weather) and the HTTP Method (GET/POST).

3. Schema

Provide the JSON Schema to define the required Arguments (e.g., city or latitude/longitude).

4. Context

Add Guidance on when to use the tool and any constraints (optional but recommended).

Why Schema is Critical

The JSON Schema isn't for the API; it's the instruction manual for the LLM. The Agent reads the schema and uses its reasoning engine to determine the correct **arguments** (parameters) to pass in the API call based on the user's prompt.

Example: get_weather Schema

{
  "type": "object",
  "properties": {
    "city": { "type": "string", "description": "The city name, e.g., 'London'" },
    "unit": { "type": "string", "enum": ["celsius", "fahrenheit"], "description": "The temperature unit required" }
  },
  "required": ["city"]
}

Agent in Action

User

What's the temperature in Paris, France in Celsius?

Agent (Tool Call)
Tool: get_weather
Arguments: { "city": "Paris", "unit": "celsius" }
API Response

{"temperature": 12, "conditions": "cloudy"}