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

1

Tool Request

AI model identifies need for external functionality

LLM analyzes the user request and determines which tool is needed

2

Parameter Extraction

Model specifies tool name and required parameters

AI formats the tool call with proper input parameters

3

Tool Execution

Fusion backend validates and executes the tool

System runs the tool with provided parameters in secure environment

4

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
Available

Generate and save files with AI-generated content

Capabilities

Create text files
Generate code files
Save content to disk

Example Use Case

Create a Python script for data analysis

Code Interpreter

e2bcodetool
Available

Execute Python code in a secure sandboxed environment

Capabilities

Run Python code
Install packages
Generate plots
Data analysis

Example Use Case

Execute data visualization scripts

Web Scraper

webscrapertool
Available

Extract and clean content from web pages

Capabilities

Extract text content
Parse HTML
Clean formatting

Example Use Case

Scrape article content for analysis

Browser Tool

browsertool
Available

Automate web browser interactions and navigation

Capabilities

Navigate websites
Fill forms
Click elements

Example Use Case

Automate web form submissions

Screenshot Tool

screenshottool
Available

Capture screenshots for visual analysis

Capabilities

Capture screen
Save images
Visual documentation

Example Use Case

Document UI for bug reports

DuckDuckGo Search

duckduckgotool
Available

Search the web for current information

Capabilities

Web search
Current information
Real-time data

Example Use Case

Find latest news on specific topics

Package Manager

uvpackagemanager
Available

Install and manage Python packages dynamically

Capabilities

Install packages
Manage dependencies
Environment setup

Example Use Case

Install required libraries for analysis

Linting Tool

lintingtool
Available

Check code quality and style compliance

Capabilities

Code analysis
Style checking
Error detection

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.