get_trend_connections
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
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | ||
| latest | No | ||
| date | No |
Implementation Reference
- src/tools/trends.ts:57-71 (handler)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, }) ); } - src/tools/trends.ts:19-23 (schema)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(), }); - src/tools/trends.ts:33-40 (registration)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, }, ]; - src/tools/index.ts:87-87 (registration)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), - src/tools/index.ts:38-38 (helper)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";