Agents and tools
Build agents that choose tools at run time, within explicit limits. Function calling, ReAct and plan-and-execute architectures, every built-in tool, Tool Router and Tool Chain.
An agent is a model in a loop: it reads the task, decides whether to call a tool, sees the result, and repeats until it can answer. In AgenticMind the Agent node runs that loop, and tool nodes wired into its tools input define exactly what it may do. The theory is in Agents; this page is the how-to.
Build an agent
Template Agent with tools:
- Manual Input
question→ Agenttask. - Tool nodes → Agent
tools(a multiple input): Knowledge Search Tool (connected to the same Embedding Model and Vector Store as indexing), Calculator Tool, Date & Time Tool. - Agent
answer→ Outputanswer. - Index a document (Run → Index report), then ask in Chat: How many leave days do 3 employees get in total?
- Expand Used N tool calls: the agent searched the handbook, found 25 days per employee, and called the calculator for 25 × 3.
Inputs: task (required), tools, context (extra background), history (earlier messages, e.g. from Conversation History). Outputs: answer, result ({answer, steps, report} for Chat and APIs) and transcript.
Limits and budgets
Agents are bounded. Every Agent has:
| Setting | Default | Meaning |
|---|---|---|
max_turns |
6 | Maximum model calls. |
max_tool_calls |
12 | Maximum tool executions in total. |
token_budget |
60,000 | Stop when input + output tokens exceed it. |
cost_budget_usd |
0.25 | Stop when reported cost exceeds it (0 = no limit; needs a provider that reports cost, such as OpenRouter). |
tool_timeout_seconds |
30 | Per tool call. |
on_limit |
fail |
fail (AGENT_LIMIT_REACHED) or return_partial (a wrap-up turn answers with what it has). |
The Agent node is never retried automatically, because tools may have side effects.
Architectures
Choose with architecture:
| Architecture | How it works | Use when |
|---|---|---|
function_calling (default) |
The model calls tools natively; several calls in one turn run in parallel (parallel_tool_calls), results return in call order. |
Almost always. Fastest and most reliable with modern models. |
react |
The model writes Thought: / Action: / Action Input: (JSON) or Final Answer:; the runtime runs the action and replies Observation: …. Tools are described in the prompt, so it works without native tool calling. Every thought is traced (agent_thought). A malformed reply gets one corrective observation. |
Models without tool calling, or when you want visible reasoning. |
plan_and_execute |
One call writes up to max_plan_steps steps; each step runs as a function-calling loop that sees earlier results and the remaining budget; a final call composes the answer. |
Multi-step tasks that benefit from an explicit plan. |
All three share the same tool checks, limits and on_limit. Chat shows ReAct thoughts and plan steps with nested tool calls.
Built-in tools
| Tool node | Gives the agent | Notes |
|---|---|---|
| Knowledge Search Tool | search_documents over your index |
Returns numbered passages with file, page and section. |
| Calculator Tool | calculator |
Safe AST evaluator: + - * / // % **, parentheses, sqrt, log, exp, trig, abs, round, min, max, pi, e. No code execution. |
| Date & Time Tool | current_datetime |
Optional IANA time zone. Stops agents guessing today’s date. |
| Web Fetch Tool | fetch_web_page |
Only allowed_domains (required; subdomains included). Blocks private and metadata addresses, re-checks every redirect, size and time limits. |
| Memory Tool | recall_memory or save_memory |
Save only with consent true. See Memory. |
| Code Interpreter Tool | run_code |
Python/JavaScript in the sandbox. See Code execution. |
| SQL Tool | query_database |
Read-only SQL with the schema in its description. See Databases. |
| Auto Ontology Tool | business_data |
search_terms / ask_question. |
| MCP Server | every tool of an MCP server | See MCP. |
| Subagent | a delegate agent | See Multi-agent. |
Every tool node lets you rename the tool (name) and rewrite its description. The description is what the model reads to decide when to use the tool, so make it specific.
How tool calls are checked
- The model asks for a tool by name with JSON arguments.
- Unknown tools, and arguments that violate the tool’s JSON Schema (Draft 2020-12), are returned to the model as errors so it can correct itself. They are not node failures.
- The tool’s required permissions must be a subset of the Agent’s.
- The tool runs with its own timeout. Errors (
ToolError) go back to the model. - A tool that fails permanently (for example a site refusing bots) is marked failed for the rest of the run: later calls, including from sub-agents, return the reason instantly instead of retrying.
- Every call is a
tool_calltrace event and a span in OpenTelemetry exports.
Tool Router and Tool Chain
Not every task needs a full agent loop.
- Tool Router: one request → the single best tool, chosen by
keywords(e.g.{"calculator": ["sum", "%"]}), by themodel, orhybrid(keywords first). The model then fills that tool’s arguments. Outputsresult,toolandtext. Falls back todefault_tool. - Tool Chain: a fixed sequence of tool calls, no model. Arguments are templates:
[
{"tool": "calculator", "arguments": {"expression": "{{input}}"}},
{"tool": "calculator", "arguments": {"expression": "{{previous}} * 2"}},
{"tool": "fetch_web_page", "arguments": {"url": "https://example.org/{{steps.0.result}}"}}
]A string that is exactly one template keeps the value’s type. The chain stops at the first failure unless stop_on_error is off.
Writing your own tool
A tool is a node that outputs a ToolHandle plus an implementation. See Node SDK: writing a tool.
Making agents faster
- Agent latency is dominated by model turns. Fewer, better-described tools mean fewer turns.
- Set
reasoning_effortper node:lowon simple workers, default or higher on planners. Low effort can skip tools and answer from stale knowledge. - Keep
parallel_tool_callson. - Use a Tool Router or Tool Chain when the path is predictable.
Versions
Agent 1.2.0 adds the subprocess permission needed for stdio MCP tools and the Code Interpreter. Projects saved with 1.0.0 or 1.1.0 keep their exact permissions and refuse those tools with TOOL_PERMISSION_DENIED (with a hint to upgrade).

