Purpose
The Tool node executes an MCP tool directly as a workflow step — without agent reasoning. Use Tool nodes when you know exactly which tool to call and with what parameters. No AI decision-making, just deterministic tool execution. Tool nodes provide predictable, repeatable actions: send this email, create this calendar event, query this database, call this API. They’re the programmatic actions within your AI workflows.When to use Tool node vs Agent node with tools
Understanding when to use each approach is critical for building effective workflows.Use Tool node when:
Deterministic actions
You know exactly which tool to call and with what parameters. No decision-making needed.Example: “Send an email to [email protected] with subject ‘Report Ready’”
Predictable operations
The action is the same every time, just with different data.Example: “Create a calendar event with these specific details”
No interpretation needed
The input data directly maps to tool parameters without reasoning.Example: “Execute SQL query with these parameters”
Performance-critical paths
You need the fastest possible execution without LLM overhead.Example: “Log this event to the monitoring system”
Use Agent node with tools when:
Decision-making required
The agent needs to decide which tool(s) to call based on reasoning.Example: “Research this topic and use the appropriate tools to find answers”
Dynamic tool selection
Multiple tools are available and the right one depends on context.Example: “Fix this issue using whatever tools are necessary”
Interpretation needed
The agent must interpret natural language intent into tool parameters.Example: “Schedule a meeting with the team next week”
Multi-step reasoning
The agent needs to call multiple tools in sequence based on previous results.Example: “Find this information, then format it and send it”
Configuration
Configure a Tool node to execute the right MCP tool with the right parameters.Select an MCP tool
Choose which tool to execute from your available MCP connections. MagOneAI supports any MCP-compliant tool:- Communication tools — Email, Slack, SMS, notifications
- Calendar tools — Google Calendar, Outlook, event scheduling
- Database tools — PostgreSQL, MongoDB, Redis queries
- API tools — REST API calls, webhooks, external services
- File tools — S3 uploads, file operations, document processing
- CRM tools — Salesforce, HubSpot, customer data
- Custom tools — Your own MCP server implementations
Input parameter mapping
Map data from the variable store to the tool’s input parameters. Each tool has a defined schema for its parameters. Example: Send email toolOutput mapping
Define how the tool’s response is stored in the variable store. Tool responses vary by tool type:- Email tools — Confirmation, message ID
- Calendar tools — Event ID, event URL
- Database tools — Query results, affected rows
- API tools — Response body, status code
Retry and timeout settings
Configure resilience for tool execution:- Retry count — Number of retry attempts on failure
- Retry backoff — Delay strategy between retries (fixed or exponential)
- Timeout — Maximum execution time before the tool call is cancelled
- Retry on errors — Which error types trigger retries (network errors, rate limits, timeouts)
- Email/notifications — Retry aggressively (3-5 retries with exponential backoff)
- Database writes — Retry cautiously to avoid duplicates
- External APIs — Respect rate limits, use exponential backoff
Examples
Let’s look at practical examples of Tool nodes in real workflows.Example 1: Send notification after workflow completion
Scenario: After a document processing workflow completes, send an email notification to the requester with the results. Tool node configuration:Example 2: Create calendar event with specific details
Scenario: After a compliance review identifies issues, automatically schedule a review meeting with the appropriate stakeholders. Tool node configuration:Example 3: Execute database query with known parameters
Scenario: After processing a customer application, update the database with the results. Tool node configuration:Example 4: Fetch data from external API
Scenario: Look up customer information from a CRM system before processing their request. Tool node configuration:Error handling
Tool executions can fail for many reasons: network issues, API rate limits, invalid parameters, authentication failures. Proper error handling ensures workflow resilience.Retry strategies
Configure retries based on the tool’s characteristics:- Idempotent tools
- Non-idempotent tools
- Rate-limited tools
Tools that can be safely retried without side effects.Examples: Database reads, API GET requests, file readsStrategy: Aggressive retries with exponential backoff
Fallback patterns
Use Condition nodes after Tool nodes to handle failures gracefully:- Tool execution — Attempt the primary action
- Condition check — Did the tool succeed?
- Success path — Continue the workflow
- Failure path — Execute fallback logic (alternative tool, human task, error notification)
Best practices
Use Tool nodes for known actions
Use Tool nodes for known actions
If you can hard-code the tool call parameters, use a Tool node. This avoids the overhead and unpredictability of agent reasoning.
Validate inputs before tool execution
Validate inputs before tool execution
Use Condition nodes to validate that required data exists and is in the correct format before calling tools. This prevents tool failures due to invalid inputs.
Handle errors explicitly
Handle errors explicitly
Don’t assume tools always succeed. Use Condition nodes to check tool outputs and route to error handling when needed.
Set realistic timeouts
Set realistic timeouts
Different tools have different performance characteristics. Database queries might complete in milliseconds, while external API calls might take seconds.
Log tool executions
Log tool executions
Store tool outputs in the variable store with descriptive names. This helps with debugging and provides audit trails.
Use idempotency keys
Use idempotency keys
When available, use idempotency keys for non-idempotent operations. This makes retries safe and prevents duplicate actions.