Skip to main content
Glama
stockmarketscan

stockmarketscan/mcp-server

Official

get_options_flow_timeline

Read-onlyIdempotent

Retrieve historical options flow for a stock, sorted newest first. Use to check how long a stock has been bullish or view its options flow timeline.

Instructions

Return the historical options flow for a single stock — most recent days first. Use when the user asks 'show me X's options flow history' or 'how long has X been bullish'. Returns { symbol, limit, count, data: [daily rows, newest first] }. Tier: Pro only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock ticker
limitNoDays of history (max 365)

Implementation Reference

  • The main handler function for get_options_flow_timeline. Parses input (symbol + optional limit), uppercase the ticker, and calls the API endpoint /options-flow/{symbol} with a 5-minute cache.
    export async function handleGetOptionsFlowTimeline(
      ctx: McpContext,
      rawArgs: unknown
    ): Promise<unknown> {
      const args = GetOptionsFlowTimelineInputSchema.parse(rawArgs);
      const sym = args.symbol.toUpperCase();
      const limit = args.limit ?? 60;
      const key = `options-flow:timeline:${sym}:${limit}`;
      return ctx.cache.wrap(key, 300_000, () =>
        ctx.apiClient.get(`/options-flow/${encodeURIComponent(sym)}`, { limit })
      );
    }
  • Zod schema defining input validation: 'symbol' (required, uppercase regex) and 'limit' (optional, 1-365, default 60).
    export const GetOptionsFlowTimelineInputSchema = z.object({
      symbol: z.string().regex(symbolRegex).describe("Stock ticker"),
      limit: z.number().int().min(1).max(365).default(60).optional().describe("Days of history (max 365)"),
    });
  • Tool definition with name, description, input schema (converted from Zod to JSON schema), and read-only annotations.
    {
      name: "get_options_flow_timeline",
      description:
        "Return the historical options flow for a single stock — most recent days first. Use when the user asks 'show me X's options flow history' or 'how long has X been bullish'. Returns { symbol, limit, count, data: [daily rows, newest first] }. Tier: Pro only.",
      inputSchema: z.toJSONSchema(GetOptionsFlowTimelineInputSchema) as Tool["inputSchema"],
      annotations: READ_ONLY_ANNOTATIONS,
    },
  • Handler wire-up in the HANDLERS record, mapping the tool name string to the imported handler function.
    get_options_flow_timeline: (ctx, args) => handleGetOptionsFlowTimeline(ctx, args),
  • The get_options_flow_timeline tool is included in the global tool registry via the optionsFlowTools spread into ALL_TOOLS, which is served by the ListToolsRequestSchema handler.
    const ALL_TOOLS: Tool[] = [
      PING_TOOL,
      ...screenersTools,
      ...patternsTools,
      ...optionsFlowTools,
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. Description adds return order ('newest first') and structure, which are beneficial beyond annotations.

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: purpose, usage examples, and tier/return format. Front-loaded and efficient, every sentence adds value.

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?

For a simple tool with two parameters and no output schema, the description is near complete, covering purpose, return structure, and usage. Missing details like pagination or error handling, but adequate for selection.

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 has 100% description coverage. Description adds 'Days of history (max 365)' which matches schema, and 'most recent days first' for ordering. Does not add significant new meaning beyond schema.

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 verb 'return', resource 'historical options flow', and scope 'single stock'. Distinguishes from siblings like get_options_flow_overview by specifying 'historical timeline' and 'most recent days first'.

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?

Explicit usage examples: 'show me X's options flow history' and 'how long has X been bullish'. Also notes 'Tier: Pro only' as prerequisite, providing clear guidance on when to use.

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