spring-ai-playground

description: Default Tools - Utilities reference. 26 pure-compute tools - text, datetime, math, security, encoding, crypto, CSV. No network, no env vars, no filesystem.

Default Tools - Utilities

The 26 tools in default-tool-specs-builtin.json (16) and default-tool-specs-builtin-helpers.json (10) cover text manipulation, date arithmetic, math, security scanners, encoding, cryptographic primitives, and CSV serialisation / parsing. They share one property - no network, no filesystem, no env vars. Everything runs in-memory at sandbox L0 by default; the only outside helpers in play are safety.parser.csv for formatCsv / parseCsv and crypto.subtle for the crypto group - both still purely in-memory.

Because they ride on JVM stdlib - java.security.MessageDigest, javax.crypto, JCE, the JDK regex engine - every one of these runs identically on macOS, Windows, and Linux. See Tool Studio: Cross-platform by design for the mechanics.

The 26 tools split by concern.

Browse the 26 utilities { #browse-the-utilities }

Every tool below runs at sandbox L0 with no env vars. Use the directory on the Default Tools index for cross-page search; this page is the full per-tool reference for the 26.

timezoneConvert 🆓
:material-clock-alert-outline:
datetime · util L0
Converts a moment in time between IANA time zones. Returns the same instant rendered in the target zone (ISO with offset).
**Params**   `text` · `toTimeZone`
**Env**       -
Click for full reference · params · sandbox · JS source
dateDiff 🆓
:material-calendar-arrow-right:
datetime · util L0
Computes b - a in the requested unit (days|hours|minutes|seconds|milliseconds). Returns a number which may be fractional.
**Params**   `a` · `b` · `unit`
**Env**       -
Click for full reference · params · sandbox · JS source
urlEncode 🆓
:material-link-variant:
text · util L0
Percent-encodes a string for use in a URL component. Equivalent to encodeURIComponent.
**Params**   `text`
**Env**       -
Click for full reference · params · sandbox · JS source
dateMath 🆓
:material-calendar-clock:
datetime · util L0
Adds (or subtracts) a duration to a date and returns the resulting ISO timestamp. Unit: years|months|weeks|days|hours|minutes|seconds|milliseconds.
**Params**   `text` · `amount` · `unit`
**Env**       -
Click for full reference · params · sandbox · JS source
parseDate 🆓
:material-calendar-import:
datetime · util L0
Parses a date/time string (ISO 8601 or RFC 2822) and returns its components plus epochMillis.
**Params**   `text` · `timeZone`
**Env**       -
Click for full reference · params · sandbox · JS source
cronNext 🆓
:material-timer-cog-outline:
datetime · util L0
Computes the next datetime matching a standard 5-field cron expression (minute hour day month weekday). Supports * , - / and ? (treated as *). Returns ISO timestamp in UTC.
**Params**   `expression` · `from` · `count`
**Env**       -
Click for full reference · params · sandbox · JS source
diffText 🆓
:material-file-compare:
text · util L0
Returns a line-by-line diff between two texts. Each entry is {op, line} where op is one of '=' (unchanged), '-' (only in a), '+' (only in b).
**Params**   `a` · `b`
**Env**       -
Click for full reference · params · sandbox · JS source
sortLines 🆓
:material-sort-alphabetical-ascending:
text · util L0
Sorts lines of text alphabetically. Supports reverse and case-insensitive options.
**Params**   `text` · `reverse` · `caseInsensitive`
**Env**       -
Click for full reference · params · sandbox · JS source
piiDetect 🆓
:material-shield-account-outline:
security · util L0
Scans text for personally identifiable information patterns (email, US SSN, US phone, credit card, IPv4). Returns an array of {type, masked, index}.
**Params**   `text`
**Env**       -
Click for full reference · params · sandbox · JS source
regexExtract 🆓
:material-regex:
text · util L0
Returns all regex matches in the input. With the 'g' flag every match is returned; without it the first match (with capture groups) is returned.
**Params**   `text` · `pattern` · `flags`
**Env**       -
Click for full reference · params · sandbox · JS source
formatDate 🆓
:material-calendar-text-outline:
datetime · util L0
Formats a date (ISO string or epoch ms) using a pattern with tokens yyyy/MM/dd HH:mm:ss SSS. Time zone aware.
**Params**   `text` · `pattern` · `timeZone`
**Env**       -
Click for full reference · params · sandbox · JS source
stats 🆓
:material-sigma:
math · util L0
Returns summary statistics (count, sum, min, max, mean, median, stddev) for an array of numbers.
**Params**   `numbers`
**Env**       -
Click for full reference · params · sandbox · JS source
secretPatternDetect 🆓
:material-key-alert-outline:
security · util L0
Scans text for well-known secret patterns (AWS keys, GitHub tokens, Slack tokens, OpenAI keys, Stripe keys, private keys). Returns an array of {type, masked, index}.
**Params**   `text`
**Env**       -
Click for full reference · params · sandbox · JS source
regexReplace 🆓
:material-find-replace:
text · util L0
Replaces regex matches in the input with the given replacement string. Supports $1, $2 group back-references.
**Params**   `text` · `pattern` · `replacement` · `flags`
**Env**       -
Click for full reference · params · sandbox · JS source
evalExpression 🆓
:material-calculator-variant-outline:
math · util L0
Evaluates a safe arithmetic/logical expression (no eval, no host access). Supports + - * / % ** parens, &&, ||, !, ==, !=, <, <=, >, >=, and numeric/string/boolean literals plus variables from the variables object.
**Params**   `expression` · `variables`
**Env**       -
Click for full reference · params · sandbox · JS source
formatCsv 🆓
:material-file-table-outline:
data · util L0
Serialises an array of rows into CSV text. Rows may be arrays (use header param) or objects (keys become the header). RFC 4180 quoting.
**Params**   `rows` · `header` · `delimiter`
**Env**       -
Click for full reference · params · sandbox · JS source
base64 🆓
:material-code-tags:
encoding · util L0
Encodes UTF-8 text to base64, or decodes base64 back to UTF-8 text. Use mode='encode' (default) or 'decode'. URL-safe variant via urlSafe=true.
**Params**   `text` · `mode` · `urlSafe`
**Env**       -
Click for full reference · params · sandbox · JS source
hex 🆓
:material-numeric:
encoding · util L0
Encodes UTF-8 text to hex string, or decodes hex back to UTF-8 text. Use mode='encode' (default) or 'decode'.
**Params**   `text` · `mode` · `upperCase`
**Env**       -
Click for full reference · params · sandbox · JS source
uuid 🆓
:material-identifier:
crypto · util L0
Generates a cryptographically random UUID v4 string.
**Params**   -
**Env**       -
Click for full reference · params · sandbox · JS source
hash 🆓
:material-pound:
crypto · util L0
Computes the cryptographic hash of UTF-8 text. Algorithms: SHA-256 (default), SHA-384, SHA-512. Returns lowercase hex.
**Params**   `text` · `algorithm`
**Env**       -
Click for full reference · params · sandbox · JS source
hmac 🆓
:material-key-variant:
crypto · util L0
Computes an HMAC signature over UTF-8 text using a secret. Algorithms: SHA-256 (default), SHA-384, SHA-512. Returns lowercase hex.
**Params**   `secret` · `text` · `algorithm`
**Env**       -
Click for full reference · params · sandbox · JS source
secureRandom 🆓
:material-dice-6-outline:
crypto · util L0
Generates cryptographically secure random bytes. encoding: 'hex' (default), 'base64', or 'base64url'.
**Params**   `bytes` · `encoding`
**Env**       -
Click for full reference · params · sandbox · JS source
passwordGenerate 🆓
:material-form-textbox-password:
crypto · util L0
Generates a strong random password from selected character classes. Uses crypto.getRandomValues for unbiased selection.
**Params**   `length` · `includeLowercase` · `includeUppercase` · `includeDigits` · `includeSymbols`
**Env**       -
Click for full reference · params · sandbox · JS source
jwtDecode 🆓
:material-shield-key-outline:
crypto · util L0
Decodes a JWT without verifying its signature. Returns the header and payload as JSON, plus signaturePresent.
**Params**   `token`
**Env**       -
Click for full reference · params · sandbox · JS source
jwtVerify 🆓
:material-shield-check-outline:
crypto · util L0
Verifies a HS256/HS384/HS512 JWT signature using a shared secret and returns the decoded payload on success. Also checks exp and nbf claims when present.
**Params**   `token` · `secret`
**Env**       -
Click for full reference · params · sandbox · JS source
parseCsv 🆓
:material-file-import-outline:
data · util L0
Parses CSV text into an array of rows. If header=true, each row is an object keyed by the first row.
**Params**   `text` · `header` · `delimiter`
**Env**       -
Click for full reference · params · sandbox · JS source

Composition patterns (in-memory data pipelines)

The 26 utilities are deliberately I/O-free, which makes them perfect for chains the agent runs entirely in-memory:

Tutorial 8: Default Tool Recipes walks one of these end-to-end (the text-shell ETL chain).

Keys & secrets

None. All 26 utilities run with the default sandbox baseline - no network, no filesystem, no env vars. That is what makes them the safe slice of the catalog to expose to the model with zero setup.

Tool Studio: Built-in JavaScript Helpers - the underlying crypto.subtle, safety.parser.csv, regex helpers each of these tools wraps.