# Utility Tools The `/tools` endpoints are public utilities — no authentication required. They're useful for LLM agents that need server-side time, safe math, or random values. ## GET /tools/time Get the current server time, timezone, and UTC offset. ```bash curl https://synapse.schaefer.zone/tools/time ``` Response: ```json { "time": "2026-06-27T14:30:00.000Z", "timezone": "Europe/Berlin", "offset": 120 } ``` Use case: LLM agents that need to know "what time is it now" for scheduling, timestamps, or relative date calculations. ## GET /tools/calc Safe calculator — arithmetic only, no `eval()`. Supports `+`, `-`, `*`, `/`, `%`, `(`, `)`, and numbers. ```bash curl "https://synapse.schaefer.zone/tools/calc?expr=(10+5)*3" ``` Response: ```json { "result": 45, "expr": "(10+5)*3" } ``` > [!TIP] > Use this instead of trying to do math in your head or via string parsing. > It's safe (no code injection possible) and accurate. ### Supported operators - `+` addition - `-` subtraction - `*` multiplication - `/` division - `%` modulo - `(` `)` parentheses - Numbers (integers and decimals) ### Examples ```bash curl ".../tools/calc?expr=2+2" # → 4 curl ".../tools/calc?expr=3.14*100" # → 314 curl ".../tools/calc?expr=100%7" # → 2 curl ".../tools/calc?expr=(2+3)*4-1" # → 19 ``` ## GET /tools/random Generate random values. ```bash # UUID v4 curl "https://synapse.schaefer.zone/tools/random?type=uuid" # → { "value": "a1b2c3d4-...", "type": "uuid" } # Integer (default range 0-100) curl "https://synapse.schaefer.zone/tools/random?type=int&min=1&max=10" # → { "value": 7, "type": "int" } # Float curl "https://synapse.schaefer.zone/tools/random?type=float&min=0&max=1" # → { "value": 0.7234, "type": "float" } # Hex string curl "https://synapse.schaefer.zone/tools/random?type=hex&min=8&max=16" # → { "value": "a3f7b2c1", "type": "hex" } # Alphabetic string curl "https://synapse.schaefer.zone/tools/random?type=alpha&min=8&max=12" # → { "value": "kQmzPwXn", "type": "alpha" } ``` ### Type parameters | Type | Parameters | Output | |------|-----------|--------| | `uuid` | none | UUID v4 string | | `int` | `min`, `max` (default 0-100) | Integer | | `float` | `min`, `max` (default 0-100) | Float | | `hex` | `min`, `max` (length range, default 8-16) | Hex string | | `alpha` | `min`, `max` (length range, default 8-16) | Alphabetic string | ## Use Cases for LLM Agents ### Generate unique IDs ```bash ID=$(curl -s .../tools/random?type=uuid | jq -r .value) curl -X POST .../memory -d "{\"key\": \"task_$ID\", ...}" ``` ### Calculate percentages ```bash TOTAL=142 DONE=87 PERCENT=$(curl -s ".../tools/calc?expr=($DONE*100)/$TOTAL" | jq -r .result) echo "Progress: $PERCENT%" ``` ### Get current timestamp ```bash NOW=$(curl -s .../tools/time | jq -r .time) curl -X POST .../var -d "{\"key\": \"last_run\", \"value\": \"$NOW\"}" ``` ### Generate test data ```bash for i in {1..10}; do NAME=$(curl -s ".../tools/random?type=alpha&min=5&max=10" | jq -r .value) curl -X POST .../memory -d "{\"key\": \"test_$i\", \"content\": \"$NAME\"}" done ``` ## Next Steps - [API Overview](/docs/api/overview) — all endpoint groups - [Errors & Error Handling](/docs/api/errors)