Skip to main content

Call Tool

Enables Claude AI to use function calling capabilities, allowing Claude to request tool executions based on natural language prompts.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Connection Id - The Claude client session identifier from Connect node (optional if API Key is provided directly).
  • Prompt - Your question or request that may require tool usage. Claude will decide which tools to call based on this prompt.
  • Tools Definition - JSON definition of tools available for Claude to call. Defines tool names, descriptions, and input schemas.
  • Chat History - Previous conversation and tool call history. Maintains context across multiple tool calls.

Options

Authentication

  • API Key - Claude API key (optional if using Connection ID).
  • Use Robomotion AI Credits - Not supported for tool calling. This feature requires direct API mode with your own API key.

Model Selection

  • Model - Select which Claude model to use. Options include:
    • Claude Opus 4.5 - Best for complex tool orchestration
    • Claude Opus 4 - Highly capable for multi-step tool usage
    • Claude Sonnet 4.5 - Latest balanced model
    • Claude Sonnet 4 - Balanced performance and speed (default)
    • Claude 3.7 Sonnet - Latest 3.x generation Sonnet
    • Claude 3.5 Sonnet - Previous generation Sonnet
    • Claude 3.5 Haiku - Fastest model for simple tool calls
    • Custom Model - Specify your own model name
  • Custom Model - Enter custom model name when Custom Model is selected.

Generation Settings

  • Max Tokens - Maximum tokens for response (default: 4096).
  • Max Tool Rounds - Maximum number of tool call iterations (default: 5). Limits how many times Claude can call tools in a single request.

Advanced

  • Timeout (seconds) - Request timeout in seconds (default: 120).
  • Include Raw Response - Include full API response in output (default: false).

Outputs

  • Text - Claude's text response after tool calls.
  • Tool Calls - Array of tool calls made by Claude. Each tool call includes the tool name, input parameters, and a unique ID.
  • Chat History - Updated conversation history including tool calls and responses.
  • Needs Action - Boolean indicating whether tool calls require external execution (true if tools were called).
  • Raw Response - Complete API response object (when Include Raw Response is enabled).

How It Works

The Call Tool node enables Claude to use function calling. When executed, the node:

  1. Validates the connection (requires direct API mode, not Robomotion credits)
  2. Parses the tools definition JSON
  3. Converts tools to Anthropic API format
  4. Retrieves previous chat history if provided
  5. Adds the current user prompt to the conversation
  6. Sends the request to Claude with available tools
  7. Claude analyzes the prompt and decides which tools to call
  8. For each tool call Claude makes:
    • Extracts the tool name and input parameters
    • Adds the tool call to the results
    • Creates a placeholder tool result
  9. If Max Tool Rounds is not exceeded, can make additional tool calls
  10. Updates chat history with all messages and tool calls
  11. Returns tool calls for external execution

Requirements

  • Direct API mode - Robomotion AI Credits are not supported for tool calling
  • Valid Connection Id or direct API Key credentials
  • Non-empty Prompt
  • Valid Tools Definition JSON
  • Tools definition must follow the correct schema

Tools Definition Format

The Tools Definition input should be a JSON array of tool objects:

[
{
"name": "get_weather",
"description": "Get the current weather for a location",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name or coordinates"
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"],
"description": "Temperature unit"
}
},
"required": ["location"]
}
}
]

Each tool must have:

  • name - Unique identifier for the tool
  • description - Clear description of what the tool does (helps Claude decide when to use it)
  • input_schema - JSON Schema defining the tool's parameters

Error Handling

The node will return specific errors in the following cases:

  • Using Robomotion AI Credits mode - "Tool calling is not supported with Robomotion AI Credits"
  • Empty or missing Prompt
  • Empty or missing Tools Definition
  • Invalid Tools Definition JSON format
  • Invalid Connection Id
  • Empty Custom Model name when Custom Model is selected
  • API authentication errors (401)
  • API rate limit errors (429)
  • API service errors (500, 503)

Usage Notes

Tool Calling Flow

  • This node identifies which tools Claude wants to call
  • You must execute the actual tool functions yourself
  • After execution, you can send results back to Claude in subsequent calls
  • Use the Needs Action output to determine if tools need execution

Multi-Step Tool Usage

  • Claude can call multiple tools in sequence
  • Max Tool Rounds limits the number of iterations
  • Each round can involve multiple tool calls
  • The history maintains context across all rounds

Tool Design

  • Provide clear, descriptive tool names
  • Write detailed descriptions to help Claude understand when to use each tool
  • Use JSON Schema to strictly define input parameters
  • Mark required parameters in the schema

Execution Pattern

  • This node returns tool calls but doesn't execute them
  • You must implement the actual tool execution logic
  • After executing tools, you can continue the conversation with results

Examples

Example 1: Weather Query with Single Tool

Tools Definition:

[
{
"name": "get_weather",
"description": "Get current weather for a specified location",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name (e.g., 'San Francisco, CA')"
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"],
"description": "Temperature unit"
}
},
"required": ["location"]
}
}
]

Prompt: "What's the weather like in Paris?"

Output - Tool Calls:

[
{
"id": "tool_abc123",
"name": "get_weather",
"input": {
"location": "Paris, France",
"unit": "celsius"
}
}
]

Needs Action: true


Example 2: Multi-Tool Calculator

Tools Definition:

[
{
"name": "add",
"description": "Add two numbers",
"input_schema": {
"type": "object",
"properties": {
"a": {"type": "number"},
"b": {"type": "number"}
},
"required": ["a", "b"]
}
},
{
"name": "multiply",
"description": "Multiply two numbers",
"input_schema": {
"type": "object",
"properties": {
"a": {"type": "number"},
"b": {"type": "number"}
},
"required": ["a", "b"]
}
}
]

Prompt: "Calculate (15 + 27) × 3"

Output - Tool Calls:

[
{
"id": "tool_1",
"name": "add",
"input": {"a": 15, "b": 27}
},
{
"id": "tool_2",
"name": "multiply",
"input": {"a": 42, "b": 3}
}
]

Claude breaks down the problem into steps and calls tools accordingly.


Example 3: Database Operations

Tools Definition:

[
{
"name": "search_customers",
"description": "Search for customers by name or email",
"input_schema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Search query"
},
"limit": {
"type": "number",
"description": "Maximum number of results"
}
},
"required": ["query"]
}
},
{
"name": "get_customer_orders",
"description": "Get all orders for a specific customer",
"input_schema": {
"type": "object",
"properties": {
"customer_id": {
"type": "string",
"description": "Customer ID"
}
},
"required": ["customer_id"]
}
}
]

Prompt: "Find John Smith's recent orders"

Output - Tool Calls:

[
{
"id": "tool_search",
"name": "search_customers",
"input": {
"query": "John Smith",
"limit": 5
}
}
]

After executing the search and getting customer_id, you would make another call with the result to get orders.


Example 4: Complex Workflow

Tools Definition:

[
{
"name": "read_file",
"description": "Read contents of a file",
"input_schema": {
"type": "object",
"properties": {
"path": {"type": "string"}
},
"required": ["path"]
}
},
{
"name": "analyze_data",
"description": "Analyze data and generate insights",
"input_schema": {
"type": "object",
"properties": {
"data": {"type": "string"},
"analysis_type": {
"type": "string",
"enum": ["statistical", "trend", "summary"]
}
},
"required": ["data", "analysis_type"]
}
},
{
"name": "create_report",
"description": "Create a formatted report",
"input_schema": {
"type": "object",
"properties": {
"title": {"type": "string"},
"content": {"type": "string"},
"format": {
"type": "string",
"enum": ["pdf", "html", "markdown"]
}
},
"required": ["title", "content", "format"]
}
}
]

Prompt: "Read sales_data.csv, analyze it for trends, and create a PDF report"

Configuration:

  • Max Tool Rounds: 5

Claude will orchestrate multiple tool calls to complete the entire workflow.


Example 5: API Integration Tools

Tools Definition:

[
{
"name": "send_email",
"description": "Send an email via SMTP",
"input_schema": {
"type": "object",
"properties": {
"to": {"type": "string"},
"subject": {"type": "string"},
"body": {"type": "string"}
},
"required": ["to", "subject", "body"]
}
},
{
"name": "create_calendar_event",
"description": "Create a calendar event",
"input_schema": {
"type": "object",
"properties": {
"title": {"type": "string"},
"start_time": {"type": "string"},
"duration_minutes": {"type": "number"},
"attendees": {
"type": "array",
"items": {"type": "string"}
}
},
"required": ["title", "start_time"]
}
}
]

Prompt: "Schedule a meeting with john@example.com for tomorrow at 2 PM and send him an email about it"

Claude will call both tools with appropriate parameters.


Example 6: Continuing Conversation with Tool Results

First Call:

  • Prompt: "What's the weather in Tokyo?"
  • Tool Calls: [{ name: "get_weather", input: { location: "Tokyo" } }]

After executing the tool: You get: "Temperature: 22°C, Condition: Sunny"

Second Call (with history):

  • Prompt: "Should I bring an umbrella?"
  • Chat History: (includes previous conversation and tool results)
  • Claude Response: "No, you won't need an umbrella. The weather in Tokyo is sunny with..."

The history maintains context about the weather query.

Best Practices

  1. Tool Design:

    • Keep tool functions focused and single-purpose
    • Provide clear, detailed descriptions
    • Use descriptive parameter names
    • Validate input schemas thoroughly
  2. Schema Definition:

    • Use JSON Schema properly
    • Mark required parameters
    • Provide helpful descriptions for each parameter
    • Use enums for constrained values
  3. Tool Execution:

    • Implement actual tool execution logic separately
    • Validate tool inputs before execution
    • Handle execution errors gracefully
    • Return structured results to Claude
  4. Conversation Management:

    • Maintain chat history across tool calls
    • Include tool results when continuing conversations
    • Track tool call IDs for correlation
  5. Error Handling:

    • Validate Tools Definition JSON before use
    • Handle cases where Claude doesn't call any tools
    • Implement timeout and retry logic for tool execution
    • Provide meaningful error messages back to Claude
  6. Performance:

    • Set appropriate Max Tool Rounds
    • Monitor token usage with complex tool chains
    • Consider tool execution time in timeouts
  7. Security:

    • Validate tool inputs before execution
    • Implement authorization for sensitive tools
    • Don't expose dangerous operations without safeguards
    • Audit tool calls for security purposes
  8. Testing:

    • Test each tool individually
    • Test with various prompt phrasings
    • Verify Claude selects the right tools
    • Test edge cases and error scenarios
  9. Model Selection:

    • Use Opus for complex tool orchestration
    • Use Sonnet for general tool calling
    • Test tool calling accuracy with different models
  10. Documentation:

    • Document each tool's purpose clearly
    • Provide examples in tool descriptions
    • Keep tool schemas up to date
    • Document expected tool execution behavior

Implementation Pattern

A typical tool calling flow in Robomotion:

  1. Define Tools: Create tools definition JSON
  2. Call Tool Node: Send prompt with tools to Claude
  3. Check Needs Action: If true, tools need execution
  4. Parse Tool Calls: Extract tool names and parameters
  5. Execute Tools: Run actual tool logic (HTTP calls, database queries, etc.)
  6. Collect Results: Gather tool execution results
  7. Continue Conversation: Send results back to Claude with updated history
  8. Repeat: If more tool calls needed, continue the loop

This pattern enables Claude to orchestrate complex workflows by deciding which tools to use and when.