Skip to main content
Glama

Scrape Stock

scrape_stock

Fetch structured stock market data from Yahoo Finance for any ticker, returning current quotes, historical price bars, or company profiles as validated JSON.

Instructions

Fetch stock market data from Yahoo Finance and return it as a dict.

The returned shape depends on mode:

  • "quote": {"symbol", "currency", "exchange", "price", "previous_close", "volume", "day_high", "day_low", "fifty_two_week_high", "fifty_two_week_low"}.

  • "history": {"symbol", "period", "rows": [{"date", "open", "high", "low", "close", "volume"}, ...]}.

  • "profile": {"symbol", "name", "currency", "exchange", "market", "timezone", "instrument_type"}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoString selecting what to fetch; one of "quote", "history", "profile". Example: "quote". Default: "quote".quote
periodNoString history window, used only when mode="history" and ignored otherwise; one of "1d", "5d", "1mo", "3mo", "6mo", "1y", "2y", "5y", "10y", "ytd", "max". Example: "1y". Default: "1mo".1mo
symbolYesTicker symbol as a string. Example: "AAPL". No default (required).
intervalNoCandle size for history bars, used only when mode="history"; one of "1d", "1wk", "1mo". Example: "1wk". Default: "1d".1d

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
countNo
errorsNo
scraperNo
source_urlsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.4.6
    • addedInput schema / properties / interval
      Added value: +{
      +  "default": "1d",
      +  "description": "Candle size for history bars, used only when mode=\"history\"; one of \"1d\", \"1wk\", \"1mo\". Example: \"1wk\". Default: \"1d\".",
      +  "type": "string"
      +}
    • changedInput schema / properties / mode / description
      Previous value: -"String selecting what to fetch; one of \"quote\", \"history\", \"profile\". Example: \"quote\". No default (required)."New value: +"String selecting what to fetch; one of \"quote\", \"history\", \"profile\". Example: \"quote\". Default: \"quote\"."
  2. Changed3 schema fields changed
    • changedInput schema / properties / mode / description
      Previous value: -"\"quote\", \"history\", or \"profile\"."New value: +"String selecting what to fetch; one of \"quote\", \"history\", \"profile\". Example: \"quote\". No default (required)."
    • changedInput schema / properties / period / description
      Previous value: -"History window when mode=\"history\", e.g. \"1mo\", \"1y\"."New value: +"String history window, used only when mode=\"history\" and ignored otherwise; one of \"1d\", \"5d\", \"1mo\", \"3mo\", \"6mo\", \"1y\", \"2y\", \"5y\", \"10y\", \"ytd\", \"max\". Example: \"1y\". Default: \"1mo\"."
    • changedInput schema / properties / symbol / description
      Previous value: -"Ticker symbol, e.g. \"AAPL\", \"GOOGL\"."New value: +"Ticker symbol as a string. Example: \"AAPL\". No default (required)."
  3. Changed20 schema fields changedv1.3.3
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / mode / description
      Added value: +"\"quote\", \"history\", or \"profile\"."
    • removedInput schema / properties / mode / title
      Removed value: -"Mode"
    • addedInput schema / properties / period / description
      Added value: +"History window when mode=\"history\", e.g. \"1mo\", \"1y\"."
    • removedInput schema / properties / period / title
      Removed value: -"Period"
    • addedInput schema / properties / symbol / description
      Added value: +"Ticker symbol, e.g. \"AAPL\", \"GOOGL\"."
    • removedInput schema / properties / symbol / title
      Removed value: -"Symbol"
    • removedInput schema / title
      Removed value: -"scrape_stockArguments"
    • removedOutput schema / $defs
      Removed value: -{
      -  "ToolError": {
      -    "description": "A non-fatal problem encountered while scraping.",
      -    "properties": {
      -      "message": {
      -        "title": "Message",
      -        "type": "string"
      -      },
      -      "url": {
      -        "title": "Url",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "url",
      -      "message"
      -    ],
      -    "title": "ToolError",
      -    "type": "object"
      -  }
      -}
    • removedOutput schema / properties / count / title
      Removed value: -"Count"
    • removedOutput schema / properties / data / title
      Removed value: -"Data"
    • removedOutput schema / properties / errors / items / $ref
      Removed value: -"#/$defs/ToolError"
    • addedOutput schema / properties / errors / items / description
      Added value: +"A non-fatal problem encountered while scraping."
    • addedOutput schema / properties / errors / items / properties
      Added value: +{
      +  "message": {
      +    "type": "string"
      +  },
      +  "url": {
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / properties / errors / items / required
      Added value: +[
      +  "url",
      +  "message"
      +]
    • addedOutput schema / properties / errors / items / type
      Added value: +"object"
    • removedOutput schema / properties / errors / title
      Removed value: -"Errors"
    • removedOutput schema / properties / scraper / title
      Removed value: -"Scraper"
    • removedOutput schema / properties / source_urls / title
      Removed value: -"Source Urls"
    • removedOutput schema / title
      Removed value: -"ScrapeToolResult"
  4. Addedv1.3.0
  5. Removedv1.2.0
  6. Addedv1.1.7
  7. Removed
  8. First observedv1.1.6

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the external data source, the dict return type, and how the output varies by mode. However, it does not mention whether the operation is read-only, how errors or invalid symbols are handled, or any rate-limit/network caveats typical of a scraping tool.

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 compact, well-structured, and front-loaded with the core purpose. The mode-by-mode output list is dense but easy to scan, and every sentence contributes useful information without drifting into fluff.

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?

Given the tool's modest complexity, the description covers the essential call contract: parameters, mode behavior, and return structure. It lacks only explicit guidance on edge cases like invalid symbols, repeated calls, and rate limits, but the output schema and full parameter coverage make the definition sufficient for correct invocation.

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 description coverage is 100%, so the baseline is 3. The description adds value by tying each mode to a concrete output shape and clarifying that period and interval are history-specific, which complements the schema's parameter descriptions rather than merely repeating them.

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 opens with a specific verb and resource: 'Fetch stock market data from Yahoo Finance and return it as a dict.' This clearly distinguishes the tool from crypto, weather, and search siblings. The mode-dependent return shapes add precision, making the tool's purpose unambiguous.

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

Usage Guidelines4/5

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

The description clearly communicates it is for stock market data from Yahoo Finance, which implies when to use it. However, it does not explicitly name alternatives or state 'use get_crypto for crypto' or 'do not use for non-stock assets', so it falls short of a full 5.

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