> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upsonic.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools

> Extend your AI agents with powerful tools

## Overview

Tools enable agents to perform actions beyond text generation. They can execute code, search the web, access APIs, and integrate with external systems to accomplish complex tasks.

## Key Features

* **Multiple Tool Types**: Custom, MCP, Model Provider, and Ready-to-Use tools
* **Flexible Configuration**: Control execution behavior, caching, and retries
* **Type Safety**: Automatic schema generation from Python type hints
* **Parallel Execution**: Run multiple tools simultaneously for better performance

## Supported Tool Types

The tools list accepts any combination of:

| Type             | Example                    | Registered As          |
| ---------------- | -------------------------- | ---------------------- |
| Function tool    | `@tool` decorated function | Function name          |
| ToolKit instance | `DataProcessor()`          | All `@tool` methods    |
| Class instance   | `Calculator()`             | All public methods     |
| Agent instance   | `analyzer_agent`           | `ask_{agent_name}`     |
| MCP Handler      | `MCPHandler(...)`          | All MCP-provided tools |
| KnowledgeBase    | `KnowledgeBase(...)`       | `search_{kb_name}`     |
| Builtin tools    | `WebSearchTool()`          | Provider-specific      |

## Example

Create your own tools using Python functions or classes. Perfect for business logic, API integrations, and domain-specific functionality.

```python theme={null}
from upsonic import Agent, Task
from upsonic.tools import tool

@tool
def calculate_discount(price: float, discount_percent: float) -> float:
    """Calculate the final price after applying a discount."""
    return price * (1 - discount_percent / 100)

# Create agent and task
agent = Agent("anthropic/claude-sonnet-4-5")
task = Task(
    description="Calculate 20% discount on $100",
    tools=[calculate_discount]
)

# Execute task
result = agent.print_do(task)
print("Result:", result)
```

## Ready-to-Use Tool Integrations

<CardGroup cols={2}>
  <Card title="Search Tools" icon="magnifying-glass" href="/integrations/overview#tools--search">
    DuckDuckGo, BochaSearch, Tavily, Exa — web search for your agents
  </Card>

  <Card title="Scraping Tools" icon="spider" href="/integrations/overview#tools--scraping">
    Apify, Firecrawl, Exa — web scraping and data extraction
  </Card>

  <Card title="Sandbox Tools" icon="terminal" href="/integrations/overview#tools--sandbox">
    E2B, Daytona — secure cloud sandboxes for code execution, shell commands, and git operations
  </Card>

  <Card title="Data Tools" icon="chart-line" href="/integrations/overview#tools--data">
    yFinance — financial and market data
  </Card>

  <Card title="Model Provider Tools" icon="wand-magic-sparkles" href="/integrations/overview#tools--model-provider">
    Web Search, File Search, Code Execution, Image Generation & more
  </Card>
</CardGroup>

## Navigation

* [Function & Class Tools](/concepts/tools/function-class-tools/overview) - Create your own tools using Python functions, classes, and toolkits
* [MCP Tools](/concepts/tools/mcp-tools/mcp-handler) - Integrate external tools using Model Context Protocol
* [KnowledgeBase as Tool](/concepts/knowledgebase/using-as-tool) - Use KnowledgeBase for RAG-based tool calls
