Search by

datacircle / symfony-ai-tools

datacircle

Find the best GTM APIs, in Symfony AI: four agent tools on Datacircle's open API, no key.

v0.1.0 2026-11-15 17:12 UTC

This package is auto-updated.

Last update: 2026-11-16 15:23:12 UTC


README

Find the best GTM APIs. We benchmark all the GTM APIs and we put the results on our website.

https://datacircle.dev

This package gives Symfony AI agents four tools that call Datacircle's open API, https://api.datacircle.dev/v1. You need no key and no account.

Tool What the tool gives Call
datacircle_list_apis Every GTM API on Datacircle, with the API's slug, number of plans, number of providers and best plan GET /apis
datacircle_best_plans One API's plans, sorted by score out of 100, best first. Each plan comes with a rank and a price per 1,000 calls GET /apis/{slug}/best
datacircle_search_plans Plans that match a provider name or plan name. Search all APIs or one API. Sort the plans by score, provider or price GET /plans
datacircle_provider The APIs a provider sells, and the provider's rank on each API GET /providers/{slug}

Install

composer require datacircle/symfony-ai-tools

The package needs PHP 8.2 or later and symfony/ai-agent 0.13 or later, 1.0 included.

Use the tools in a Symfony app

Each tool is a class with #[AsTool]. Register the classes as services in config/services.yaml. Autoconfigure tags each tool for the AI bundle, and autowire gives the client your app's http_client:

services:
    _defaults:
        autowire: true
        autoconfigure: true

    Datacircle\SymfonyAi\Client: ~
    Datacircle\SymfonyAi\Tool\ListApis: ~
    Datacircle\SymfonyAi\Tool\BestPlans: ~
    Datacircle\SymfonyAi\Tool\SearchPlans: ~
    Datacircle\SymfonyAi\Tool\Provider: ~

Then give the tools to an agent in config/packages/ai.yaml. tools: true gives the agent every tool of your app:

ai:
    agent:
        default:
            platform: 'ai.platform.anthropic'
            model: 'claude-sonnet-5-5'
            tools: true

Or list only the tools you want:

ai:
    agent:
        default:
            platform: 'ai.platform.anthropic'
            model: 'claude-sonnet-5-5'
            tools:
                - 'Datacircle\SymfonyAi\Tool\BestPlans'
                - 'Datacircle\SymfonyAi\Tool\Provider'

The agent calls the tools when a question needs them:

php bin/console ai:agent:call default

Use the tools without the bundle

Datacircle::tools() gives the four tools for a Toolbox:

use Datacircle\SymfonyAi\Datacircle;
use Symfony\AI\Agent\Agent;
use Symfony\AI\Agent\Toolbox\FaultTolerantToolbox;
use Symfony\AI\Agent\Toolbox\Toolbox;

$toolbox = new FaultTolerantToolbox(new Toolbox(Datacircle::tools()));
$agent = new Agent($platform, 'claude-sonnet-5-5', toolbox: $toolbox);

echo $agent->call('Who is the best provider for the email-finder API?')->asText();

The tools work the same with the stream option. FaultTolerantToolbox passes a tool's failure to the model as text, so the agent run goes on.

You can also run a tool yourself:

use Datacircle\SymfonyAi\Tool\BestPlans;

echo (new BestPlans())('email-finder', 3);

Each tool gives back a JSON object. Each plan comes with a rank, provider, plan, score, price per 1,000 (perThousand, in dollars) and a page on datacircle.dev. That page lists every field. When the API gives no data, the tool returns {"error": "..."} with the API's own message. An unknown slug also returns {"error": "..."}. The model can then call again. A network failure throws an exception.

new Client($httpClient, baseUrl: ..., timeout: ...) sets the HTTP client, the API address and the timeout in seconds. The timeout is 30 seconds by default. Pass the client to Datacircle::tools($client) or to each tool's constructor. A MockHttpClient fakes the calls in your tests.

Network

Each tool call makes one HTTPS GET request to https://api.datacircle.dev/v1 and nothing else. The request holds only the tool's own arguments: no key and nothing from your chats or config. The API takes up to 60 calls a minute from one IP address. The tool waits once, for a minute at most, when the API asks the tool to wait. The package stores nothing.

Links

MIT license.