Application-owned tool use
For a web app or analyst copilot, your backend sends the tool definition, executes Claude’s selected function, and returns a matching tool result.
Anthropic tool useFinance & Market Data
Build reliable real-time stock data workflows for Claude with verified timestamps, market coverage, freshness, and failure handling.
Published: April 18, 2026 · By the QVeris Team


For a web app or analyst copilot, your backend sends the tool definition, executes Claude’s selected function, and returns a matching tool result.
Anthropic tool useFor Claude Code or Desktop, the server exposes read-only tools and keeps provider credentials outside the conversation.
Anthropic MCPinstrument
Symbol, exchange, asset type
price
Value and currency
as_of
Provider timestamp
feed
Provider and entitlement
freshness
Real-time, delayed, close
session
Pre, regular, after, closed
{ "instrument": { "symbol": "AAPL", "exchange": "NASDAQ" }, "price": 0, "currency": "USD", "as_of": "provider timestamp", "provider": "configured source", "feed": "entitled feed", "freshness": "real_time | delayed", "session": "regular | closed" }
The zero is a schema placeholder—not a quote.
Define get_stock_quote with symbol and optional exchange. State that it cannot trade.
Resolve ambiguous tickers, cap batches, and never let Claude build a URL containing credentials.
Call a snapshot or read the newest validated stream event, then convert it to the contract.
Preserve ambiguity, halt, stale cache, entitlement, rate-limit, and timeout states.
Require price, currency, exchange, session, source, and time. If stale, say unavailable.
Request only needed symbols and event types; monitor reconnects and sequence.
Deduplicate, detect out-of-order data, and retain provenance.
Send a snapshot or threshold event—not thousands of ticks.
Alpaca documents separate SIP, IEX, and delayed SIP feeds. Expose the feed instead of calling everything “live.” Read its stream documentation and FAQ.
| Test | Condition | Required behavior |
|---|---|---|
| Fresh quote | Known symbol, valid entitlement | Show value, currency, exchange, source, session, time |
| Ambiguous | Multiple instruments | Ask; do not guess |
| Closed | Earlier session | Label last trade or close |
| Stale | Age exceeds threshold | Return stale or unavailable |
| Failure | Timeout, limit, auth | Never fall back to model memory |
“Real-time stock market data for Claude” does not mean every workflow needs a continuous stream. Match retrieval to the decision Claude must support.
| Intent | Best input | Disclose |
|---|---|---|
| Current price | Latest quote or trade snapshot | Value type, feed, time, session |
| Spread alert | WebSocket plus rule engine | Trigger, window, event time |
| Intraday summary | Validated intraday bars | Interval, timezone, partial status |
| Historical comparison | Historical bars with adjustment policy | Range, adjustment, missing sessions |
A completed trade is not necessarily the price available for a new order.
Claude should name the cited side instead of flattening both into one “stock price.”
Mark an in-progress OHLCV bar before comparing it with completed periods.
State when the tool is required, what it cannot do, and which ambiguity must be resolved. Application code validates arguments and accesses the provider.
symbolRequired; never infer exchangeexchangeRequired when ambiguousmodelatest_quote · latest_trade · snapshotmax_age_msApplication freshness thresholdextended_hoursExplicit session scope{ "name": "get_stock_quote", "description": "Read-only current quote. Never places orders. Ask for exchange when ambiguous.", "input_schema": { "type": "object", "properties": { "symbol": { "type": "string" }, "exchange": { "type": "string" }, "mode": { "enum": ["latest_quote", "latest_trade", "snapshot"] } }, "required": ["symbol", "mode"] } }ok, ambiguous_instrument, stale, market_halt, not_entitled, rate_limited, provider_unavailable.Separate data credentials from brokerage credentials. Trading needs another tool, credential, approval path, and audit trail.
Define acceptable quote age per workflow and reject data beyond it.
Store provider time, receive time, feed, entitlement, and visible cache age.
Review terms for end-user display, derived output, storage, and multi-user access.
Log sanitized arguments, feed, event time, cache age, latency, and outcome. Redact secrets.
Treat news as data, not instructions. Accept typed parameters—not retrieved URLs or headers.
| Symptom | Likely cause | Action |
|---|---|---|
| No tool call | Description misses live intent | Require the tool for current, latest, bid, ask, and session queries |
| Different price | Different feed, field, session, or time | Compare identical instrument, feed, value type, and timestamp |
| No symbol data | OTC entitlement, inactivity, halt, symbol change | Resolve metadata; never substitute a similar ticker |
| HTTP 403 | Credentials, host, or entitlement | Check auth and label any feed downgrade |
| Old latest event | Closed, halt, stale connection, delayed feed | Check calendar, connection, feed class, provider time |
Test valid, ambiguous, inactive, and unsupported symbols; assert evidence fields and timezone parsing.
Run before open, during regular hours, after close, on holidays, and in extended hours.
Simulate timeout, 403, 429, broken stream, stale cache, malformed payload, and out-of-order events.
Verify multiple phrasings return instrument, value type, currency, exchange, session, provider/feed, and time.
Market observation time, not answer-generation time.
Delivery source and coverage class.
Measured age and declared delay class.
Pre-market, regular, after-hours, or closed.
Bid and ask; different from a completed trade.
Bounded latest fields at a defined retrieval time.
Do not treat Claude as a licensed feed. Connect an external source and return timestamp, feed, and session.
Use Messages API in your app; use MCP when a Claude client should discover the capability.
No. Aggregate outside the model and send a bounded snapshot.
A verified profile link does not guarantee entitlement, field availability, price or current execution success; inspect the current contract before calling.
