Skip to main content
Glama
stockmarketscan

stockmarketscan/mcp-server

Official

get_stock_info

Read-onlyIdempotent

Retrieve basic stock metadata including company name, exchange, industry, last price, and percent change. Use to quickly identify a stock by its ticker symbol.

Instructions

Return basic metadata for a stock — full company name, exchange, industry, last close price, and percent change. Use this when you first encounter a symbol and need to identify it. Lighter than get_stock_report (composite) or get_candles (full history). Returns { symbol, symbol_name, last_price, percent_change, exchange, industry }. Returns NOT_FOUND for unknown tickers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock ticker, e.g. AAPL

Implementation Reference

  • The actual handler function for get_stock_info. It validates input via GetStockInfoInputSchema, uppercases the symbol, and fetches stock metadata from the API with 5-minute cache.
    export async function handleGetStockInfo(
      ctx: McpContext,
      rawArgs: unknown
    ): Promise<unknown> {
      const args = GetStockInfoInputSchema.parse(rawArgs);
      const sym = args.symbol.toUpperCase();
      const key = `stock:${sym}`;
      return ctx.cache.wrap(key, 300_000, () =>
        ctx.apiClient.get(`/stocks/${encodeURIComponent(sym)}`)
      );
    }
  • Zod input schema for get_stock_info — accepts a single 'symbol' field (string, 1-20 chars, uppercase/digits/punctuation).
    export const GetStockInfoInputSchema = z.object({
      symbol: z
        .string()
        .regex(symbolRegex, "Invalid symbol")
        .describe("Stock ticker, e.g. AAPL"),
    });
  • Maps the tool name 'get_stock_info' to the handler handleGetStockInfo in the HANDLERS registry.
    get_stock_info: (ctx, args) => handleGetStockInfo(ctx, args),
  • Tool definition object — registers name, description, inputSchema, and read-only annotations for get_stock_info.
    export const stockTools: Tool[] = [
      {
        name: "get_stock_info",
        description:
          "Return basic metadata for a stock — full company name, exchange, industry, last close price, and percent change. Use this when you first encounter a symbol and need to identify it. Lighter than get_stock_report (composite) or get_candles (full history). Returns { symbol, symbol_name, last_price, percent_change, exchange, industry }. Returns NOT_FOUND for unknown tickers.",
        inputSchema: z.toJSONSchema(GetStockInfoInputSchema) as Tool["inputSchema"],
        annotations: READ_ONLY_ANNOTATIONS,
      },
  • Spreads stockTools (which includes get_stock_info) into the ALL_TOOLS array that's listed via ListToolsRequestSchema.
    ...stockTools,
Behavior4/5

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

Annotations already cover safety (readOnlyHint, idempotentHint). Description adds value by specifying return format and the NOT_FOUND error case, but does not reveal other potential behaviors like rate limits.

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 sentences, front-loaded with purpose, then usage, then return format. No wasted words.

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?

For a single-parameter, read-only tool with rich annotations, the description covers purpose, usage, output fields, and error case. No additional information is necessary.

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 a clear parameter description. The tool description does not add further meaning beyond what the schema provides, so baseline of 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?

States clear verb 'Return basic metadata for a stock' and lists specific fields. Distinguishes from siblings by naming get_stock_report and get_candles with their differences.

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

Usage Guidelines5/5

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

Explicitly says 'Use this when you first encounter a symbol and need to identify it.' and compares weight against alternatives, providing clear guidance.

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/stockmarketscan/mcp-server'

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