Skip to main content
For more detailed usage information, please refer to our cookbook: Tools Cookbook

What is a Tool?

A Tool in CAMEL is a callable function with a name, description, input parameters, and an output type. Tools act as the interface between agents and the outside world—think of them like OpenAI Functions you can easily convert, extend, or use directly.

What is a Toolkit?

A Toolkit is a curated collection of related tools designed to work together for a specific purpose. CAMEL provides a range of built-in toolkits—covering everything from web search and data extraction to code execution, GitHub integration, and much more.

Get Started

Install Toolkits

To unlock advanced capabilities for your agents, install CAMEL’s extra tools package:
A tool in CAMEL is just a FunctionTool—an interface any agent can call to run custom logic or access APIs.

Define a Custom Tool

You can easily create your own tools for any use case. Just write a Python function and wrap it using FunctionTool:
add_tool.py
Inspect your tool’s properties—such as its name, description, and OpenAI-compatible schema—using built-in methods:

Using Toolkits

Toolkits group related tools for specialized tasks—search, math, or automation. Use built‑in toolkits or build your own:
toolkit_usage.py
You can also wrap toolkit methods as individual FunctionTools:
custom_tools.py

Passing Tools to ChatAgent

You can enhance any ChatAgent with custom or toolkit-powered tools. Just pass the tools during initialization:
chatagent_tools.py

Built-in Toolkits

CAMEL provides a variety of built-in toolkits that you can use right away. Here’s a comprehensive list of available toolkits:

Using Toolkits as MCP Servers

MCP Servers in CAMEL

CAMEL supports the Model Context Protocol (MCP), letting you expose any toolkit as a standalone server. This enables distributed tool execution and seamless integration across multiple systems—clients can remotely discover and invoke tools via a consistent protocol.

What is MCP?

MCP (Model Context Protocol) is a unified protocol for connecting LLMs with external tools and services. In CAMEL, you can turn any toolkit into an MCP server, making its tools available for remote calls—ideal for building distributed, modular, and language-agnostic AI workflows.

Expose a Toolkit as an MCP Server

Any CAMEL toolkit can run as an MCP server. Example for ArxivToolkit:
arxiv_mcp_server.py

MCP Server Configuration

Define how to launch your MCP servers with a config file:

Connect to MCP Servers as a Client

From your client application, you can connect to MCP servers and use their tools remotely:

Benefits of MCP Servers

  • Distributed Execution: Run tools anywhere—across machines or containers.
  • Process Isolation: Each toolkit runs in its own process for reliability and security.
  • Resource Management: Allocate memory/CPU for heavy toolkits without impacting others.
  • Scalability: Scale specific toolkits up or down as your workload changes.
  • Language Interoperability: Implement MCP servers in any language that supports the protocol.

Best Practices for MCP Integration

  • Timeouts: Always set timeouts to prevent blocked operations.
  • Error Handling: Implement robust error and exception handling in both server and client code.
  • Resource Cleanup: Properly disconnect and free resources when finished.
  • Configuration: Use config files or environment variables for flexible deployment.
  • Monitoring: Add logging and health checks for production MCP deployments.

Conclusion

Tools—especially when deployed as MCP servers—are the bridge between CAMEL agents and the real world. With this architecture, you can empower agents to automate, fetch, compute, and integrate with almost any external system.