get_agent_statistics
Retrieve a single agent's time-bucketed uptime and availability statistics to analyze reliability, spot disconnection patterns, or confirm consistent online status over a chosen period.
Instructions
Get agent availability/uptime statistics over time (Legacy API: GET /nb_agent_statistics.json). Returns time-bucketed uptime samples for one agent: uptime percentage (0–100), interval, and window size per bucket.
Use this to analyze agent reliability, find patterns of agent disconnections, or verify an agent has been consistently online during a period. agent_id is required (this endpoint only operates on a single agent at a time).
Time range (mutually exclusive — pick one):
from + to — explicit interval (epoch ms, epoch seconds, or ISO 8601; normalized to ms).
last — the most recent N data points.
Response: { agent_stats: [{ agent_id, id, interval, timestamp, uptime, window_size }] }
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"agent_id": "<agent_id>"
},
"name": "get_agent_statistics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | End of the time range. Accepts Unix epoch ms, Unix epoch seconds, or ISO 8601; the client normalizes to ms. Use together with 'from'. Mutually exclusive with 'last'. | |
| from | No | Start of the time range. Accepts Unix epoch ms, Unix epoch seconds, or ISO 8601; the client normalizes to ms. Use together with 'to'. Mutually exclusive with 'last'. | |
| last | No | Return the most recent N data points. Mutually exclusive with from/to. | |
| agent_id | Yes | Agent ID — required. The endpoint only operates on a single agent. | |
| window_size | No | Aggregation bucket size in seconds (e.g. 60 = 1-minute buckets, 300 = 5-minute, 3600 = 1-hour). |