# Hulpmiddelen De `/tools`-eindpunten zijn openbare hulpmiddelen — geen authenticatie vereist. Ze zijn handig voor LLM-agents die servertijd, veilige wiskunde of willekeurige waarden nodig hebben. ## GET /tools/time Haal de huidige servertijd, tijdzone en UTC-offset op. ```bash curl https://synapse.schaefer.zone/tools/time ``` Respons: ```json { "time": "2026-06-27T14:30:00.000Z", "timezone": "Europe/Berlin", "offset": 120 } ``` Toepassing: LLM-agents die moeten weten "hoe laat is het nu" voor planning, tijdstempels of relatieve datumberekeningen. ## GET /tools/calc Veilige rekenmachine — alleen rekenkunde, geen `eval()`. Ondersteunt `+`, `-`, `*`, `/`, `%`, `(`, `)` en getallen. ```bash curl "https://synapse.schaefer.zone/tools/calc?expr=(10+5)*3" ``` Respons: ```json { "result": 45, "expr": "(10+5)*3" } ``` > [!TIP] > Gebruik dit in plaats van wiskunde in uw hoofd te doen of via string-parsing. > Het is veilig (geen code-injectie mogelijk) en accuraat. ### Ondersteunde operatoren - `+` optellen - `-` aftrekken - `*` vermenigvuldigen - `/` delen - `%` modulo - `(` `)` haakjes - Getallen (gehele getallen en decimalen) ### Voorbeelden ```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 Genereer willekeurige waarden. ```bash # UUID v4 curl "https://synapse.schaefer.zone/tools/random?type=uuid" # → { "value": "a1b2c3d4-...", "type": "uuid" } # Geheel getal (standaardbereik 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" } # Alfabetische string curl "https://synapse.schaefer.zone/tools/random?type=alpha&min=8&max=12" # → { "value": "kQmzPwXn", "type": "alpha" } ``` ### Type-parameters | Type | Parameters | Uitvoer | |------|-----------|---------| | `uuid` | geen | UUID v4-string | | `int` | `min`, `max` (standaard 0-100) | Geheel getal | | `float` | `min`, `max` (standaard 0-100) | Float | | `hex` | `min`, `max` (lengtebereik, standaard 8-16) | Hex-string | | `alpha` | `min`, `max` (lengtebereik, standaard 8-16) | Alfabetische string | ## Toepassingen voor LLM-agents ### Genereer unieke ID's ```bash ID=$(curl -s .../tools/random?type=uuid | jq -r .value) curl -X POST .../memory -d "{\"key\": \"task_$ID\", ...}" ``` ### Bereken percentages ```bash TOTAL=142 DONE=87 PERCENT=$(curl -s ".../tools/calc?expr=($DONE*100)/$TOTAL" | jq -r .result) echo "Progress: $PERCENT%" ``` ### Haal huidige tijdstempel op ```bash NOW=$(curl -s .../tools/time | jq -r .time) curl -X POST .../var -d "{\"key\": \"last_run\", \"value\": \"$NOW\"}" ``` ### Genereer testdata ```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 ``` ## Volgende stappen - [API-overzicht](/docs/api/overview) — alle eindpuntgroepen - [Fouten & Foutafhandeling](/docs/api/errors)