Skip to main content
Glama

finance_stock_price

Retrieve current stock prices for any ticker symbol using a public API. Enter a symbol like AAPL or MSFT to get real-time market data.

Instructions

Get current stock price from public API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock ticker symbol (e.g. AAPL, MSFT, GOOGL)

Implementation Reference

  • The handler implementation for finance_stock_price tool, which fetches data from the Yahoo Finance API.
    server.tool("finance_stock_price", "Get current stock price from public API", {
      symbol: z.string().describe("Stock ticker symbol (e.g. AAPL, MSFT, GOOGL)")
    }, async ({ symbol }) => {
      try {
        const data = await safeFetch(`https://query1.finance.yahoo.com/v8/finance/chart/${symbol.toUpperCase()}?range=1d&interval=1m`);
        const meta = data.chart.result[0].meta;
        const change = ((meta.regularMarketPrice - meta.previousClose) / meta.previousClose) * 100;
        return { content: [{ type: "text", text: `**${symbol.toUpperCase()}**\nPrice: ${formatCurrency(meta.regularMarketPrice)}\nPrev Close: ${formatCurrency(meta.previousClose)}\nChange: ${formatPercent(change)}\nVolume: ${meta.regularMarketVolume?.toLocaleString() || "N/A"}\nExchange: ${meta.exchangeName}` }] };
      } catch {
        return { content: [{ type: "text", text: `Could not fetch ${symbol}. Try common tickers: AAPL, MSFT, GOOGL, AMZN, TSLA, NVDA` }] };
      }
    });
Behavior2/5

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

With no annotations provided, the description carries the full disclosure burden. It mentions 'public API' hinting at external dependencies, but fails to specify rate limits, data delay (real-time vs 15-min), caching behavior, or error handling for invalid symbols.

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?

Single sentence, front-loaded with action and target. No waste, though arguably too minimal given the lack of behavioral and usage context that would be helpful for agent selection.

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

Completeness3/5

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

Adequate for a simple single-parameter read operation, but lacks description of return values (price format, currency, timestamp) and behavioral constraints given the 'public API' dependency.

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?

Schema coverage is 100% with the symbol parameter fully documented (including examples). The description adds no additional parameter context, but baseline 3 is appropriate since the schema already comprehensively documents the single required parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear verb ('Get') and resource ('current stock price'). It implicitly distinguishes from crypto/forex siblings by specifying 'stock', but does not explicitly compare against sibling tools like crypto_price or stbtcx_price.

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

Usage Guidelines2/5

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

No guidance provided on when to use this versus sibling tools like crypto_price, finance_forex_rate, or stbtcx_price. No prerequisites or conditions mentioned.

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

Install Server

Other Tools

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/ElromEvedElElyon/claw-mcp-toolkit'

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