Skip to main content
Glama

query-isp-metrics

Retrieve ISP performance metrics filtered by host, site, time duration, and metric type to monitor latency, uptime, downtime, and speed.

Instructions

Query ISP metrics with filters. May be unavailable depending on account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostIdsNoFilter by host IDs
siteIdsNoFilter by site IDs
durationNoTime duration (e.g., '1h', '24h', '7d')
metricTypeNoType of ISP metric to query

Implementation Reference

  • The main handler function for query-isp-metrics. Accepts optional filters (hostIds, siteIds, duration, metricType) and POSTs to /isp-metrics/query endpoint. Returns data on success or a fallback message on error.
    export async function queryIspMetrics(params: z.infer<typeof queryIspMetricsSchema>) {
      try {
        const body: Record<string, unknown> = {};
        if (params.hostIds) body.hostIds = params.hostIds;
        if (params.siteIds) body.siteIds = params.siteIds;
        if (params.duration) body.duration = params.duration;
        if (params.metricType) body.metricType = params.metricType;
    
        const response = await unifiClient.post<{ data: unknown }>("/isp-metrics/query", body);
        return response.data;
      } catch {
        return { available: false, message: "ISP metrics query endpoint not available for this account" };
      }
    }
  • Zod schema defining input parameters: hostIds (optional string array), siteIds (optional string array), duration (optional string), metricType (optional enum: latency, downtime, uptime, speed).
    export const queryIspMetricsSchema = z.object({
      hostIds: z.array(z.string()).optional().describe("Filter by host IDs"),
      siteIds: z.array(z.string()).optional().describe("Filter by site IDs"),
      duration: z.string().optional().describe("Time duration (e.g., '1h', '24h', '7d')"),
      metricType: z.enum(["latency", "downtime", "uptime", "speed"]).optional()
        .describe("Type of ISP metric to query"),
    });
  • src/index.ts:129-131 (registration)
    Registration of the tool with name 'query-isp-metrics', description, schema, and handler wrapped via wrapToolHandler.
    tool("query-isp-metrics",
      "Query ISP metrics with filters. May be unavailable depending on account",
      queryIspMetricsSchema.shape, wrapToolHandler(queryIspMetrics));
  • Imports: zod for validation and unifiClient for API calls.
    import { z } from "zod/v4";
    import { unifiClient } from "../client.js";
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It only says the tool may be unavailable, but does not state side effects, read-only nature, authentication needs, or error behavior.

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

Conciseness4/5

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

The description is very short, two sentences, with no wasted words. However, it sacrifices informativeness for brevity.

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

Completeness2/5

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

Without an output schema, the description should explain return values or behavior. It does not mention what the query returns (e.g., time series data). Also, all parameters are optional but no defaults or combinations are suggested.

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?

Schema coverage is 100%, so the schema already describes each parameter. The description adds only the vague phrase 'with filters', which does not enhance understanding beyond the schema.

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

Purpose3/5

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

The description states it queries ISP metrics with filters, which indicates a query operation. However, it does not differentiate from a sibling tool 'get-isp-metrics' and the exact scope (e.g., latency, downtime) is left implicit from the schema.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'get-isp-metrics'. The note about availability is a constraint but not a usage guideline.

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

Install Server

Other Tools

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/us-all/unifi-mcp-server'

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