Skip to main content
Glama

Stochastic Oscillator

GetStochasticOscillator
Read-only

Calculate a stock’s Stochastic Oscillator %K and %D to identify overbought (>80) or oversold (<20) conditions from historical price data.

Instructions

Stochastic Oscillator (%K and %D) for a stock. %K measures the close relative to the high/low range over the lookback window; %D is the smoothed signal line (simple moving average of %K). Useful for spotting overbought (>80) and oversold (<20) conditions. The lookback window is warmed up on price history fetched before startDate, so values do not depend on the requested range's left edge.

Input Schema

NameRequiredDescriptionDefault
tickerYesStock ticker symbol (e.g., AAPL, MSFT). Class shares use a dash (BRK-B); the dot form (BRK.B) is also accepted. A listing on another exchange is MIC:TICKER (XPAR:AIR).
dPeriodNoSmoothing window for %D (default: 3)
endDateNoEnd date in YYYY-MM-DD format (defaults to latest available)
kPeriodNoLookback window for %K (default: 14)
startDateNoStart date in YYYY-MM-DD format (defaults to 6 months ago)
maxResultsNoMaximum number of records to return (default: 60, max: 500); the newest rows are kept and listed newest first.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With readOnlyHint=true already covering the safety profile, the description still adds real behavioral context: the warm-up on price history fetched before startDate, and the explicit guarantee that values do not depend on the requested range's left edge. That is a non-obvious trait an agent would otherwise have to discover by experiment; only pagination/row-limit behavior (found in the schema) is left unaddressed.

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?

Four sentences, all load-bearing: indicator definition first, then the two series, then the practical interpretation, then the one non-obvious caveat. Nothing is repeated and the core identity is front-loaded.

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 does supply the shape of the return conceptually (%K and %D series over the requested window), and it flags the warm-up semantics that affect results. It stops short of describing row ordering, default window size, or the maxResults cap, though those live in the schema.

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 what %K and %D actually represent, which is the conceptual meaning behind kPeriod and dPeriod, and by clarifying that the startDate window is warmed up from prior history—context the schema's one-line parameter notes do not convey.

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 names the specific indicator (Stochastic Oscillator), its two output series (%K and %D), and defines how each is computed, so the resource is unambiguous. It does not, however, explicitly distinguish itself from sibling technical-indicator tools like GetBollingerBands or GetAverageTrueRange, so an agent must infer the boundary from the indicator definition alone.

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

Usage Guidelines3/5

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

It states an interpretive use case ('spotting overbought (>80) and oversold (<20) conditions'), which implies when the output matters. There is no guidance on when to choose this over the sibling oscillators/volatility tools, nor any preconditions or exclusions, so usage is only implied rather than explicit.

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