Skip to main content
Glama
field-analytics

field-analytics

by cicerao

query_metric

Retrieves governed production and dealer-sales metrics for a date range, scoped by site or region and grouped by dimensions, with role-based access controls.

Instructions

Query a metric for days from start_day to end_day (YYYY-MM-DD, both included).

Production metrics are scoped by site and group by: site, machine_id, shift, production_day. Fleet hours metrics (engine on hours, utilization) are scoped by site and group by the same four. Fleet alert metrics are scoped by site and group by: site, machine_id, severity, production_day. Dealer sales metrics are scoped by region and group by: region, dealer_id, product_line, sale_day. site or region limits the query to one of them. The caller's role limits what can be read.

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": {
      "metric": "<metric>",
      "start_day": "<start_day>",
      "end_day": "<end_day>"
    },
    "name": "query_metric"
  }
}

Input Schema

NameRequiredDescriptionDefault
siteNo
metricYes
regionNo
end_dayYes
group_byNo
start_dayYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses inclusive date semantics and role-based read restrictions, but says nothing about aggregation behavior, result size, pagination, ordering, or error conditions — meaningful gaps for a query tool with no output schema.

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 date-range contract is front-loaded in the first sentence, followed by a compact structured enumeration per metric family. The bullet-style lines each carry distinct information about scoping and grouping, though the repeated 'are scoped by ... and group by' phrasing is somewhat verbose.

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

Completeness3/5

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

For a 6-parameter query tool with no annotations and no output schema, the definition covers scoping and date semantics but leaves the return shape, aggregation semantics, default grouping, and failure behavior unaddressed. It is adequate to attempt a call, but not complete enough to predict results.

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 description coverage is 0%, so the description must compensate. It does explain start_day/end_day format and inclusivity and clarifies that site vs region select different metric scopes, but the group_by parameter is only implied by the 'group by' lists, and the accepted values for metric rely on prose family names rather than explicit enumeration.

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

Purpose4/5

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

The description opens with a specific verb and resource — 'Query a metric for days from start_day to end_day' — and clarifies range inclusivity. It implicitly separates itself from siblings like describe_metric and list_metrics by describing actual data retrieval, though it never names or contrasts an alternative explicitly.

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?

It gives real selection context: which metric families exist, that production/fleet-hours/fleet-alert metrics are scoped by site while dealer sales are scoped by region, and that the caller's role bounds visibility. What's missing is guidance on when to prefer this over describe_metric or list_metrics, and what happens if both site and region are supplied.

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