Skip to main content
Glama
stockmarketscan

stockmarketscan/mcp-server

Official

get_market_momentum

Read-onlyIdempotent

Retrieve NYSE and NASDAQ market breadth data including advancing/declining issues, new highs/lows, and percent advancing for a given date or range. Assess whether market breadth is strong.

Instructions

Return NYSE and NASDAQ market breadth data — advancing/declining issues, new highs/lows, percent advancing. Use when the user asks 'how's the market today' or 'is breadth strong'. Default (no params): last 7 trading days. Returns { dates, count, data: [{exchange, advancing_issues, declining_issues, new_highs, new_lows, percent_advancing_issues, data_date}] }. Two rows per date (NYSE + NASDAQ). Tier: Basic+.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoSingle day (YYYY-MM-DD)
date_fromNoRange start
date_toNoRange end

Implementation Reference

  • The handler function that executes the get_market_momentum tool logic. Parses input with Zod schema, creates a cache key, and delegates to ctx.apiClient.get('/market-momentum') with optional date params.
    export async function handleGetMarketMomentum(
      ctx: McpContext,
      rawArgs: unknown
    ): Promise<unknown> {
      const args = GetMarketMomentumInputSchema.parse(rawArgs);
      const key = `market-momentum:${args.date || ""}:${args.date_from || ""}:${args.date_to || ""}`;
      return ctx.cache.wrap(key, 300_000, () =>
        ctx.apiClient.get("/market-momentum", {
          date: args.date,
          date_from: args.date_from,
          date_to: args.date_to,
        })
      );
    }
  • Zod input schema for get_market_momentum tool: optional date, date_from, date_to fields all validated as YYYY-MM-DD format strings.
    export const GetMarketMomentumInputSchema = z.object({
      date: z.string().regex(dateRegex).optional().describe("Single day (YYYY-MM-DD)"),
      date_from: z.string().regex(dateRegex).optional().describe("Range start"),
      date_to: z.string().regex(dateRegex).optional().describe("Range end"),
    });
  • Tool definition object with name='get_market_momentum', description, inputSchema, and annotations. Exported as part of marketMomentumTools array.
    export const marketMomentumTools: Tool[] = [
      {
        name: "get_market_momentum",
        description:
          "Return NYSE and NASDAQ market breadth data — advancing/declining issues, new highs/lows, percent advancing. Use when the user asks 'how's the market today' or 'is breadth strong'. Default (no params): last 7 trading days. Returns { dates, count, data: [{exchange, advancing_issues, declining_issues, new_highs, new_lows, percent_advancing_issues, data_date}] }. Two rows per date (NYSE + NASDAQ). Tier: Basic+.",
        inputSchema: z.toJSONSchema(GetMarketMomentumInputSchema) as Tool["inputSchema"],
        annotations: READ_ONLY_ANNOTATIONS,
      },
  • The tool is registered in the ALL_TOOLS array (line 58) and its handler is mapped in the HANDLERS record (line 85). registerAllTools() registers all tools with the MCP server via ListToolsRequestSchema and CallToolRequestSchema.
    const ALL_TOOLS: Tool[] = [
      PING_TOOL,
      ...screenersTools,
      ...patternsTools,
      ...optionsFlowTools,
      ...stockTools,
      ...compositeTools,
      ...marketMomentumTools,
      ...trendsTools,
      ...educationTools,
    ];
  • McpContext interface providing apiClient (used to make the HTTP request) and cache (used to wrap/responses with a 300s TTL).
    export interface McpContext {
      apiClient: ApiClient;
      cache: TtlCache;
    }
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds beyond this by detailing the return structure, that two rows per date are returned (NYSE+NASDAQ), and the tier info. It aligns with annotations and provides useful behavioral context.

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 concise: two sentences plus a structured return note. It front-loads the purpose, then provides usage context, and finally enumerates the return format. Every sentence adds value 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 tool has no output schema, the description fully describes the return structure and default behavior. It is complete for a filtered-list tool with clear annotations.

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 description coverage is 100% (all three parameters have descriptions). The description adds the default behavior when no params are given, but does not add significant meaning beyond the schema. 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 tool returns NYSE and NASDAQ market breadth data with specific fields (advancing/declining issues, new highs/lows, percent advancing). The verb 'return' and resource 'market breadth data' are specific and distinguish it from sibling tools like get_candles or get_stock_info.

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 explicitly gives example user queries ('how's the market today', 'is breadth strong') to signal when to use the tool. It also mentions the default behavior (last 7 trading days), but does not specify when not to use it or offer alternative tools.

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