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.

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": {
      "values": "<values>"
    },
    "name": "detect_trend"
  }
}

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. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, closed-world, non-destructive behavior, so the description's job is return semantics — and it delivers: trend classification, tau, p-value, and Sen's slope. It also explains what 'stable' actually means (no significant trend at the given alpha) and states the minimum data requirement, which is behavior the schema only partially encodes.

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?

Opens with the method name and purpose, then the expected input, then the outputs, then the precondition. Every sentence carries information; nothing is redundant with the title or schema.

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?

With no output schema, the description takes on return-value explanation and does so adequately by naming the trend label and the statistics returned. It stops short of giving exact response field names or edge-case behavior (ties, NaNs), a minor gap for a 2-parameter analysis 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, but the description adds real meaning by tying alpha to the output classification: 'stable' is defined relative to the chosen significance level. It also reinforces that values must be ordered, which matters for a test whose result depends on sequence.

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 specific statistical method (Mann-Kendall) and the specific decision it produces (up, down, or stable), plus the secondary outputs (Kendall's tau, p-value, Sen's slope). This clearly distinguishes it from data-fetching siblings such as query_timeseries, which is explicitly positioned as the input source.

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?

Tells the agent how to use it in a workflow by pointing at query_timeseries as the typical source of the ordered values array. It does not state when not to use it or name a competing statistical alternative, but the context is clear enough to route correctly.

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.