Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { Steps, Callout } from "nextra/components";

# Use Arcade tools with CrewAI

[CrewAI](https://www.crewai.com/) is an agentic framework optimized for building task-oriented multi-agent systems. This guide explains how to integrate Arcade tools into your CrewAI applications.
This guide explains how to integrate Arcade tools into your CrewAI applications.

[CrewAI](https://www.crewai.com/) is an agentic framework optimized for building task-oriented multi-agent systems. You'll learn how to retrieve Arcade tools and convert them to CrewAI format, build a CrewAI agent with Arcade tools, and implement "just in time" (JIT) tool authorization using Arcade's client. This integration allows you to leverage Arcade's extensive tool ecosystem within CrewAI's multi-agent framework.

<GuideOverview>
<GuideOverview.Outcomes>
Expand Down Expand Up @@ -104,7 +106,7 @@ This includes many imports, here's a breakdown:

### Configure the agent

The rest of the code uses these variables to customize the agent and manage the tools. Feel free to configure them to your liking. Here, the `EventListener` class is used to suppress CrewAI's rich panel output, which is useful for debugging but verbose for an interactive session like the one you're building.
The rest of the code configures these variables to customize the agent and manage the tools. Feel free to configure them to your liking. Here, the `EventListener` class suppresses CrewAI's rich panel output, which is useful for debugging but verbose for an interactive session like the one you're building.

```python filename="main.py"
# Load environment variables from the .env file
Expand Down Expand Up @@ -170,7 +172,7 @@ def _build_args_model(tool_def: ToolDefinition) -> type[BaseModel]:

### Write a custom class that extends the CrewAI BaseTool class

Here, you define the `ArcadeTool` class that extends the CrewAI `BaseTool` class to add the following capability:
Here, you define the `ArcadeTool` class that extends the CrewAI `BaseTool` class to add the following feature:

- Authorize the tool with the Arcade client with the `_auth_tool` helper function
- Execute the tool with the Arcade client with the `_run` method
Expand Down Expand Up @@ -336,7 +338,7 @@ You should see the agent responding to your prompts like any model, as well as h
## Tips for selecting tools

- **Relevance**: Pick only the tools you need. Avoid using all tools at once.
- **Avoid conflicts**: Be mindful of duplicate or overlapping functionality.
- **Avoid conflicts**: Be mindful of duplicate or overlapping capability.

## Next steps

Expand Down Expand Up @@ -533,4 +535,4 @@ if __name__ == "__main__":

```

</details>
</details>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { Steps, Callout } from "nextra/components";

# Setup Arcade with Google ADK (Python)

Learn how to integrate Arcade tools using Google ADK primitives to build an AI agent.

Google ADK is a modular framework for building and deploying AI agents. It optimizes for Gemini and the Google Ecosystem, but supports any model.

<GuideOverview>
Expand Down Expand Up @@ -138,13 +140,13 @@ load_dotenv()

# The Arcade User ID identifies who is authorizing each service.
ARCADE_USER_ID = os.getenv("ARCADE_USER_ID")
# This determines which MCP server is providing the tools, you can customize this to make a Notion agent. All tools from the MCP servers defined in the array will be used.
# This determines which MCP server is providing the tools, you can customize this to make a Notion agent. All tools from the MCP servers defined in the array will use them.
MCP_SERVERS = ["Slack"]
# This determines individual tools. Useful to pick specific tools when you don't need all of them.
TOOLS = ["Gmail_ListEmails", "Gmail_SendEmail", "Gmail_WhoAmI"]
# This prompt defines the behavior of the agent.
MODEL = "gemini-2.5-flash"
# This determines which LLM model will be used inside the agent
# This determines which LLM model will use inside the agent
SYSTEM_PROMPT = "You are a helpful assistant that can assist with Gmail and Slack."
# This determines the name of the agent.
AGENT_NAME = "AwesomeAgent"
Expand Down Expand Up @@ -453,7 +455,7 @@ You should see the agent responding to your prompts like any model, as well as h
## Tips for selecting tools

- **Relevance**: Pick only the tools you need. Avoid utilizing all tools at once.
- **User identification**: Always provide a unique and consistent `user_id` for each user. Apply your internal or database user ID, not something entered by the user.
- **User identification**: Always provide a unique and consistent `user_id` for each user. Use your internal or database user ID, not something entered by the user.

## Next steps

Expand Down Expand Up @@ -494,13 +496,13 @@ load_dotenv()

# The Arcade User ID identifies who is authorizing each service.
ARCADE_USER_ID = os.getenv("ARCADE_USER_ID")
# This determines which MCP server is providing the tools, you can customize this to make a Notion agent. All tools from the MCP servers defined in the array will be used.
# This determines which MCP server is providing the tools, you can customize this to make a Notion agent. All tools from the MCP servers defined in the array will use them.
MCP_SERVERS = ["Slack"]
# This determines individual tools. Useful to pick specific tools when you don't need all of them.
TOOLS = ["Gmail_ListEmails", "Gmail_SendEmail", "Gmail_WhoAmI"]
# This prompt defines the behavior of the agent.
MODEL = "gemini-2.5-flash"
# This determines which LLM model will be used inside the agent
# This determines which LLM model will use inside the agent
SYSTEM_PROMPT = "You are a helpful assistant that can assist with Gmail and Slack."
# This determines the name of the agent.
AGENT_NAME = "AwesomeAgent"
Expand Down Expand Up @@ -743,4 +745,4 @@ if __name__ == '__main__':
asyncio.run(main())
```

</details>
</details>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The [OpenAI Agents SDK](https://openai.github.io/openai-agents-python/) is a pop
<GuideOverview>
<GuideOverview.Outcomes>

You will implement a CLI agent that can use Arcade tools to help the user with their requests. The harness handles tools that require authorization automatically, so users don't need to worry about it.
You will implement a CLI agent that can use Arcade tools to help the user with their requests. The harness handles tools that require user authorization automatically, so users don't need to worry about it.

</GuideOverview.Outcomes>

Expand Down Expand Up @@ -167,7 +167,7 @@ def convert_output_to_json(output: Any) -> str:

### Write a helper function to authorize Arcade tools

This helper function implements "just in time" (JIT) tool authorization using Arcade's client. When the agent tries to execute a tool that requires authorization, the `result` object's `status` will be `"pending"`, and you can use the `authorize` method to get an authorization URL. You then wait for the user to complete the authorization and retry the tool call. If the user has already authorized the tool, the `status` will be `"completed"`, and the OAuth dance skips silently, which improves the user experience.
This helper function implements "just in time" (JIT) tool authorization using Arcade's client. When the agent tries to execute a tool that requires user authorization, the `result` object's `status` will be `"pending"`, and you can use the `authorize` method to get an authorization URL. You then wait for the user to complete the authorization and retry the tool call. If the user has already authorized the tool, the `status` will be `"completed"`, and the OAuth dance skips silently, which improves the user experience.

<Callout type="info">
This function captures the authorization flow outside of the agent's context,
Expand Down Expand Up @@ -369,11 +369,11 @@ You should see the agent responding to your prompts like any model, as well as h
## Next steps

1. Try adding additional tools to the agent or modifying the tools in the catalog for a different use case by modifying the `MCP_SERVERS` and `TOOLS` variables.
2. Try implementing a fully deterministic flow before the agentic loop, you can use this deterministic phase to prepare the context for the agent, adding things like the current date, time, or any other information that is relevant to the task at hand.
2. Try implementing a fully deterministic flow before the agentic loop, you can implement this deterministic phase to prepare the context for the agent, adding things like the current date, time, or any other information that is relevant to the task at hand.

## Example code

The team provides example code for you to reference:
The team includes example code for you to reference:

```python filename="main.py"
from agents import Agent, Runner, TResponseInputItem
Expand Down Expand Up @@ -561,4 +561,4 @@ async def main():

# Run the main function as the entry point of the script
if __name__ == "__main__":
asyncio.run(main())
asyncio.run(main())