Skip to main content
This page was previously a duplicate of the Streaming Responses guide. It now documents the API’s tool mechanisms, which live under this “Tools” section of the docs.
The Swarms API gives an agent access to tools through three independent mechanisms. They can be combined on the same request. Custom function tools (tools_list_dictionary) and structured JSON output (llm_args.response_format) are documented in full, with worked examples and response parsing, on the Structured Outputs & Function Calling page. This page covers the other two mechanisms: built-in tools and the autonomous looper’s tools.

Built-in tools (tools_enabled)

The API ships exactly two built-in tools. Enable them by name in the tools_enabled array on the request body — a sibling of agent_config, not a field inside it:
Fetch the live catalog of built-in tool names at any time:

Billing

Each built-in tool listed in tools_enabled is charged once per agent completion request, at the moment the request is set up — not per individual search or scrape the agent performs during its run, and regardless of whether the agent ends up calling the tool at all while completing the task. Only enable a tool for requests that actually need it.
Current per-unit prices are also available from GET /v1/usage/costs (usage_pricing.search_cost, usage_pricing.scrape_cost) rather than hardcoding them, since they can change.

Autonomous looper tools (selected_tools)

When agent_config.max_loops is set to "auto", the agent runs in an autonomous execution loop backed by its own internal tool set — separate from tools_enabled and tools_list_dictionary. Use agent_config.selected_tools to restrict which of these tools are available; omit it (or pass "all") to allow every tool in the list below.
The full set of 12 tools the autonomous loop can use:
run_bash is not permitted. There is no arbitrary shell-execution tool available through the autonomous loop, regardless of what selected_tools requests — the API filters the tool list down to the 12 above before the agent runs.
create_sub_agent and assign_task power dynamic sub-agent delegation — see Sub-Agent Delegation for a full walkthrough, including how sub-agents inherit the coordinator’s model and tools.

Structured Outputs & Function Calling

tools_list_dictionary custom tools and llm_args.response_format

Sub-Agent Delegation

create_sub_agent / assign_task and the handoffs field

MCP Integration

Connect agents to external MCP servers and their tools

Pricing

Full, current pricing for every billable feature