Skip to main content
Glama
jasonwu001t

marketlens-mcp

by jasonwu001t

Stock bars

market_bars
Read-onlyIdempotent

Fetch historical OHLCV bars for US stocks to analyze price and volume trends, compute returns, and run backtests across custom timeframes.

Instructions

Historical OHLCV bars for US stocks (prices in USD, volume in shares), one row per ticker and bar start (UTC). timeframe Nmin/Nh/1d/1w/Nmo (default 1d); window by start/end or lookback (default P5D intraday, P1Y daily); adjustment default all (split and dividend adjusted, what return analytics need; raw = as traded). The feed is the configured stock_feed. Large results are stored, not shown: you get a result_id to query with results_query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNoWindow end (same format). Default: now (Alpaca's latest available).
sortNoTime order of the rows: asc (oldest first, default) or desc (newest first).asc
startNoWindow start: ISO date (00:00 UTC) or datetime with a zone, e.g. 2026-01-02T14:30:00Z.
tickersYesStock tickers, e.g. ["AAPL", "BRK-B"] (1-200).
lookbackNoWindow length back from end as an ISO-8601 duration (P5D, P1Y, PT20M); only when start is omitted. Default P5D intraday, P1Y daily or longer.
timeframeNoBar size: Nmin (1-59), Nh (1-23), 1d, 1w or Nmo (1,2,3,4,6,12).1d
adjustmentNoPrice adjustment: all (split and dividend adjusted, right for returns), split, dividend, or raw (as traded).all
page_tokenNoContinue a truncated fetch: the page_token from the previous response's pagination.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/openWorld/non-destructive, so the safety profile is covered. The description adds real behavioral context beyond them: UTC row alignment, source feed, and notably that large results are stored rather than returned, yielding a result_id to fetch via results_query.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Densely packed but front-loaded with the core resource and scope, then parameters, then the result-storage caveat. Semicolon-heavy run-on style is efficient but slightly harder to parse than distinct sentences.

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 carries return-value burden and does so - explaining row format and the result_id/results_query handoff for truncated fetches. It could still say more about pagination (page_token) explicitly, but the essential behavior for correct invocation is present.

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 intent beyond the schema - it explains that adjustment=all is 'what return analytics need' and ties window defaults to timeframe context, giving meaning to why defaults differ (P5D intraday vs P1Y daily).

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?

States a specific verb+resource ('Historical OHLCV bars for US stocks') with scope, units (USD, shares), and row granularity (one row per ticker and bar start, UTC). 'Historical' and 'US stocks' clearly separate it from market_latest_bars, crypto_bars, and options_bars among the siblings.

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?

Gives useful context (defaults for timeframe/window, the configured stock_feed, and routing large results to results_query), but never states explicitly when to prefer this over market_latest_bars or other bar tools, nor when-not to use it. Usage is implied rather than prescribed.

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