Skip to content

Built-in Tools

Edit this page

The Agent component ships with a collection of ready-made tool bridges that can be added to any agent. Each bridge is a separate Composer package and provides one or more tools registered via the AsTool attribute - except for the MCP bridge, which discovers its tools from a remote server at runtime.

Tip

All built-in tools can be used together with the FaultTolerantToolbox decorator to handle errors gracefully instead of letting them propagate to the agent loop.

Web Search & Content

Searches the web using the Brave Search API.

1
$ composer require symfony/ai-brave-tool

Brave Search Example

SerpApi

Searches the web via Google through the SerpApi service.

1
$ composer require symfony/ai-serp-api-tool

SerpApi Example

Tavily

Searches the web and extracts content using the Tavily AI search service.

1
$ composer require symfony/ai-tavily-tool

Tavily Example

Scraper

Loads the visible text and title of a webpage. No API key required.

1
$ composer require symfony/ai-scraper-tool

Firecrawl

Scrapes, crawls, and maps websites using the Firecrawl service.

1
$ composer require symfony/ai-firecrawl-tool

Firecrawl Scrape Example Firecrawl Map Example

Wikipedia

Searches Wikipedia and retrieves article content. No API key required.

1
$ composer require symfony/ai-wikipedia-tool

Wikipedia Example

Ollama Web Tools

Performs web searches and fetches webpage content via Ollama's built-in search capabilities.

1
$ composer require symfony/ai-ollama-tool

Ollama Web Search Example | Ollama Webpage Fetch Example

Location & Maps

Mapbox

Converts addresses to coordinates (geocoding) and coordinates to addresses (reverse geocoding) using the Mapbox Geocoding API.

1
$ composer require symfony/ai-mapbox-tool

Mapbox Geocode Example | Mapbox Reverse Geocode Example

Weather

OpenMeteo

Returns current weather and forecasts using the free Open-Meteo API. No API key required.

1
$ composer require symfony/ai-open-meteo-tool

Weather Example

Video

YouTube Transcriber

Retrieves the transcript of a YouTube video. No API key required.

1
$ composer require symfony/ai-youtube-tool

YouTube Transcriber Example

Filesystem

Filesystem

Provides sandboxed file operations for the agent. Supports reading, writing, listing, and managing files within a defined base path.

1
$ composer require symfony/ai-filesystem-tool

Caution

Always restrict the basePath to a directory the agent is allowed to access. The allowDelete option is disabled by default for safety.

Date & Time

Clock

Returns the current date and time. Compatible with Symfony Clock. No API key required.

1
$ composer require symfony/ai-clock-tool

Clock Example

Model Context Protocol

MCP

Exposes the tools a remote Model Context Protocol server advertises. The server decides which tools it offers, and each reaches the model prefixed with the server name, e.g. filesystem_read_file.

1
$ composer require symfony/ai-mcp-tool

Reach the server through a toolset and hand it to the toolbox:

1
2
3
4
5
6
7
8
9
10
11
12
13
use Mcp\Client;
use Mcp\Client\Transport\StdioTransport;
use Symfony\AI\Agent\Agent;
use Symfony\AI\Agent\Bridge\Mcp\ClientToolset;
use Symfony\AI\Agent\Bridge\Mcp\McpToolbox;

$toolset = new ClientToolset(
    'filesystem',
    Client::builder()->build(),
    new StdioTransport('npx', ['-y', '@modelcontextprotocol/server-filesystem', '/tmp']),
);

$agent = new Agent($platform, 'gpt-4o-mini', toolbox: new McpToolbox($toolset));

To offer them next to local tools, put both toolboxes behind a ChainToolbox. A server that cannot be reached contributes no tools and is asked again after retryAfter seconds (60 by default).

The tool list is fetched on first use and kept. Call reset() on the toolbox to fetch it again on the next use, e.g. between the messages of a long-running worker. In a Symfony application the bundle tags the toolbox with kernel.reset, so this happens after every request and message.

MCP Example

Note

In a Symfony application, configure the connection with the MCP bundle and reference it with an mcp_server tool entry, see AI Bundle.

Retrieval Augmented Generation

SimilaritySearch

Performs a similarity search against the Symfony AI - Store Component to enable RAG (Retrieval Augmented Generation). Requires a vectorizer and a configured vector store.

1
$ composer require symfony/ai-similarity-search-tool

See Symfony AI - Agent Component for a full RAG integration example.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.
TOC
    Version