AI agent JS behaviour

Tool call

A tool invocation row: name, an arguments preview, status with an icon swap (queued, spinner, success, error) and expandable input/output JSON.

Real scenarios

The component as it is used in a product — not a specimen grid.

Thinking Plan a weekend in Istanbul for two, under $600

Input

{
    "from": "DXB",
    "to": "IST",
    "date": "2026-10-15",
    "passengers": 2
}

Output

{
    "results": 6,
    "cheapest": {
        "airline": "Turkish Airlines",
        "depart": "07:40",
        "price": 84
    },
    "currency": "USD"
}

Input

{
    "city": "Istanbul",
    "nights": 2,
    "max_price": 120,
    "near": "Sultanahmet"
}

Output

[
    {
        "name": "Pera Palace",
        "price": 118,
        "rating": 4.7
    },
    {
        "name": "Bosphorus Suites",
        "price": 96,
        "rating": 4.8
    }
]

Input

{
    "city": "Istanbul",
    "days": 3
}

Output

Sunny, 24°C / 11°C, wind 9 km/h

Deploy agent · production

Input

{
    "database": "orders",
    "step": true,
    "pretend": false
}

Output

SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'archived_at'

Input

{
    "steps": 1
}

Output

{
    "rolled_back": [
        "2026_10_01_add_archived_at_to_orders"
    ]
}

Important props

Important props
Prop Type Default What it does
name / args string · mixed — The tool and its arguments (one-line preview and the full input).
status string success queued · running · success · error — change it by re-rendering or via data-status.
output / duration mixed · int null The output (pretty JSON) and how long it took, ms.
open bool false Start expanded.

Snippet

<x-nx::tool-call name="search_web" :args="['query' => 'Istanbul weather', 'limit' => 5]"
    :status="$status" :output="$results" :duration="840" />