API Documentation
Complete reference guide for the IA Tools Universe API.
Introduction
The IA Tools Universe API provides access to custom tools that can be used in agent systems. This documentation covers everything you need to know to integrate tools from the IA Tools Universe into your applications.
All API endpoints are accessible via HTTPS at https://your-domain.com/api/v1/.
Responses are returned in JSON format.
Authentication
The API requires authentication using a Bearer token. You must include an Authorization header with your token in all API requests.
Request Header
Authorization: Bearer your_auth_token
You can obtain your authentication token when connecting to the Tools Universe from the Impact-agents Studio.
Tools API
List All Tools
Returns a list of all available tools in the system.
Response
[
{
"id": "TID123abc456def",
"name": "Weather Forecast",
"description": "Get weather forecasts for a location",
"category": "Weather",
"version": "1.0.0",
"author": "User",
"is_active": true,
"created_at": "2023-01-01T12:00:00Z",
"updated_at": "2023-01-02T15:30:00Z"
},
{
"id": "TID789ghi101jkl",
"name": "Text Translator",
"description": "Translate text between languages",
"category": "Language",
"is_active": true,
"created_at": "2023-01-03T09:15:00Z",
"updated_at": "2023-01-03T09:15:00Z"
}
]
Get a Specific Tool
Returns details about a specific tool.
Parameters
| Parameter | Type | Description |
|---|---|---|
| tool_id | string | The unique identifier of the tool |
Response
{
"id": "TID123abc456def",
"name": "Weather Forecast",
"description": "Get weather forecasts for a location",
"category": "Weather",
"version": "1.0.0",
"author": "User",
"is_active": true,
"created_at": "2023-01-01T12:00:00Z",
"updated_at": "2023-01-02T15:30:00Z",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name or coordinates"
},
"days": {
"type": "integer",
"description": "Number of days to forecast",
"default": 1
}
},
"required": ["location"]
},
"code": "# Python implementation code (truncated for brevity)",
"sample_input": {
"location": "New York",
"days": 3
}
}
Tool Execution
Execute a specific tool with the provided input data.
Parameters
| Parameter | Type | Description |
|---|---|---|
| tool_id | string | The unique identifier of the tool |
Request Body
{
"input_data": {
// Tool-specific input parameters
// These must conform to the tool's input schema
}
}
Response
{
"success": true,
"data": {
// Tool-specific output data
},
"message": "Operation completed successfully"
}
Input Schema
Each tool has a specific input schema that defines the parameters it accepts. You can retrieve a tool's input schema using the following endpoint:
Returns the input schema for a specific tool.
Parameters
| Parameter | Type | Description |
|---|---|---|
| tool_id | string | The unique identifier of the tool |
Response
{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The search query"
},
"limit": {
"type": "integer",
"description": "Maximum number of results",
"default": 10
}
},
"required": ["query"]
}
Error Handling
When an error occurs, the API responds with an appropriate HTTP status code and a JSON object containing error details.
{
"detail": "Descriptive error message"
}
Common Error Codes
| Status Code | Description |
|---|---|
| 400 Bad Request | Invalid input or parameters |
| 404 Not Found | Tool not found |
| 403 Forbidden | Tool is inactive or access denied |
| 422 Unprocessable Entity | Input validation error |
| 500 Internal Server Error | Server-side error during tool execution |
Rate Limits
Currently, there are no strict rate limits implemented. However, please be considerate with your API usage to ensure good performance for all users.
Code Examples
Python Example
import requests
import json
# Tool ID of the tool you want to execute
tool_id = "TID123abc456def"
# Prepare the input data
input_data = {
"location": "New York",
"days": 3
}
# Execute the tool
response = requests.post(
f"https://your-domain.com/api/v1/tools/{tool_id}/execute",
json={"input_data": input_data},
headers={"Authorization": f"Bearer {your_auth_token}"}
)
# Process the response
if response.status_code == 200:
result = response.json()
if result["success"]:
print("Tool execution succeeded!")
print(f"Message: {result['message']}")
print(f"Data: {json.dumps(result['data'], indent=2)}")
else:
print(f"Tool execution failed: {result['message']}")
else:
print(f"API call failed: {response.status_code}")
print(response.text)
JavaScript Example
// Tool ID of the tool you want to execute
const toolId = "TID123abc456def";
// Prepare the input data
const inputData = {
location: "New York",
days: 3
};
// Execute the tool
fetch(`https://your-domain.com/api/v1/tools/${toolId}/execute`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${localStorage.getItem('authToken') || ''}`
},
body: JSON.stringify({ input_data: inputData })
})
.then(response => {
if (!response.ok) {
throw new Error(`API call failed: ${response.status}`);
}
return response.json();
})
.then(result => {
if (result.success) {
console.log("Tool execution succeeded!");
console.log(`Message: ${result.message}`);
console.log("Data:", result.data);
} else {
console.error(`Tool execution failed: ${result.message}`);
}
})
.catch(error => {
console.error("Error:", error);
});
IA Tools Universe