The secret to autonomous agents: empowering them to connect to your world via custom API wrappers.
Name the tool (e.g., get_weather) and write a detailed Description for the AI's understanding.
Define the Endpoint URL (e.g., https://api.../weather) and the HTTP Method (GET/POST).
Provide the JSON Schema to define the required Arguments (e.g., city or latitude/longitude).
Add Guidance on when to use the tool and any constraints (optional but recommended).
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"]
}
What's the temperature in Paris, France in Celsius?
Tool: get_weather
Arguments: { "city": "Paris", "unit": "celsius" }
{"temperature": 12, "conditions": "cloudy"}