Skip to main content
Glama
xsf0221

Pattern Vista

market_stretch

Measure US market breadth by calculating the share of symbols above their 200-day moving average and comparing it to historical readings to reveal whether the market is broadly extended or depressed.

Instructions

How stretched the US market is: the share of tracked symbols closing above their own 200-day moving average, plus where that reading ranks against its own recorded history.

This is a breadth (participation) measure, not an index level: a cap-weighted index can sit above its 200-day average while most of its members sit below theirs. Use it to answer "is the market broadly extended or broadly depressed right now", never as a forecast.

Args: days: How many trading sessions of history to return, newest last. Capped at 1000 server-side. Use a small number if you only need the current reading.

Returns: current: the latest session — snapshot_date, total, above_ma200, pct_above (0..1), median, p10, p90. percentile: where current.pct_above ranks in the full stored history, 0..1, where 1.0 means the broadest participation on record. history: the daily series, oldest first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden. It reveals the tool's conceptual behavior (breadth vs. index level), the server-side cap of 1000 days, the ordering of returned history, and what each returned component represents. This gives the agent a solid mental model beyond the bare field names.

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 front-loaded with a one-sentence definition, followed by a short clarifying paragraph and structured Args/Returns sections. Every sentence contributes either conceptual framing, usage guidance, or parameter/return semantics, with no filler.

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?

For a single-parameter read-only metric with an output schema, the description is complete. It covers what the metric means, how to interpret it, the history cap, ordering conventions, parameter advice, and the shape of the return payload. An agent has everything needed to invoke and interpret the result 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?

The schema provides zero description for the 'days' parameter, but the description fully compensates by explaining it in trading sessions, stating that results are newest last, noting the server-side cap, and advising a small value when only the current reading is needed. This adds real semantic value beyond the raw schema.

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?

The description defines the tool with a precise, measurable resource: the share of tracked symbols closing above their 200-day moving average, plus how that reading ranks in its own history. It clearly distinguishes the metric from an index level, so an agent can tell exactly what this tool computes and how it differs from price-level measures.

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

Usage Guidelines5/5

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

It explicitly states when to use the tool: 'Use it to answer "is the market broadly extended or broadly depressed right now"' and when not to: 'never as a forecast.' It also clarifies that it is a participation/breadth measure rather than an index-level measure, giving the agent enough context to avoid misapplication.

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