spring-ai-playground

title: Default Tool Examples description: Default Tools - Examples reference. 9 starter tools covering web fetch, datetime, productivity, search, AI, and messaging.

Default Tools - Examples

The nine tools in default-tool-specs.json are the starter examples. They span the surfaces a beginner is likely to want first - fetch a web page, get the current time, draft an email, add a calendar event, show a location on a map, look up weather, search the web, call an LLM, send a Slack message - and double as ready-to-copy templates for the helper API you will use in your own tools.

Three of the nine need an API key or webhook URL to be useful (googlePseSearch, openaiResponseGenerator, sendSlackMessage). The rest work out of the box on a fresh install - getCurrentTime and evalExpression are members of every shipped preset because they have no dependency at all.

All 9 inherit Tool Studio’s default sandbox: deny-first class allowlist, no filesystem, network in strict or host-allowlist mode with the SSRF four-layer guard for the tools that fetch.

The 9 examples { #the-examples }

extractPageContent 🆓
:material-language-html5:
web · example L3
Fetches a web page and extracts its main readable content + outbound links. Uses the host-injected fetch (SSRF-defended in `strict` mode) and safety.parser.html for parsing.
**Params**   `pageUrl`
**Env**       -
Click for full reference · params · sandbox · JS source
getCurrentTime 🆓
:material-clock-outline:
datetime · example · util L0
Returns the current time in ISO 8601 format. If the user specifies a city, country, or location, the agent should first map it to an IANA time zone and supply it via the timeZone parameter. If no time zone is provided, UTC is used.
**Params**   `timeZone`
**Env**       -
Click for full reference · params · sandbox · JS source
sendEmail 🆓
:material-email-outline:
productivity · util L0
Drafts an email and renders a **Send email** action card in chat - the user clicks to send it from their own mail app (review-then-send).
**Params**   `to` · `cc` · `subject` · `body`
**Env**       -
Click for full reference · params · sandbox · JS source
addToCalendar 🆓
:material-calendar-plus:
productivity · util L0
Builds a calendar event and renders an **Add to calendar** action card in chat - a dropdown to add the event to Google Calendar, Outlook, or Yahoo Calendar, or to get a standard `.ics` file (the `.ics` opens directly in your calendar app on the desktop, or downloads in a browser).
**Params**   `title` · `start` · `end` · `location` · `description`
**Env**       -
Click for full reference · params · sandbox · JS source
showLocation 🆓
:material-map-marker:
productivity · util L0
Renders an interactive Google Map of a place directly in the chat - no API key needed.
**Params**   `query` · `label`
**Env**       -
Click for full reference · params · sandbox · JS source
getWeather 🆓
:material-weather-partly-cloudy:
web · example · weather L3
Free public weather lookup via wttr.in (no API key). Returns a small JSON summary: { location, tempC, humidity, windSpeed, windDirection }.
**Params**   `location`
**Env**       -
Click for full reference · params · sandbox · JS source
googlePseSearch 🔑 × 2
:simple-google:
web · example · search L3
Google Programmable Search Engine query (Custom Search API). Requires `GOOGLE_API_KEY` and `GOOGLE_PSE_ID` env vars.
**Params**   `query` · `resultNum` · `startPage`
**Env**       `GOOGLE_API_KEY` · `GOOGLE_PSE_ID`
Click for full reference · params · sandbox · JS source
openaiResponseGenerator 🔑 × 1
:material-creation:
ai · example L3
Calls OpenAI's Responses API. Requires `OPENAI_API_KEY` env var.
**Params**   `prompt` · `model`
**Env**       `OPENAI_API_KEY`
Click for full reference · params · sandbox · JS source
sendSlackMessage 🔑 × 1
:material-pound-box-outline:
messaging · example L3
Posts a text message to a Slack channel via Incoming Webhook. Requires `SLACK_WEBHOOK_URL` env var (the full https://hooks.slack.com/services/... URL).
**Params**   `text`
**Env**       `SLACK_WEBHOOK_URL`
Click for full reference · params · sandbox · JS source

Composition patterns (starter chains)

These nine tools are picked so any pair plugs together - a perfect first agentic-workflow surface. Two patterns you can reproduce after Local Pass:

Deeper walk-throughs in Tutorial 8: Default Tool Recipes.

Keys & secrets

Three of the nine need a credential. The launcher’s Environment Variables card is the recommended place to set them; the static-variable substring is masked from console.log and from the chat tool-call trace whenever it appears as a full string in the output.

Tool Env var Where to issue
openaiResponseGenerator OPENAI_API_KEY platform.openai.com/api-keys
googlePseSearch GOOGLE_API_KEY + GOOGLE_PSE_ID Google Cloud Console for the API key, Programmable Search Engine for the PSE ID
sendSlackMessage SLACK_WEBHOOK_URL api.slack.com/apps → Incoming Webhooks → Add to Workspace

Tool Studio: Static Variables - how ${ENV_VAR} placeholders resolve at runtime.