get_analytics
Retrieve internal telemetry including backend invocation counts, success rates, latency distributions, cost estimates, and routing recommendations to diagnose backend selection and tune routing rules.
Instructions
Inspect SAB's internal telemetry: backend invocation counts, success/failure rates, latency distributions, estimated token spend per provider, and recent routing decisions. Read-only — never calls an LLM, never writes to disk. Use to diagnose 'why did SAB pick backend X', tune routing rules, or understand cost trade-offs across providers. Report types are cumulative: full_report includes everything from the other types. Returns: {success, report_type, data} where data depends on report_type — current: {backends:{[name]:{invocations, success_rate, p50_ms, p95_ms}}, session_uptime, timestamp}. historical: {time_range, series:[{timestamp, backend, calls, errors, latency}]}. cost: {by_backend:{[name]:{tokens_in, tokens_out, estimated_usd}}, total_estimated_usd}. recommendations: {recommendations:[{type, suggestion, confidence}]}. full_report: a merged object with all sections. If analytics hasn't initialized, returns {message, basic_stats:{uptime, memory, timestamp}}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| report_type | No | `current` = stats since this server started (invocation counts, success rate, p50/p95 latency per backend). `historical` = time-bucketed series over `time_range`. `cost` = estimated token spend per backend, with cost-per-1K-tokens projections. `recommendations` = SAB heuristics on backend selection (e.g. "switch coding tasks to qwen3 — 18% faster on your traces"). `full_report` = all of the above. | |
| time_range | No | Lookback window for `historical` and `cost` reports. Ignored for `current` and `recommendations`. Default: 7d. | |
| format | No | `json` = machine-readable nested object. `markdown` = human-readable summary with tables. Default: json. |