Tool Calling Framework
Extend AI capabilities beyond text generation with a powerful, extensible tool system that enables real-world interactions and complex task execution.
Extended Capabilities
Enable AI models to perform actions beyond text generation - file creation, code execution, web interactions, and more.
Secure Execution
All tools run in controlled environments with proper validation and security measures to ensure safe operation.
Fully Extensible
Build custom tools for your specific needs using our standardized framework and integration patterns.
How Tool Calling Works
Tool Request
AI model identifies need for external functionality
LLM analyzes the user request and determines which tool is needed
Parameter Extraction
Model specifies tool name and required parameters
AI formats the tool call with proper input parameters
Tool Execution
Fusion backend validates and executes the tool
System runs the tool with provided parameters in secure environment
Result Integration
Tool output is returned to the model for final response
AI incorporates tool results into comprehensive user response
Example Tool Call Flow
User: "Create a Python script that analyzes this CSV data"
AI: Identifies need for file creation and code generation
Tool Call: filecreatortool
with Python code content
Result: File created successfully with data analysis script
Response: "I've created a Python script for your CSV analysis..."
Built-in Tools Library
File Creator
filecreatortool
Generate and save files with AI-generated content
Capabilities
Example Use Case
Create a Python script for data analysis
Code Interpreter
e2bcodetool
Execute Python code in a secure sandboxed environment
Capabilities
Example Use Case
Execute data visualization scripts
Web Scraper
webscrapertool
Extract and clean content from web pages
Capabilities
Example Use Case
Scrape article content for analysis
Browser Tool
browsertool
Automate web browser interactions and navigation
Capabilities
Example Use Case
Automate web form submissions
Screenshot Tool
screenshottool
Capture screenshots for visual analysis
Capabilities
Example Use Case
Document UI for bug reports
DuckDuckGo Search
duckduckgotool
Search the web for current information
Capabilities
Example Use Case
Find latest news on specific topics
Package Manager
uvpackagemanager
Install and manage Python packages dynamically
Capabilities
Example Use Case
Install required libraries for analysis
Linting Tool
lintingtool
Check code quality and style compliance
Capabilities
Example Use Case
Validate Python code quality
Implementation Example
API Request with Tools
const response = await fetch('/api/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your-api-key'
},
body: JSON.stringify({
message: "Create a Python script to analyze sales data",
model: "claude",
enable_tools: true,
tools: [
"filecreatortool",
"e2bcodetool"
]
})
});
Tool Call Response
{
"response": "I'll create a Python script for sales analysis...",
"tool_calls": [
{
"tool_name": "filecreatortool",
"parameters": {
"filename": "sales_analysis.py",
"content": "import pandas as pd\n..."
},
"result": "File created successfully"
}
],
"model": "claude"
}
Building Custom Tools
Tool Structure
- Inherit from
BaseTool
class - Define tool name and description
- Specify input parameters schema
- Implement execution logic
- Handle errors and validation
- Return structured results
Best Practices
🔒 Security
Always validate inputs, use secure execution environments, and limit access to sensitive resources.
⚡ Performance
Keep tools lightweight, implement timeouts, and provide clear error messages for better UX.
📖 Documentation
Document parameters clearly, provide usage examples, and specify expected output formats.
Related Features
Start Using Tools Today
Enable powerful tool calling in your AI applications with just a single parameter. Extend capabilities beyond text generation.