Skip to main content
Glama
Platano78

Smart-AI-Bridge

by Platano78

get_analytics

Inspect internal telemetry to diagnose backend selection, tune routing rules, and compare provider costs using invocation counts, success rates, latency, and token spend.

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

TableJSON Schema
NameRequiredDescriptionDefault
formatNo`json` = machine-readable nested object. `markdown` = human-readable summary with tables. Default: json.
time_rangeNoLookback window for `historical` and `cost` reports. Ignored for `current` and `recommendations`. Default: 7d.
report_typeNo`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 nvidia_glm — 18% faster on your traces"). `full_report` = all of the above.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv2.14.0
    • changedInput schema / properties / report_type / description
      Previous value: -"`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."New value: +"`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 nvidia_glm — 18% faster on your traces\"). `full_report` = all of the above."
  2. Added
  3. Removedv2.8.1
  4. Changed3 schema fields changedv2.6.0
    • changedInput schema / properties / format / description
      Previous value: -"Output format for reports (default: json)"New value: +"`json` = machine-readable nested object. `markdown` = human-readable summary with tables. Default: json."
    • changedInput schema / properties / report_type / description
      Previous value: -"Type of analytics to retrieve: current (session stats), historical (time-series data), cost (cost analysis), recommendations (optimization tips), full_report (comprehensive report)"New value: +"`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."
    • changedInput schema / properties / time_range / description
      Previous value: -"Time range for historical data (default: 7d)"New value: +"Lookback window for `historical` and `cost` reports. Ignored for `current` and `recommendations`. Default: 7d."
  5. Addedv1.3.2

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It explicitly states read-only, never calls an LLM, never writes to disk, and discloses edge-case behavior (returns different structure if analytics not initialized). It also details return types extensively, making behavior fully transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Though long, the description is well-structured: purpose front-loaded, followed by usage, then return format breakdown. Each sentence earns its place, especially given the tool's complexity with multiple report types. No fluff or redundant phrasing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description must fully explain return values, which it does with examples for each report type. It also covers the uninitialized fallback. All information an agent needs to correctly call and interpret the tool is present. Complete for a tool of this complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage for all 3 parameters, including enums, defaults, and semantics. The description does not add meaningful details beyond what the schema already states (e.g., it mentions report types but does not elaborate on parameters). Baseline 3 is correct since schema handles parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it inspects SAB's internal telemetry, listing specific metrics (invocation counts, success/failure rates, latency, token spend, routing decisions). 'Inspect' is a specific verb, and the resource is unambiguous. It is distinct from siblings like check_backend_health (which likely checks live health) and analyze_file (which inspects code), so no confusion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly provides use cases: diagnosing backend selection, tuning routing rules, and understanding cost trade-offs. It does not name alternative tools or mention when NOT to use it, but the context is clear and actionable. A 4 is appropriate for lacking explicit exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Platano78/Smart-AI-Bridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server