### Example MCP Server Output Source: https://docs.arcade.dev/en/get-started/quickstarts/mcp-server-quickstart This is an example of the expected output in your terminal when your MCP server is running successfully. It shows the tools being added and the server starting up with the tool count. ```bash 2025-11-03 13:46:11.041 | DEBUG | arcade_mcp_server.mcp_app:add_tool:242 - Added tool: greet 2025-11-03 13:46:11.042 | DEBUG | arcade_mcp_server.mcp_app:add_tool:242 - Added tool: whisper_secret 2025-11-03 13:46:11.043 | DEBUG | arcade_mcp_server.mcp_app:add_tool:242 - Added tool: get_posts_in_subreddit INFO | 13:46:11 | arcade_mcp_server.mcp_app:299 | Starting my_server v1.0.0 with 3 tools ``` -------------------------------- ### Install arcade-mcp CLI using uv or pip Source: https://docs.arcade.dev/en/get-started/quickstarts/mcp-server-quickstart Installs the arcade-mcp package, which is Arcade's CLI, for building MCP servers. It can be installed system-wide using uv or pip. ```bash uv tool install arcade-mcp ``` ```bash pip install arcade-mcp ``` -------------------------------- ### Start ClickUp Timer - Python and JavaScript Examples Source: https://docs.arcade.dev/en/resources/integrations/productivity/clickup-api Demonstrates how to start a timer for the authenticated ClickUp user. This function requires specifying the operation mode and optionally provides workspace and task details for precise timer control. ```python from clickup_api import ClickUpApi # Example usage of ClickUpApi.StartTimerClickup # Replace with your actual token and parameters api = ClickUpApi("YOUR_API_TOKEN") # To get the schema for the request body: response_schema = api.start_timer_clickup(mode='get_request_schema') print(response_schema) # To execute the operation (example with minimal parameters): # You would typically construct a request_body JSON string based on the schema # For simplicity, this is a placeholder. Consult the schema for actual structure. response_execute = api.start_timer_clickup(mode='execute', request_body='{"task_id": "123abc"}') print(response_execute) ``` ```javascript import { ClickUpApi } from "@clickup/api"; // Example usage of ClickUpApi.StartTimerClickup // Replace with your actual token and parameters const api = new ClickUpApi("YOUR_API_TOKEN"); // To get the schema for the request body: api.startTimerClickup({ mode: "get_request_schema" }).then(response => { console.log(response); }).catch(error => { console.error(error); }); // To execute the operation (example with minimal parameters): // You would typically construct a request_body JSON string based on the schema // For simplicity, this is a placeholder. Consult the schema for actual structure. api.startTimerClickup({ mode: "execute", request_body: JSON.stringify({ task_id: "123abc" }) }).then(response => { console.log(response); }).catch(error => { console.error(error); }); ``` -------------------------------- ### Install Dependencies for LangChain and Arcade Source: https://docs.arcade.dev/en/guides/agent-frameworks/langchain/use-arcade-with-langchain Installs necessary packages for integrating Arcade tools with LangChain, including the Arcade.js SDK, LangChain core, and OpenAI integration. This command assumes you are using the bun package manager. ```bash mkdir langchain-arcade-example cd langchain-arcade-example bun install @arcadeai/arcadejs langchain @langchain/openai @langchain/core @langchain/langgraph ``` -------------------------------- ### Install Arcade CLI using uv Source: https://docs.arcade.dev/en/get-started/setup/api-keys Installs the Arcade CLI using the 'uv' package manager, making it available system-wide. This is a convenient method for managing development tools. ```bash uv tool install arcade-mcp ``` -------------------------------- ### Get Freshservice Software Installation List using Python and JavaScript Source: https://docs.arcade.dev/en/resources/integrations/customer-support/freshservice-api Retrieve a list of all devices where a specific software application is installed in Freshservice. This requires the software application ID as a mandatory integer parameter. Requires FRESHSERVICE_API_KEY and FRESHSERVICE_SUBDOMAIN secrets. ```Python from pydantic import BaseModel, Field class ToolParam(BaseModel): software_application_id: int = Field(description='The unique identifier of the software application to fetch the installation list.') ``` ```JavaScript interface ToolParam { software_application_id: number; // The unique identifier of the software application to fetch the installation list. } ``` -------------------------------- ### Python Example: Integrate ArcadePy and Google ADK Source: https://docs.arcade.dev/en/guides/agent-frameworks/google-adk/use-arcade-tools This Python code provides a complete example of integrating ArcadePy with Google ADK. It demonstrates asynchronous setup, tool retrieval and authorization (specifically for Gmail.ListEmails), agent creation, and running the agent to process user input for summarizing emails. Dependencies include arcadepy, google.adk, and google.genai. ```python import asyncio from arcadepy import AsyncArcade from google.adk import Agent, Runner from google.adk.artifacts import InMemoryArtifactService from google.adk.sessions import InMemorySessionService from google.genai import types from google_adk_arcade.tools import get_arcade_tools async def main(): app_name = 'my_app' user_id = 'mateo@arcade.dev' session_service = InMemorySessionService() artifact_service = InMemoryArtifactService() client = AsyncArcade() google_tools = await get_arcade_tools(client, tools=["Gmail.ListEmails"]) # authorize the tools for tool in google_tools: result = await client.tools.authorize( tool_name=tool.name, user_id=user_id ) if result.status != "completed": print(f"Click this link to authorize {tool.name}:\n{result.url}") await client.auth.wait_for_completion(result) google_agent = Agent( model="gemini-2.0-flash", name="google_tool_agent", instruction="I can use Gmail tools to manage an inbox!", description="An agent equipped with tools to read Gmail emails. " "Make sure to call gmail_listemails to read and summarize" " emails", tools=google_tools, ) session = await session_service.create_session( app_name=app_name, user_id=user_id, state={ "user_id": user_id, } ) runner = Runner( app_name=app_name, agent=google_agent, artifact_service=artifact_service, session_service=session_service, ) user_input = "summarize my latest 3 emails" content = types.Content( role='user', parts=[types.Part.from_text(text=user_input)] ) for event in runner.run( user_id=user_id, session_id=session.id, new_message=content, ): if event.content.parts and event.content.parts[0].text: print(f'** {event.author}: {event.content.parts[0].text}') if __name__ == '__main__': asyncio.run(main()) ``` -------------------------------- ### Create a new MCP Server project Source: https://docs.arcade.dev/en/get-started/quickstarts/mcp-server-quickstart Scaffolds a new MCP Server project named 'my_server' and navigates into its source directory. This command generates the basic file structure for an MCP server, including entrypoint, environment configuration, and project definition files. ```bash arcade new my_server cd my_server/src/my_server ``` -------------------------------- ### Locate engine.yaml via Manual Download Source: https://docs.arcade.dev/en/guides/deployment-hosting/configure-engine Indicates the default path for the engine.yaml configuration file when the Arcade Engine is installed manually. It also references a guide for downloading an example template. ```bash $HOME/.arcade/engine.yaml To manually download the engine.yaml, you can get an example from the [Configuration Templates](/guides/deployment-hosting/configure-engine#engineyaml) and add it to `$HOME/.arcade/engine.yaml`. ``` -------------------------------- ### Complete Example: Gmail Integration in JavaScript Source: https://docs.arcade.dev/en/guides/agent-frameworks/openai-agents/use-arcade-tools A JavaScript example demonstrating how to initialize the Arcade client, fetch Gmail tools, prepare them for OpenAI Agents using `toZod`, create an agent, and run a query for latest emails. ```javascript import Arcade from '@arcadeai/arcadejs'; import { executeOrAuthorizeZodTool, toZod } from "@arcadeai/arcadejs/lib"; import { Agent, run, tool } from '@openai/agents'; // 1) Initialize Arcade client const client = new Arcade(); // 2) Fetch Gmail MCP Server from Arcade and prepare tools for OpenAI Agents const googleToolkit = await client.tools.list({ toolkit: "gmail", limit: 30 }); const tools = toZod({ tools: googleToolkit.items, client, userId: "", // Replace this with your application's user ID (e.g. email address, UUID, etc.) executeFactory: executeOrAuthorizeZodTool, }).map(tool); // 3) Create a new agent with the Gmail MCP Server const googleAgent = new Agent({ name: "Gmail agent", instructions: "You are a helpful assistant that can assist with Google API calls.", model: "gpt-4o-mini", tools }); // 4) Run the agent const result = await run(googleAgent, "What are my latest emails?"); // 5) Print the result console.log(result.finalOutput); ``` -------------------------------- ### Airtable API: Get Change Events using Python and JavaScript Source: https://docs.arcade.dev/en/resources/integrations/productivity/airtable-api This snippet demonstrates how to retrieve change events for Airtable enterprise bases. It requires the enterprise account ID and can optionally filter by start time, end time, page size, and pagination offset. Examples are provided in Python and JavaScript. ```Python from airtable_api import AirtableApi api = AirtableApi() response = api.get_airtable_change_events( enterprise_account_id='your_enterprise_account_id', start_time='2023-10-05T12:00:00Z', end_time='2023-10-05T23:59:59Z', page_size_limit=100, pagination_offset='some_offset_string' ) print(response) ``` ```JavaScript const airtableApi = require("airtable_api"); const response = airtableApi.getAirtableChangeEvents({ enterprise_account_id: "your_enterprise_account_id", start_time: "2023-10-05T12:00:00Z", end_time: "2023-10-05T23:59:59Z", page_size_limit: 100, pagination_offset: "some_offset_string", }); console.log(response); ``` -------------------------------- ### Configure and Fetch Tools with Arcade AI and LangChain Source: https://docs.arcade.dev/en/guides/agent-frameworks/langchain/use-arcade-with-langchain This example shows how to initialize the Arcade AI client, define agent parameters like user ID, MCP servers, individual tools, tool limits, system prompts, and the agent model. It then fetches tools using the getTools function, converting them into a format compatible with LangChain. ```typescript "use strict"; import { Arcade } from "@arcadeai/arcadejs"; import { type ToolExecuteFunctionFactoryInput, executeZodTool, isAuthorizationRequiredError, toZod, } from "@arcadeai/arcadejs/lib"; import { type ToolExecuteFunction } from "@arcadeai/arcadejs/lib/zod/types"; import { createAgent, tool } from "langchain"; import { Command, interrupt, MemorySaver, type Interrupt, } from "@langchain/langgraph"; import chalk from "chalk"; import readline from "node:readline/promises"; // configure your own values to customize your agent // The Arcade User ID identifies who is authorizing each service. const arcadeUserID = "{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. const MCPServers = ["Slack"]; // This determines individual tools. Useful to pick specific tools when you don't need all of them. const individualTools = ["Gmail_ListEmails", "Gmail_SendEmail", "Gmail_WhoAmI"]; // This determines the maximum number of tool definitions Arcade will return const toolLimit = 30; // This prompt defines the behavior of the agent. const systemPrompt = "You are a helpful assistant that can use Gmail tools. Your main task is to help the user with anything they may need."; // This determines which LLM will be used inside the agent const agentModel = "gpt-4o-mini"; // This allows LangChain to retain the context of the session const threadID = "1"; function executeOrInterruptTool({ zodToolSchema, toolDefinition, client, userId, }: ToolExecuteFunctionFactoryInput): ToolExecuteFunction { const { name: toolName } = zodToolSchema; return async (input: unknown) => { try { // Try to execute the tool const result = await executeZodTool({ zodToolSchema, toolDefinition, client, userId, })(input); return result; } catch (error) { // If the tool requires authorization, we interrupt the flow and ask the user to authorize the tool if (error instanceof Error && isAuthorizationRequiredError(error)) { const response = await client.tools.authorize({ tool_name: toolName, user_id: userId, }); // We interrupt the flow here, and pass everything the handler needs to get the user's authorization const interrupt_response = interrupt({ authorization_required: true, authorization_response: response, tool_name: toolName, url: response.url ?? "", }); // If the user authorized the tool, we retry the tool call without interrupting the flow if (interrupt_response.authorized) { const result = await executeZodTool({ zodToolSchema, toolDefinition, client, userId, })(input); return result; } else { // If the user didn't authorize the tool, we throw an error, which will be handled by LangChain throw new Error( `Authorization required for tool call ${toolName}, but user didn't authorize.` ); } } throw error; } }; } // Initialize the Arcade client const arcade = new Arcade(); export type GetToolsProps = { arcade: Arcade; mcpServers?: string[]; individualTools?: string[]; userId: string; limit?: number; }; export async function getTools({ arcade, mcpServers = [], individualTools = [], userId, limit = 30, }: GetToolsProps) { if (mcpServers.length === 0 && individualTools.length === 0) { throw new Error("At least one tool or toolkit must be provided"); } const from_mcpServers = await Promise.all( mcpServers.map(async (mcpServerName) => { const definitions = await arcade.tools.list({ toolkit: mcpServerName, limit: limit, }); return definitions.items; }) ); const from_individualTools = await Promise.all( individualTools.map(async (toolName) => { return await arcade.tools.get(toolName); }) ); const all_tools = [...from_mcpServers.flat(), ...from_individualTools]; const unique_tools = Array.from( new Map(all_tools.map((tool) => [tool.qualified_name, tool])).values() ); const arcadeTools = toZod({ tools: unique_tools, client: arcade, executeFactory: executeOrInterruptTool, userId: userId, }); // Convert Arcade tools to LangGraph tools const langchainTools = arcadeTools.map( ({ name, description, execute, parameters }) => (tool as Function)(execute, { name, description, schema: parameters, }) ); return langchainTools; } const tools = await getTools({ arcade, mcpServers: MCPServers, individualTools: individualTools, userId: arcadeUserID, limit: toolLimit, }); async function handleAuthInterrupt( interrupt: Interrupt ``` -------------------------------- ### Install Arcade CLI using pip Source: https://docs.arcade.dev/en/get-started/setup/api-keys Installs the Arcade CLI using the 'pip' package manager. This is a standard method for installing Python packages and their associated command-line tools. ```bash pip install arcade-mcp ``` -------------------------------- ### Run MCP Server with Stdio Transport Source: https://docs.arcade.dev/en/get-started/quickstarts/mcp-server-quickstart This command runs the MCP server using the stdio transport. It's suitable for local development where the client launches the server as a subprocess. Be aware that this transport might not have access to local `.env` file secrets. ```bash uv run server.py stdio ``` -------------------------------- ### GET /connected_sites/script_installation/status Source: https://docs.arcade.dev/en/resources/integrations/productivity/mailchimp-marketing-api Verify if the Mailchimp connected site script is installed on a specific site. ```APIDOC ## GET /connected_sites/script_installation/status ### Description Verify if the Mailchimp connected site script is installed. ### Method GET ### Endpoint /connected_sites/script_installation/status ### Parameters #### Query Parameters - **site_unique_identifier** (string) - Required - The unique identifier for the Mailchimp connected site to verify script installation. ### Response #### Success Response (200) - **script_installed** (boolean) - Indicates whether the script is installed. #### Response Example ```json { "script_installed": true } ``` ``` -------------------------------- ### Basic Comparative Evaluation Setup (Python) Source: https://docs.arcade.dev/en/guides/create-tools/evaluate-tools/comparative-evaluations Initializes an evaluation suite and registers tools for two separate tracks, 'Weather v1' and 'Weather v2'. This is the first step in setting up a comparative evaluation to test different weather API versions. ```python from arcade_evals import EvalSuite, tool_eval, ExpectedMCPToolCall, BinaryCritic @tool_eval() async def weather_comparison(): suite = EvalSuite( name="Weather API Comparison", system_message="You are a weather assistant.", ) # Track A: Weather API v1 await suite.add_mcp_server( "http://weather-v1.example/mcp", track="Weather v1" ) # Track B: Weather API v2 await suite.add_mcp_server( "http://weather-v2.example/mcp", track="Weather v2" ) return suite ``` -------------------------------- ### Start Authentication with GHES Provider (Python) Source: https://docs.arcade.dev/en/references/auth-providers/github Initiates the authentication flow using a custom GHES provider ID in Python. This example demonstrates how to specify the provider when starting the authentication process with the Arcade client. ```python client = Arcade() auth_response = client.auth.start( user_id=user_id, provider="my-company-github-enterprise", # Your custom provider ID ) ``` -------------------------------- ### Basic Comparative Evaluation Setup Source: https://docs.arcade.dev/en/guides/create-tools/evaluate-tools/comparative-evaluations Demonstrates how to set up a comparative evaluation with multiple tracks, each containing a different version of a tool API, and add track-specific test cases. ```APIDOC ## POST /api/evaluations/comparative ### Description Sets up and runs a comparative evaluation to test tool selection across different tool registries (tracks). ### Method POST ### Endpoint /api/evaluations/comparative ### Parameters #### Request Body - **name** (string) - Required - The name of the evaluation suite. - **system_message** (string) - Optional - The system message for the model. - **tracks** (array) - Required - An array of track configurations. - **track_name** (string) - Required - The name of the track. - **tool_source** (object) - Required - Configuration for the tool source. - **type** (string) - Required - Type of tool source (e.g., 'mcp_server', 'mcp_stdio_server', 'arcade_gateway', 'manual_definitions'). - **url** (string) - Optional - URL for MCP server. - **headers** (object) - Optional - Headers for MCP server. - **command** (array) - Optional - Command for MCP stdio server. - **env** (object) - Optional - Environment variables for MCP stdio server. - **gateway_slug** (string) - Optional - Slug for Arcade Gateway. - **tools** (array) - Optional - Manual tool definitions. - **cases** (array) - Required - An array of comparative test case configurations. - **case_name** (string) - Required - The name of the test case. - **user_message** (string) - Required - The user's message for the test case. - **track_expectations** (array) - Required - Expectations specific to each track. - **track_name** (string) - Required - The name of the track this expectation applies to. - **expected_tool_calls** (array) - Optional - Expected tool calls for this track. - **tool_name** (string) - Required - The name of the tool to be called. - **parameters** (object) - Required - Parameters for the tool call. - **critics** (array) - Optional - Critics to evaluate the tool usage for this track. - **type** (string) - Required - Type of critic (e.g., 'BinaryCritic'). - **field** (string) - Required - The field to evaluate. - **weight** (number) - Optional - Weight of the critic. ### Request Example ```json { "name": "Weather API Comparison", "system_message": "You are a weather assistant.", "tracks": [ { "track_name": "Weather v1", "tool_source": { "type": "mcp_server", "url": "http://weather-v1.example/mcp" } }, { "track_name": "Weather v2", "tool_source": { "type": "mcp_server", "url": "http://weather-v2.example/mcp" } } ], "cases": [ { "case_name": "get_current_weather", "user_message": "What's the weather in Seattle?", "track_expectations": [ { "track_name": "Weather v1", "expected_tool_calls": [ { "tool_name": "GetWeather", "parameters": {"city": "Seattle", "type": "current"} } ], "critics": [ {"type": "BinaryCritic", "field": "city", "weight": 0.7}, {"type": "BinaryCritic", "field": "type", "weight": 0.3} ] }, { "track_name": "Weather v2", "expected_tool_calls": [ { "tool_name": "Weather_GetCurrent", "parameters": {"location": "Seattle"} } ], "critics": [ {"type": "BinaryCritic", "field": "location", "weight": 1.0} ] } ] } ] } ``` ### Response #### Success Response (200) - **evaluation_id** (string) - Unique identifier for the evaluation. - **results** (object) - Detailed results of the evaluation. - **[case_name]** (object) - Results for a specific test case. - **[track_name]** (object) - Results for a specific track within a case. - **score** (number) - The score achieved for this track. - **status** (string) - The status of the evaluation for this track (e.g., 'PASSED', 'FAILED'). - **details** (string) - Additional details about the evaluation outcome. #### Response Example ```json { "evaluation_id": "eval-12345", "results": { "get_current_weather": { "Weather v1": { "score": 1.00, "status": "PASSED", "details": "All expectations met." }, "Weather v2": { "score": 1.00, "status": "PASSED", "details": "All expectations met." } } } } ``` ``` -------------------------------- ### Complete example of an organized MCP server - Python Source: https://docs.arcade.dev/en/guides/create-tools/tool-basics/organize-mcp-tools A comprehensive example demonstrating the organization of an MCP server with tools defined in separate files and imported. It includes setting up the `MCPApp`, importing tools from local files and external packages, and explicitly adding them to the application instance. ```python #!/usr/bin/env python3 import sys from typing import Annotated from arcade_mcp_server import MCPApp # Import tools from our mock 'tools' directory # In a real project, these could come from actual separate files from tools.math_tools import add, multiply from tools.text_tools import capitalize_string, word_count # In a real project, you could import from Arcade PyPI packages - # e.g. `pip install arcade-gmail` # import arcade_gmail from arcade_gmail.tools import list_emails # Create the MCP application app = MCPApp( name="organized_server", version="1.0.0", instructions="Example server demonstrating modular tool organization", ) # Method 1: Add imported tools explicitly app.add_tool(add) app.add_tool(multiply) app.add_tool(capitalize_string) app.add_tool(word_count) app.add_tool(list_emails) # app.add_tools_from_module(arcade_gmail) # Example of adding a locally defined tool (if it were in this file) @app.tool def server_info() -> Annotated[dict, "Information about this server"]: """Return information about this MCP server.""" return { "name": "Organized Server", "version": "1.0.0", "description": "Demonstrates modular tool organization", "total_tools": 5, # 4 imported + 1 defined here } ``` -------------------------------- ### Get Mailchimp Unsubscribed Campaign Members (Python, JavaScript) Source: https://docs.arcade.dev/en/resources/integrations/productivity/mailchimp-marketing-api Get details of members who have unsubscribed from a specific campaign. This function supports pagination, limiting the number of returned records, and field selection. Examples are provided for Python and JavaScript. ```Python from mailchimp_marketing.api_client import ApiClientError api_client = ApiClient() api_client.set_config({ "api_key": "YOUR_API_KEY", "server": "YOUR_SERVER_PREFIX" }) try: response = api_client.lists.get_unsubscribed_campaign_members(campaign_unique_id='YOUR_CAMPAIGN_ID') print(response) except ApiClientError as error: print(error.text) ``` ```JavaScript const mailchimpMarketing = require('@mailchimp/mailchimp_marketing'); mailchimpMarketing.setConfig({ apiKey: "YOUR_API_KEY", server: "YOUR_SERVER_PREFIX" }); async () => { try { const response = await mailchimpMarketing.lists.getUnsubscribedCampaignMembers(YOUR_CAMPAIGN_ID); console.log(response); } catch (error) { console.error(error); } }; ``` -------------------------------- ### Get Box Manual Start Workflows (Python, JavaScript) Source: https://docs.arcade.dev/en/resources/integrations/productivity/box-api Retrieves workflows with manual start triggers for a specified folder. Allows filtering by trigger type and controlling the number of results per page. Requires a valid folder ID. ```Python from box_api import BoxApi box_api = BoxApi() def get_manual_start_workflows_example(): response = box_api.get_manual_start_workflows( folder_id='0', trigger_type_filter='WORKFLOW_MANUAL_START', max_items_per_page=5, pagination_marker='string_value' ) return response ``` ```JavaScript const boxApi = require('box_api'); async function getManualStartWorkflowsExample() { const response = await boxApi.getManualStartWorkflows({ folder_id: '0', trigger_type_filter: 'WORKFLOW_MANUAL_START', max_items_per_page: 5, pagination_marker: 'string_value' }); return response; } ``` -------------------------------- ### Basic Usage of Arcade Tools with OpenAI Agents Source: https://docs.arcade.dev/en/guides/agent-frameworks/openai-agents/overview Demonstrates how to initialize an Arcade client, fetch tools from an MCP Server (e.g., Gmail), create an OpenAI Agent with these tools, and run the agent. It includes examples for both Python and JavaScript, showcasing asynchronous operations and tool integration. ```python from agents import Agent, Runner from arcadepy import AsyncArcade from agents_arcade import get_arcade_tools from agents_arcade.errors import AuthorizationError async def main(): # Initialize the Arcade client client = AsyncArcade() # Get tools from the "gmail" MCP Server tools = await get_arcade_tools(client, toolkits=["gmail"]) # Create an agent with Gmail tools google_agent = Agent( name="Gmail agent", instructions="You are a helpful assistant that can assist with Gmail API calls.", model="gpt-4o-mini", tools=tools, ) try: # Run the agent with a unique user_id for authorization result = await Runner.run( starting_agent=google_agent, input="What are my latest emails?", context={"user_id": "{arcade_user_id}"}, ) print("Final output:\n\n", result.final_output) except AuthorizationError as e: print("Please Login to Google:", e) if __name__ == "__main__": import asyncio asyncio.run(main()) ``` ```javascript import Arcade from "@arcadeai/arcadejs"; import { executeOrAuthorizeZodTool, toZod } from "@arcadeai/arcadejs/lib"; import { Agent, run, tool } from "@openai/agents"; // 1) Initialize Arcade client const client = new Arcade(); // 2) Fetch Gmail MCP Server from Arcade and prepare tools for OpenAI Agents const googleToolkit = await client.tools.list({ toolkit: "gmail", limit: 30 }); const tools = toZod({ tools: googleToolkit.items, client, userId: "", // Replace this with your application's user ID (e.g. email address, UUID, etc.) executeFactory: executeOrAuthorizeZodTool, }).map(tool); // 3) Create a new agent with the Gmail MCP Server const googleAgent = new Agent({ name: "Gmail agent", instructions: "You are a helpful assistant that can assist with Google API calls.", model: "gpt-4o-mini", tools, }); // 4) Run the agent const result = await run(googleAgent, "What are my latest emails?"); // 5) Print the result console.log(result.finalOutput); ``` -------------------------------- ### Full Arcade.js Salesforce Integration Example (JavaScript) Source: https://docs.arcade.dev/en/references/auth-providers/salesforce A comprehensive example demonstrating the complete flow of authenticating with Salesforce using Arcade.js and then calling the parameterizedSearch API. It includes client initialization, setting up provider details, initiating and waiting for authorization, and finally performing the API call to fetch account data. ```javascript import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade((baseURL = "http://localhost:9099")); // Automatically finds the `ARCADE_API_KEY` env variable const salesforceProviderId = "salesforce"; const salesforceOrgSubdomain = "salesforce-org-subdomain"; const userId = "{arcade_user_id}"; const scopes = ["read_account"]; // Start the authorization process let authResponse = await client.auth.start(userId, { provider: salesforceProviderId, scopes: scopes, }); if (authResponse.status !== "completed") { console.log("Please complete the authorization challenge in your browser:"); console.log(authResponse.url); } // Wait for the authorization to complete authResponse = await client.auth.waitForCompletion(authResponse); if (!authResponse.context.token) { throw new Error("No token found in auth response"); } const token = authResponse.context.token; if (!token) { throw new Error("No token found in auth response"); } // Use the Salesforce API const response = await fetch( `https://${salesforceOrgSubdomain}.my.salesforce.com/services/data/v63.0/parameterizedSearch`, { headers: { Authorization: `Bearer ${token}`, }, method: "POST", body: JSON.stringify({ q: "acme", sobjects: [ { name: "Account", fields: ["Id", "Name", "Website", "Phone"] }, ], in: "ALL", overallLimit: 10, offset: 0, }), }, ); if (!response.ok) { throw new Error( `HTTP error! status: ${response.status} - ${await response.text()}`, ); } console.log(await response.json()); ``` -------------------------------- ### Baseline Comparison Setup (Python) Source: https://docs.arcade.dev/en/guides/create-tools/evaluate-tools/comparative-evaluations Sets up two MCP servers for comparison: one representing the production baseline and another for staging. This allows for observing deviations between new and existing implementations. ```python await suite.add_mcp_server( "http://production.example/mcp", track="Production (Baseline)" ) await suite.add_mcp_server( "http://staging.example/mcp", track="Staging (New)" ) ``` -------------------------------- ### AirtableApi.ManageAirtableBlockInstallation Source: https://docs.arcade.dev/en/resources/integrations/productivity/airtable-api Manages the installation state of an Airtable block. Supports getting the request schema or executing the operation. ```APIDOC ## POST /airtable/block_installation/manage ### Description Manages the installation state of an Airtable block. Can be used to get the request schema or perform the installation management. ### Method POST ### Endpoint /airtable/block_installation/manage ### Parameters #### Query Parameters - **mode** (Enum[ToolMode]) - Required - Operation mode: 'get_request_schema' returns the OpenAPI spec for the request body, 'execute' performs the actual operation. - **airtable_base_id** (string) - Optional - The unique identifier for the Airtable base where the block is installed. Required when mode is 'execute', ignored when mode is 'get_request_schema'. - **block_installation_id** (string) - Optional - The unique identifier for the block installation to be managed. Required when mode is 'execute', ignored when mode is 'get_request_schema'. #### Request Body - **request_body** (string) - Optional - Stringified JSON representing the request body. Required when mode is 'execute', ignored when mode is 'get_request_schema'. ### Request Example ```json { "request_body": "{\"some_field\": \"some_value\"}" } ``` ### Response #### Success Response (200) - **result** (string) - The result of the operation, which could be a schema or a confirmation message. #### Response Example ```json { "result": "{\"schema\": {\"type\": \"object\", \"properties\": {\"new_field\": {\"type\": \"string\"}}}}" } ``` ``` -------------------------------- ### Configure MCP Clients for Stdio Transport Source: https://docs.arcade.dev/en/get-started/quickstarts/mcp-server-quickstart These commands configure different MCP clients (Cursor IDE, VS Code, Claude Desktop) to connect to your MCP server using the default stdio transport. Ensure your `arcade` command is installed within your virtual environment. ```bash # Configure Cursor to use your MCP server with the default transport (stdio) arcade configure cursor ``` ```bash # Configure VS Code to use your MCP server with the default transport (stdio) arcade configure vscode ``` ```bash # Configure Claude Desktop to use your MCP server with the default transport (stdio) arcade configure claude ``` -------------------------------- ### Arcade Client Initialization and Tool Execution Source: https://docs.arcade.dev/en/references/auth-providers/asana This section details how to initialize the Arcade client, authorize a tool, wait for authorization completion, and then execute a tool with specific input. ```APIDOC ## POST /tools/execute ### Description Executes a specified tool with the given input for a particular user. This endpoint is typically used after a tool has been authorized. ### Method POST ### Endpoint /tools/execute ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **tool_name** (string) - Required - The name of the tool to execute. - **input** (object) - Required - The input parameters for the tool. The structure of this object depends on the specific tool being called. - **user_id** (string) - Required - The unique identifier for the user. ### Request Example ```json { "tool_name": "Asana.DeleteTask", "input": { "task_id": "1234567890" }, "user_id": "{arcade_user_id}" } ``` ### Response #### Success Response (200) - **output** (object) - The output returned by the executed tool. The structure of this object depends on the specific tool. #### Response Example ```json { "output": { "value": "Task deleted successfully." } } ``` ## POST /tools/authorize ### Description Initiates the authorization process for a specific tool for a given user. This will return a URL if the user needs to grant permissions manually. ### Method POST ### Endpoint /tools/authorize ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **tool_name** (string) - Required - The name of the tool to authorize. - **user_id** (string) - Required - The unique identifier for the user. ### Request Example ```json { "tool_name": "Asana.DeleteTask", "user_id": "{arcade_user_id}" } ``` ### Response #### Success Response (200) - **status** (string) - The current status of the authorization ('pending', 'completed'). - **url** (string) - The URL the user needs to visit to complete the authorization, if status is 'pending'. #### Response Example ```json { "status": "pending", "url": "https://auth.arcade.dev/authorize?code=..." } ``` ## POST /auth/wait_for_completion ### Description Waits for the authorization process initiated by `/tools/authorize` to complete. This is a blocking call that will resolve once the authorization status changes to 'completed'. ### Method POST ### Endpoint /auth/wait_for_completion ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **auth_response** (object) - Required - The response object received from the `/tools/authorize` endpoint. ### Request Example ```json { "auth_response": { "status": "pending", "url": "https://auth.arcade.dev/authorize?code=..." } } ``` ### Response #### Success Response (200) Indicates that the authorization process has been completed. #### Response Example ```json { "status": "completed" } ``` ``` -------------------------------- ### Get Vercel Integration Resources (Python & JavaScript) Source: https://docs.arcade.dev/en/resources/integrations/development/vercel-api Retrieves all resources for a given Vercel installation ID. Requires an installation_id and the VERCEL_ACCESS_TOKEN secret. ```Python from .vercel_api import VercelApi vercel_api = VercelApi() result = vercel_api.get_integration_resources( installation_id='YOUR_INSTALLATION_ID' ) print(result) ``` ```JavaScript const vercelApi = require('/vercel_api'); vercelApi.get_integration_resources({ installation_id: 'YOUR_INSTALLATION_ID' }).then(result => { console.log(result); }); ``` -------------------------------- ### ExaApi.CreateMonitorForWebsets - Python and JavaScript Example Source: https://docs.arcade.dev/en/resources/integrations/search/exa-api Sets up a scheduled monitor to refresh websets with new data. This function requires the EXA_API_KEY secret and accepts a monitor_configuration object in JSON format. ```python from exa_api import Exa exa = Exa("YOUR_EXA_API_KEY") # Example of calling the tool directly response = exa.create_monitor_for_websets(monitor_configuration={'schedule': 'daily', 'search': {'query': 'tech trends'}}) print(response) ``` ```javascript import Exa from "@exاية/exاية-api"; const exa = new Exa("YOUR_EXA_API_KEY"); // Example of calling the tool directly async function main() { const response = await exa.createMonitorForWebsets({ monitorConfiguration: { schedule: "daily", search: { query: "tech trends", }, }, }); console.log(response); } main(); ``` -------------------------------- ### Run MCP Server with HTTP Transport Source: https://docs.arcade.dev/en/get-started/quickstarts/mcp-server-quickstart This command runs the MCP server using the http transport. It exposes the server via HTTP, typically at http://127.0.0.1:8000. Note that local HTTP servers currently do not support tool-level authorization and secrets for security reasons. ```bash uv run server.py http ``` -------------------------------- ### Get ClickUp Workspace User Info - Python and JavaScript Examples Source: https://docs.arcade.dev/en/resources/integrations/productivity/clickup-api Examples for retrieving information about a specific user within a ClickUp workspace. Requires the user ID and workspace ID. Optionally, you can include shared items by setting `show_shared_items` to true. ```python from clickup_api import ClickUpApi # Example usage of ClickUpApi.GetWorkspaceUserInfo # Replace with your actual token and parameters api = ClickUpApi("YOUR_API_TOKEN") # Get user info without shared items response_basic = api.get_workspace_user_info(user_id=1, workspace_id=12345) print(response_basic) # Get user info including shared items response_shared = api.get_workspace_user_info(user_id=1, workspace_id=12345, show_shared_items=True) print(response_shared) ``` ```javascript import { ClickUpApi } from "@clickup/api"; // Example usage of ClickUpApi.GetWorkspaceUserInfo // Replace with your actual token and parameters const api = new ClickUpApi("YOUR_API_TOKEN"); // Get user info without shared items api.getWorkspaceUserInfo({ user_id: 1, workspace_id: 12345 }).then(response => { console.log(response); }).catch(error => { console.error(error); }); // Get user info including shared items api.getWorkspaceUserInfo({ user_id: 1, workspace_id: 12345, show_shared_items: true }).then(response => { console.log(response); }).catch(error => { console.error(error); }); ``` -------------------------------- ### Full Salesforce API Call Example with Arcade in Python Source: https://docs.arcade.dev/en/references/auth-providers/salesforce This Python example shows a complete workflow for calling the Salesforce API using the Arcade client. It covers initializing the Arcade client, initiating and waiting for Salesforce authorization, retrieving an access token, and finally making the parameterizedSearch API call. It prints the JSON response or raises an error if the call fails. ```python import requests from arcadepy import Arcade client = Arcade(base_url="http://localhost:9099") # Automatically finds the `ARCADE_API_KEY` env variable salesforce_provider_id = "salesforce" salesforce_org_subdomain = "salesforce-org-subdomain" user_id = "{arcade_user_id}" scopes = ["read_account"] # Start the authorization process auth_response = client.auth.start( user_id=user_id, provider=salesforce_provider_id, scopes=scopes, ) if auth_response.status != "completed": print("Please complete the authorization challenge in your browser:") print(auth_response.url) # Wait for the authorization to complete auth_response = client.auth.wait_for_completion(auth_response) token = auth_response.context.token if not token: raise ValueError("No token found in auth response") # Use the Salesforce API response = requests.post( f"https://{salesforce_org_subdomain}.my.salesforce.com/services/data/v63.0/parameterizedSearch", headers={"Authorization": f"Bearer {token}"}, json={ "q": "acme", "sobjects": [ {"name": "Account", "fields": ["Id", "Name", "Website", "Phone"]}, ], "in": "ALL", "overallLimit": 10, "offset": 0, }, ) if not response.ok: raise ValueError( f"Failed to retrieve Salesforce data: {response.status_code} - {response.text}" ) print(response.json()) ``` -------------------------------- ### Get Service Orchestration (JavaScript) Source: https://docs.arcade.dev/en/resources/integrations/development/pagerduty-api Retrieves details of a service orchestration configuration. Requires 'service_identifier' and optionally 'include_models_in_response'. This example shows direct tool invocation. ```JavaScript import { PagerdutyApi } from "@langchain/community/hooks/pagerduty"; async function callToolDirectly() { const tool = new PagerdutyApi(); const args = { service_identifier: "your_service_identifier", include_models_in_response: "migrated_metadata", }; const result = await tool.get_service_orchestration(args); console.log(result); } callToolDirectly(); ``` -------------------------------- ### Configure MCP Clients for HTTP Transport Source: https://docs.arcade.dev/en/get-started/quickstarts/mcp-server-quickstart These commands configure different MCP clients (Cursor IDE, VS Code, Claude Desktop) to connect to your MCP server using the http transport. Use the `--transport http` flag for this configuration. This is useful for clients that communicate over HTTP. ```bash # Configure Cursor to use your MCP server with the http transport arcade configure cursor --transport http ``` ```bash # Configure VS Code to use your MCP server with the http transport arcade configure vscode --transport http ``` ```bash # Configure Claude Desktop to use your MCP server with the http transport arcade configure claude --transport http ``` -------------------------------- ### Get Service Orchestration (Python) Source: https://docs.arcade.dev/en/resources/integrations/development/pagerduty-api Retrieves details of a service orchestration configuration. Requires 'service_identifier' and optionally 'include_models_in_response'. This example shows direct tool invocation. ```Python from langchain_community.tools.pagerduty.utils import PagerdutyApi from dotenv import load_dotenv load_dotenv() def call_tool_directly(): tool = PagerdutyApi() args = { "service_identifier": "your_service_identifier", "include_models_in_response": "migrated_metadata", } result = tool.get_service_orchestration(**args) print(result) if __name__ == "__main__": call_tool_directly() ``` -------------------------------- ### Complete Example: Gmail Integration in Python Source: https://docs.arcade.dev/en/guides/agent-frameworks/openai-agents/use-arcade-tools Provides a full Python script to initialize an Arcade client, fetch Gmail tools, create a Google agent, and run a query to retrieve latest emails. It includes error handling for `AuthorizationError`. ```python from agents import Agent, Runner from arcadepy import AsyncArcade from agents_arcade import get_arcade_tools from agents_arcade.errors import AuthorizationError async def main(): client = AsyncArcade() tools = await get_arcade_tools(client, toolkits=["gmail"]) google_agent = Agent( name="Google agent", instructions="You are a helpful assistant that can assist with Google API calls.", model="gpt-4o-mini", tools=tools, ) try: result = await Runner.run( starting_agent=google_agent, input="What are my latest emails?", context={"user_id": "{arcade_user_id}"}, ) print("Final output:\n\n", result.final_output) except AuthorizationError as e: print("Please Login to Google:", e) if __name__ == "__main__": import asyncio asyncio.run(main()) ``` -------------------------------- ### Get PagerDuty Template Fields (Python, JavaScript) Source: https://docs.arcade.dev/en/resources/integrations/development/pagerduty-api Retrieves fields for account templates within PagerDuty. This tool does not require any parameters. Examples are provided for both Python and JavaScript. ```Python from PagerdutyApi import PagerdutyApi api = PagerdutyApi() api.get_template_fields() ``` ```JavaScript const pagerduty = require("pagerduty_api"); const api = new pagerduty.PagerdutyApi(); api.get_template_fields(); ```