Skip to main content
Glama
stockmarketscan

stockmarketscan/mcp-server

Official

get_trend_connections

Read-onlyIdempotent

Reveals AI-identified connections between trending topics across categories to surface meta-trends and cross-category signals.

Instructions

Return AI-computed connections between trending topics across categories (tech → patents, tech → funding, etc). Useful for spotting meta-trends. Use when the user asks 'what trends are connected' or 'show me cross-category signals'. Returns { count, connections: [{source_category, source_topic, target_category, target_topic, strength, rationale}] }. Tier: Pro only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNo
latestNo
dateNo

Implementation Reference

  • The `handleGetTrendConnections` function is the core handler for the get_trend_connections tool. It parses raw arguments using GetTrendConnectionsInputSchema, builds a cache key, and calls ctx.apiClient.get('/trend-connections') with the parameters (days, latest, date).
    export async function handleGetTrendConnections(
      ctx: McpContext,
      rawArgs: unknown
    ): Promise<unknown> {
      const args = GetTrendConnectionsInputSchema.parse(rawArgs);
      const days = args.days ?? 14;
      const key = `trend-connections:${days}:${args.latest ? "latest" : args.date || "range"}`;
      return ctx.cache.wrap(key, 1_800_000, () =>
        ctx.apiClient.get("/trend-connections", {
          days,
          latest: args.latest ? 1 : undefined,
          date: args.date,
        })
      );
    }
  • GetTrendConnectionsInputSchema defines the Zod schema for the tool's input: days (1-90, default 14), latest (boolean, default false), and date (optional string matching YYYY-MM-DD regex).
    export const GetTrendConnectionsInputSchema = z.object({
      days: z.number().int().min(1).max(90).default(14).optional(),
      latest: z.boolean().default(false).optional(),
      date: z.string().regex(dateRegex).optional(),
    });
  • The tool metadata (name: 'get_trend_connections', description, inputSchema, annotations) is defined as a Tool object in the trendsTools array, which is exported and included in the ALL_TOOLS registry.
      {
        name: "get_trend_connections",
        description:
          "Return AI-computed connections between trending topics across categories (tech → patents, tech → funding, etc). Useful for spotting meta-trends. Use when the user asks 'what trends are connected' or 'show me cross-category signals'. Returns { count, connections: [{source_category, source_topic, target_category, target_topic, strength, rationale}] }. Tier: Pro only.",
        inputSchema: z.toJSONSchema(GetTrendConnectionsInputSchema) as Tool["inputSchema"],
        annotations: READ_ONLY_ANNOTATIONS,
      },
    ];
  • The get_trend_connections tool name is mapped to its handler in the HANDLERS record, linking it to the handleGetTrendConnections function when called via server.
    get_trend_connections: (ctx, args) => handleGetTrendConnections(ctx, args),
  • The import of trendsTools, handleGetTrends, and handleGetTrendConnections from './trends' module, which connects the tool definition and handler to the registration system.
    import { trendsTools, handleGetTrends, handleGetTrendConnections } from "./trends";
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds the return format structure and a Pro tier restriction, which are valuable 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 concise sentences front-load purpose, then usage, then return format. No redundant information. Every sentence earns its place.

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?

The output structure is documented but parameters are completely missing. For a tool with 3 parameters and no output schema, the description is incomplete. It provides enough context for basic use but lacks parameter guidance.

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

Parameters1/5

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

Schema coverage is 0% and the description does not document any parameter (days, latest, date). Given the low coverage, the description must compensate but fails entirely, leaving agents to guess parameter meaning.

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 it returns AI-computed connections between trending topics across categories, with specific examples like tech→patents. This distinguishes it from sibling get_trends which likely returns trends alone.

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?

It provides explicit use cases: when user asks 'what trends are connected' or 'show me cross-category signals'. This is strong guidance, though it doesn't include when not to use or alternatives.

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