Skip to main content
Glama
jasonwu001t

marketlens-mcp

by jasonwu001t

Stock trades

market_trades
Read-onlyIdempotent

Fetch historical US stock trades with price and share size for one or more tickers, filtering by time window; large results return a result_id for later SQL query.

Instructions

Historical trades for US stocks (price USD, size shares), one row per trade; trades Alpaca marks canceled or incorrect are dropped and counted in notes. Window by start/end or lookback (default PT20M). 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 PT20M.
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.4/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, openWorld), yet the description adds substantive behavior: canceled/incorrect trades are dropped and counted in notes, and large results are stored rather than returned with a result_id. These are non-obvious traits an agent could not derive from annotations.

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?

Three tightly packed sentences with no filler; the core resource, the data-hygiene caveat, the windowing rule, and the large-result workflow are all front-loaded in that order.

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-shape duty and does explain the result_id handoff and notes for dropped trades. It stops short of describing row fields beyond price/size, but for a paginated market-data tool this is nearly complete.

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 parameters are documented, but the description still adds value by clarifying units ('price USD, size shares') and the windowing model (start/end vs lookback with default PT20M). This meaningfully augments the schema rather than repeating it.

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 and resource ('Historical trades for US stocks') with clear scope, and the 'historical' qualifier implicitly separates it from market_latest_trades and crypto_trades/options_trades siblings. An agent can identify the resource and asset class without opening the schema.

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?

The description explains how to window data (start/end or lookback, default PT20M) and routes large results to results_query, which is useful context. However, it never names an alternative tool or states a when-not condition (e.g. use market_latest_trades for the current snapshot), so tool selection is left to inference.

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