Skip to content
Open
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
4 changes: 2 additions & 2 deletions app/en/get-started/agent-frameworks/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { AgentFrameworkTabs } from "@/app/_components/agent-framework-tabs";

Arcade integrates with agent frameworks and MCP clients to add tool-calling capabilities to your AI applications.

These guides are for developers building AI applications who need to connect Arcade tools to their agent frameworks or MCP clients. You'll learn how to authenticate with Arcade, load tools, and execute them within your chosen framework. Each guide provides code examples and configuration steps to get you started quickly with the most popular frameworks and programming languages.
These guides are for developers building AI applications who need to connect Arcade tools to their agent frameworks or MCP clients. You'll learn how to authenticate with Arcade, load tools, and execute them within your chosen framework. Each guide provides code examples and configuration steps to get you started with the most popular frameworks and programming languages.

## Agent Frameworks

<AgentFrameworkTabs />
<AgentFrameworkTabs />
44 changes: 23 additions & 21 deletions app/en/get-started/quickstarts/call-tool-agent/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { AgentFrameworkTabs } from "@/app/_components/agent-framework-tabs";

# Calling tools in your agent with Arcade

Learn how to install and use the Arcade client to call tools in your AI agent.

Arcade gives your AI agents the power to act. With Arcade-hosted tools, your AI-powered apps can send Gmail, update Notion, message in Slack, and more.

<GuideOverview>
Expand Down Expand Up @@ -82,7 +84,7 @@ bun install @arcadeai/arcadejs

</Tabs>

### Setup the client
### Set up the client

<Tabs items={["Python", "TypeScript"]} storageKey="preferredLanguage">

Expand Down Expand Up @@ -196,7 +198,7 @@ async function authorize_and_run_tool({

### Implement the workflow

In this example workflow, we:
In this example workflow, the following actions are performed:

- Get the latest news about MCP URL mode elicitation
- Create a Google Doc with the news
Expand All @@ -208,7 +210,7 @@ In this example workflow, we:

```python filename="main.py"
# This tool does not require authorization, so it will return the results
# without prompting the user to authorize the tool call.
# without requiring the user to authorize the tool call.
response_search = authorize_and_run_tool(
tool_name="GoogleNews.SearchNewsStories",
input={
Expand All @@ -227,7 +229,7 @@ for search_result in news:
output += f"{search_result['link']}\n\n"

# Create a Google Doc with the news results
# If the user has not previously authorized the Google Docs tool, they will be prompted to authorize the tool call.
# If the user has not previously authorized the Google Docs tool, they will need to authorize the tool call.
response_create_doc = authorize_and_run_tool(
tool_name="GoogleDocs.CreateDocumentFromText",
input={
Expand All @@ -254,7 +256,7 @@ response_send_email = authorize_and_run_tool(
)

# Print the response from the tool call
print(f"Success! Check your email at {user_id}\n\nYou just chained 3 tools together:\n 1. Searched Google News for stories about MCP URL mode elicitation\n 2. Created a Google Doc with the results\n 3. Sent yourself an email with the document link\n\nEmail metadata:")
print(f"Success Check your email at {user_id}\n\nYou just chained 3 tools together:\n 1. Searched Google News for stories about MCP URL mode elicitation\n 2. Created a Google Doc with the results\n 3. Sent yourself an email with the document link\n\nEmail metadata:")
print(response_send_email.output.value)
```

Expand All @@ -264,7 +266,7 @@ print(response_send_email.output.value)

```typescript filename="example.ts"
// This tool does not require authorization, so it will return the results
// without prompting the user to authorize the app.
// without requiring the user to authorize the app.
const response_search = await authorize_and_run_tool({
tool_name: "GoogleNews.SearchNewsStories",
input: {
Expand All @@ -285,7 +287,7 @@ for (const search_result of news) {
}

// Create a Google Doc with the news results
// If the user has not previously authorized the Google Docs tool, they will be prompted to authorize the tool call.
// If the user has not previously authorized the Google Docs tool, they will need to authorize the tool call.
const respose_create_doc = await authorize_and_run_tool({
tool_name: "GoogleDocs.CreateDocumentFromText",
input: {
Expand All @@ -300,7 +302,7 @@ const google_doc = respose_create_doc.output?.value;
// Send an email with the link to the Google Doc
const email_body = `You can find the news about MCP URL mode elicitation in the following Google Doc: ${google_doc.documentUrl}`;

// Here again, if the user has not previously authorized the Gmail tool, they will be prompted to authorize the tool call.
// Here again, if the user has not previously authorized the Gmail tool, they will need to authorize the tool call.
const respose_send_email = await authorize_and_run_tool({
tool_name: "Gmail.SendEmail",
input: {
Expand All @@ -313,7 +315,7 @@ const respose_send_email = await authorize_and_run_tool({

// Print the response from the tool call
console.log(
`Success! Check your email at ${userId}\n\nYou just chained 3 tools together:\n 1. Searched Google News for stories about MCP URL mode elicitation\n 2. Created a Google Doc with the results\n 3. Sent yourself an email with the document link\n\nEmail metadata:`
`Success Check your email at ${userId}\n\nYou just chained 3 tools together:\n 1. Searched Google News for stories about MCP URL mode elicitation\n 2. Created a Google Doc with the results\n 3. Sent yourself an email with the document link\n\nEmail metadata:`
);
console.log(respose_send_email.output?.value);
```
Expand All @@ -333,7 +335,7 @@ console.log(respose_send_email.output?.value);
```

```text
Success! Check your email at {arcade_user_id}
Success Check your email at {arcade_user_id}

You just chained 3 tools together:
1. Searched Google News for stories about MCP URL mode elicitation
Expand All @@ -352,7 +354,7 @@ console.log(respose_send_email.output?.value);
```

```text
Success! Check your email at {arcade_user_id}
Success Check your email at {arcade_user_id}

You just chained 3 tools together:
1. Searched Google News for stories about MCP URL mode elicitation
Expand All @@ -373,13 +375,13 @@ console.log(respose_send_email.output?.value);

</Steps>

## Next Steps
## Next steps

In this example, we call the tool methods directly. In your real applications and agents, you'll likely be letting the LLM decide which tools to call. Learn more about using Arcade with Frameworks in the [Frameworks](/get-started/agent-frameworks) section, or [how to build your own tools](/guides/create-tools/tool-basics/build-mcp-server).

<AgentFrameworkTabs />

## Full Example Code
## Full example code

<Tabs items={["Python", "TypeScript"]} storageKey="preferredLanguage">

Expand Down Expand Up @@ -416,7 +418,7 @@ def authorize_and_run_tool(tool_name, input, user_id):
return client.tools.execute(tool_name=tool_name, input=input, user_id=user_id)

# This tool does not require authorization, so it will return the results
# without prompting the user to authorize the tool call.
# without requiring the user to authorize the tool call.
response_search = authorize_and_run_tool(
tool_name="GoogleNews.SearchNewsStories",
input={
Expand All @@ -436,7 +438,7 @@ for search_result in news:
output += f"{search_result['link']}\n"

# Create a Google Doc with the news results
# If the user has not previously authorized the Google Docs tool, they will be prompted to authorize the tool call.
# If the user has not previously authorized the Google Docs tool, they will need to authorize the tool call.
response_create_doc = authorize_and_run_tool(
tool_name="GoogleDocs.CreateDocumentFromText",
input={
Expand All @@ -463,7 +465,7 @@ response_send_email = authorize_and_run_tool(
)

# Print the response from the tool call
print(f"Success! Check your email at {user_id}\n\nYou just chained 3 tools together:\n 1. Searched Google News for stories about MCP URL mode elicitation\n 2. Created a Google Doc with the results\n 3. Sent yourself an email with the document link\n\nEmail metadata:")
print(f"Success Check your email at {user_id}\n\nYou just chained 3 tools together:\n 1. Searched Google News for stories about MCP URL mode elicitation\n 2. Created a Google Doc with the results\n 3. Sent yourself an email with the document link\n\nEmail metadata:")
print(response_send_email.output.value)
```
</details>
Expand Down Expand Up @@ -523,7 +525,7 @@ async function authorize_and_run_tool({
}

// This tool does not require authorization, so it will return the results
// without prompting the user to authorize the app.
// without requiring the user to authorize the app.
const response_search = await authorize_and_run_tool({
tool_name: "GoogleNews.SearchNewsStories",
input: {
Expand All @@ -544,7 +546,7 @@ for (const search_result of news) {
}

// Create a Google Doc with the news results
// If the user has not previously authorized the Google Docs tool, they will be prompted to authorize the tool call.
// If the user has not previously authorized the Google Docs tool, they will need to authorize the tool call.
const respose_create_doc = await authorize_and_run_tool({
tool_name: "GoogleDocs.CreateDocumentFromText",
input: {
Expand All @@ -559,7 +561,7 @@ const google_doc = respose_create_doc.output?.value;
// Send an email with the link to the Google Doc
const email_body = `You can find the news about MCP URL mode elicitation in the following Google Doc: ${google_doc.documentUrl}`;

// Here again, if the user has not previously authorized the Gmail tool, they will be prompted to authorize the tool call.
// Here again, if the user has not previously authorized the Gmail tool, they will need to authorize the tool call.
const respose_send_email = await authorize_and_run_tool({
tool_name: "Gmail.SendEmail",
input: {
Expand All @@ -572,11 +574,11 @@ const respose_send_email = await authorize_and_run_tool({

// Print the response from the tool call
console.log(
`Success! Check your email at ${userId}\n\nYou just chained 3 tools together:\n 1. Searched Google News for stories about MCP URL mode elicitation\n 2. Created a Google Doc with the results\n 3. Sent yourself an email with the document link\n\nEmail metadata:`
`Success Check your email at ${userId}\n\nYou just chained 3 tools together:\n 1. Searched Google News for stories about MCP URL mode elicitation\n 2. Created a Google Doc with the results\n 3. Sent yourself an email with the document link\n\nEmail metadata:`
);
console.log(respose_send_email.output?.value);
```
</details>

</Tabs.Tab>
</Tabs>
</Tabs>