This is the documentation of version 0.47.7. Go to the latest version, 1.0.0-rc.5.

Agent Toolkit Plugin

The Agent Toolkit turns a TomTom map into something a user can talk to. Drop in your favourite LLM, wire up a chat box, and your users can plan routes, search for places, inspect traffic, and reshape the map with sentences instead of clicks.

Why it exists

LLMs are great at understanding what someone wants. Maps are great at showing them where things are. The gap between the two is plumbing — a tool registry the model can call, agent state that survives multiple turns, an intent classifier that keeps the prompt small, and a sandbox for the heavy lifts. The Agent Toolkit owns that plumbing so you can focus on the experience.

You bring an LLM and (optionally) a chat UI. The plugin handles the rest.

What you can power with it

A few common shapes the toolkit is good at:

What's in the box

@tomtom-org/maps-sdk-plugin-agent-toolkit is a headless plugin built on Vercel AI SDK. It wires a TomTomMap instance and TomTom services to a curated set of LLM-callable tools and runs the multi-step tool loop via ToolLoopAgent.

You bring:

The plugin provides:

Quickstart

All plugins use @tomtom-org/maps-sdk as a peer dependency — ensure the SDK is installed first. See the Project Setup guide if needed.

Install

npm install @tomtom-org/maps-sdk-plugin-agent-toolkit
npm install ai @ai-sdk/openai   # or @ai-sdk/anthropic, @ai-sdk/azure, etc.

Wire it up

import { TomTomConfig } from '@tomtom-org/maps-sdk/core';
import { TomTomMap } from '@tomtom-org/maps-sdk/map';
import { createMapAgent } from '@tomtom-org/maps-sdk-plugin-agent-toolkit';
import { openai } from '@ai-sdk/openai';
import { DirectChatTransport, useChat } from 'ai/react';

TomTomConfig.instance.put({ apiKey: 'YOUR_API_KEY' });

const map = new TomTomMap({ mapLibre: { container: 'map' } });

const agent = createMapAgent(map, {
    model: openai('gpt-4o'),

    // Optional: tailor which data-entry kinds the agent can touch. Disabling
    // a kind removes it from analyseData / processData scope AND drops the
    // related recall / display tools from the registry.
    dataEntries: {
        routes: { entryMode: 'single' },          // one route at a time
        byod: { enabled: false },                 // no BYOD tools in this deployment
    },
});

// Wire to any Vercel AI SDK chat interface
const { messages, sendMessage } = useChat({
    transport: new DirectChatTransport({ agent }),
});

Try it out

Once wired, users can interact naturally:

Clean up

agent.destroy();   // resets every built-in and custom state slice that implements reset()

In this section

Coding skills for Claude Code

If you're using Claude Code to build against this plugin, the repo ships two skills that load focused context on demand:

Both skills sit in .claude/skills/ and are invoked automatically when Claude detects a relevant question or file.

API Reference

Agent Toolkit Plugin API Reference

Related guides