Skip to main content
Glama

Detect trend

detect_trend
Read-onlyIdempotent

Mann-Kendall trend test — detect whether a time series is trending up, down, or stable.

Pass an array of ordered values (e.g., daily visitor counts from query_timeseries) to get a statistical determination of trend direction, strength (Kendall's tau), and significance (p-value). Also returns Sen's slope (change per time step). trend is "increasing", "decreasing", or "stable"; "stable" means no significant trend at the given alpha.

Requires at least 4 data points.

Input Schema

NameRequiredDescriptionDefault
alphaNoSignificance level (default 0.05)
valuesYesOrdered time-series values (e.g., daily visitors)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered. The description adds genuine behavioral context beyond that: the three possible outcomes, what 'stable' actually means (no significant trend at the given alpha), and the hard precondition of at least 4 data points.

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?

Front-loaded with the method and purpose, then the input shape, then the outputs, then the precondition. Every sentence carries distinct information with no repetition of the schema.

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 present, the description fully compensates by enumerating the return fields (trend, Kendall's tau, p-value, Sen's slope). Combined with the stated preconditions, an agent has everything needed to call and interpret this tool.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description earns above baseline by explaining the semantics of the alpha threshold (it determines whether a trend is declared 'stable') and the interpretation of each return value derived from the inputs.

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?

Names the exact statistical method (Mann-Kendall) and states the verb+outcome: determine whether a series is trending up, down, or stable. It also names the sibling that feeds it (query_timeseries), so an agent can place it precisely among 35+ siblings.

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?

Gives clear context for use — pass an ordered array such as daily visitor counts from query_timeseries — and states the minimum data requirement. It does not, however, say when to prefer this over other analysis siblings or when a trend test is inappropriate.

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.