Skip to main content
Glama

scrape_stock

Fetch stock market data from Yahoo Finance as structured dicts. Choose quote, historical price rows, or company profiles for any ticker symbol.

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. Dates show when Glama detected each change.

  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.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It thoroughly discloses return shapes for each mode, which is the primary behavioral aspect. It doesn't mention rate limits or error handling, but the read-only nature is implied by 'fetch' and the output specification is detailed.

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 well-structured and front-loaded with the main action. It efficiently uses a list format to convey return keys, and every sentence serves a purpose without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema exists and the description explicitly defines the return dict for all three modes, the description is comprehensive. Parameter schema is also thorough, so no critical gaps remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already has 100% coverage with detailed descriptions for each parameter. The description adds value by explaining how mode affects the output shape, but this is a logical inference rather than new parameter semantics. Baseline 3 is appropriate.

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 clearly states the verb 'fetch' and the resource 'stock market data from Yahoo Finance', and specifies the return type as a dict. It also distinguishes this tool from siblings like scrape_url and get_crypto by focusing on stocks from a specific source.

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 provides clear context: it is for fetching stock data from Yahoo Finance. It doesn't explicitly mention alternatives or when not to use it, but the domain is specific enough for an agent to infer appropriate use.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mldsveda/PyScrappy'

If you have feedback or need assistance with the MCP directory API, please join our Discord server