Skip to main content
Glama

Query daily metrics

query_daily

Daily records or week/month aggregates. aggregation identifies sum or unweighted average of stored daily values; daily_min/max are extrema of daily values, not raw samples. days_present counts stored dates; days_expected counts calendar dates in period_start/end clipped to the request, not expected sensor wear. Units and aggregation methods are kept separate. Entirely missing buckets/metrics have no row: missing is not zero. Weekly labels use SQLite %Y-W%W (Monday weeks split at New Year), not ISO weeks; use period_start/end. Limit 500 rows. If truncated, discard the partial response and re-query smaller non-overlapping ranges aligned to complete buckets, or fewer metrics. Do not combine partial bucket averages without weighting by days_present.

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": {
      "metrics": "<metrics>",
      "from": "<from>",
      "to": "<to>"
    },
    "name": "query_daily"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYes
fromYes
metricsYes
granularityNo

Output Schema

NameRequiredDescriptionDefault
rowsYes
setupNo
truncatedYes
plan_limitNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / plan_limit
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "available_from": {
      +      "type": "string"
      +    },
      +    "message": {
      +      "type": "string"
      +    },
      +    "plan": {
      +      "const": "free",
      +      "type": "string"
      +    },
      +    "requested_from": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "plan",
      +    "requested_from",
      +    "available_from",
      +    "message"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • addedOutput schema / properties / setup
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "account_email": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "install_url": {
      +      "type": "string"
      +    },
      +    "iphone_signed_in": {
      +      "type": "boolean"
      +    },
      +    "message": {
      +      "type": "string"
      +    },
      +    "status": {
      +      "const": "no_data_yet",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "status",
      +    "install_url",
      +    "account_email",
      +    "iphone_signed_in",
      +    "message"
      +  ],
      +  "type": "object"
      +}
  3. First observed

TDQS

B3.2/5.0
Behavior4/5

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

Substantial behavior is disclosed beyond the annotations: a 500-row cap, the required recovery action on truncation, the fact that missing buckets/metrics produce no row rather than zero, non-ISO SQLite week labeling, and the caveat about weighting averages. The annotations only declare openWorldHint=false and destructiveHint=false, so this description is carrying most of the load well; it stops short of anything about auth or latency.

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

Conciseness3/5

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

Sentences are dense and individually informative, but the structure is not front-loaded: output-column semantics (days_present, days_expected, daily_min/max) dominate the opening before any statement of what the call does. Given an output schema exists, much of that column-by-column explanation is likely redundant with structured data.

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

Completeness4/5

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

For a read-only time-series query with an output schema, the description covers the risky parts an agent needs — row cap, truncation recovery, missing-vs-zero semantics, week labeling — so a call is unlikely to go wrong in a way that isn't recoverable. The remaining gap is that the input contract itself (what goes in metrics, how from/to are clipped) is never stated.

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

Parameters2/5

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

Schema description coverage is 0% across four parameters, so the description must explain metrics, from, to and granularity — and it does not. Worse, it discusses 'aggregation', 'period_start/end', 'daily_min/max', 'days_present' and 'days_expected', none of which appear as input parameters, while the actual enum parameter 'granularity' and the required date-range and metrics-array formats go unaddressed.

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 opening ('Daily records or week/month aggregates') does identify the resource and the day/week/month shaping, but it never states a verb or scope statement up front, and it gives no differentiation from siblings like derived_metrics or list_metrics. An agent can infer this is a time-series read, but the first sentence reads more like a note about output column meanings than a purpose statement.

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

Usage Guidelines3/5

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

There is real guidance on handling a truncated response (discard partial, re-query smaller non-overlapping bucket-aligned ranges) and on not combining partial averages without weighting by days_present. However, there is no guidance on when to choose this tool over derived_metrics/list_metrics, nor on prerequisites such as which metrics are valid.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources