Skip to main content
Glama
xsf0221

Pattern Vista

deviation_ranking

Rank stocks by percentage distance from their 200-day moving average. Use direction 'under' to list depressed symbols or 'over' for extended ones, revealing mean-reversion candidates.

Instructions

Symbols furthest from their own 200-day moving average, ranked.

direction="under" lists the most depressed names (price far below its long-term average — the mean-reversion long candidates); direction="over" lists the most extended ones. Deviation is (close - MA200) / MA200, so -0.30 means the price is 30% below its own 200-day average.

Symbols whose 200-day window contains a single-day move above 25% are excluded: in practice that is an unadjusted stock split rather than a real move, and it would otherwise dominate the ranking.

Args: direction: "under" or "over". limit: Max rows, up to 100. Free accounts always receive 2 regardless — check is_billed in the response before reporting the list as complete.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
directionNounder

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses the deviation formula, excludes split-like single-day moves with reasoning, and warns that free accounts always return 2 rows. This is genuinely useful behavioral context.

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?

The description is well-organized: summary, formula/exclusion rationale, then argument details. Every sentence adds value, including the split-exclusion explanation and the is_billed check.

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?

An output schema exists, so return-value details are not needed. The description covers invocation semantics, edge cases, and account-dependent behavior, making it complete enough for an agent to call the tool correctly.

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

Parameters5/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, and it does. It explains the meaning of direction values, the deviation calculation, and the limit parameter's maximum and free-account behavior. Defaults are left to the schema, which is acceptable.

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 clearly states that the tool ranks symbols by distance from their 200-day moving average and explains both direction modes. It does not explicitly differentiate itself from sibling tools such as market_stretch, so it stops short of a 5.

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 clear usage context: direction='under' is for depressed mean-reversion candidates, direction='over' is for extended names, and the limit/billing caveat is spelled out. It does not mention alternatives or explicit when-not-to-use conditions, but the context is strong.

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