Skip to main content
Glama
TeleKashOracle

telekash-mcp-server

get_trending

Identify prediction markets with significant probability swings to detect momentum in trending events. Use to find actionable opportunities and volatile markets where consensus is rapidly changing.

Instructions

Get prediction markets with the biggest probability swings — momentum detection for trending events.

Finds markets where odds moved most in the last 1h, 24h, 7d, or 30d. Surfaces breaking events, sentiment shifts, and market-moving news. Use when looking for actionable opportunities, volatile markets, or events where consensus is rapidly changing. Returns markets ranked by absolute probability change with direction (up/down) and current odds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeframeNoLookback window for detecting swings (default: 24h)
limitNoMaximum markets to return (default: 10, max: 25)

Implementation Reference

  • The implementation of the get_trending tool, which fetches market probability history to calculate trending markets.
    async function getTrending(
      supabase: SupabaseClient,
      args: { timeframe?: string; limit?: number },
    ): Promise<ToolResult> {
      const { timeframe = "24h", limit = 10 } = args;
      const effectiveLimit = Math.min(Math.max(1, limit), 25);
      const timeframeMs: Record<string, number> = {
        "1h": 3600000,
        "24h": 86400000,
        "7d": 604800000,
        "30d": 2592000000,
      };
      const startTime = new Date(
        Date.now() - (timeframeMs[timeframe] || timeframeMs["24h"]),
      ).toISOString();
    
      const { data: historyData } = await supabase
        .from("telekash_probability_history")
        .select("market_id, probability, recorded_at")
        .gte("recorded_at", startTime)
        .order("recorded_at", { ascending: true });
    
      if (!historyData?.length) {
        // Fallback: recently updated markets
        const { data: recent } = await supabase
          .from("telekash_markets")
          .select("id, title, category, source, external_odds, updated_at")
          .eq("status", "active")
          .order("updated_at", { ascending: false })
          .limit(effectiveLimit);
    
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        return json({
          timeframe,
          trending: (recent || []).map((m: any) => ({
            market_id: m.id,
            title: m.title,
            category: m.category,
            source: m.source,
            current_probability: Math.round((m.external_odds?.yes || 0.5) * 100),
            last_updated: m.updated_at,
          })),
          total: (recent || []).length,
          _note: "Showing recently updated. Historical tracking building up.",
        });
      }
    
      // Group by market and compute swings with noise filter
      const snapshots: Record<string, number[]> = {};
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      for (const h of historyData as any[]) {
        if (!snapshots[h.market_id]) snapshots[h.market_id] = [];
        snapshots[h.market_id].push(h.probability);
      }
    
      const swings = Object.entries(snapshots)
        .map(([mid, probs]) => {
          const change = probs[probs.length - 1] - probs[0];
          let reversals = 0,
            sustained = 0;
          for (let i = 2; i < probs.length; i++) {
  • The registration/dispatch logic for the get_trending tool within the tool handler.
    case "get_trending":
      return getTrending(
        supabase,
        args as { timeframe?: string; limit?: number },
      );
  • The JSON schema definition for the get_trending tool, including input arguments.
    name: "get_trending",
    description: `Markets with biggest probability swings — momentum detection for trending events.`,
    inputSchema: {
      type: "object",
      properties: {
        timeframe: {
          type: "string",
          enum: ["1h", "24h", "7d", "30d"],
          description: "Lookback window (default: 24h)",
        },
        limit: {
          type: "number",
          description: "Max markets (default: 10, max: 25)",
        },
      },
      required: [],
    },
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it finds markets based on odds movement over specified timeframes, surfaces breaking events and sentiment shifts, and returns ranked markets with direction and current odds. However, it lacks details on rate limits, error handling, or authentication needs, which could be important for a tool accessing market data.

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 well-structured and concise, with three sentences that each serve a distinct purpose: stating the tool's purpose, detailing its functionality and use cases, and explaining the return format. There is no wasted text, and it is front-loaded with the core purpose.

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?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is mostly complete. It covers purpose, usage, and return values adequately. However, without annotations or an output schema, it could benefit from more details on behavioral aspects like error cases or data freshness, but it still provides sufficient context for effective use.

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?

The input schema has 100% description coverage, providing clear details for both parameters. The description adds minimal semantic context beyond the schema, mentioning 'Finds markets where odds moved most in the last 1h, 24h, 7d, or 30d,' which aligns with the 'timeframe' parameter but doesn't elaborate further. Since the schema is well-documented, a baseline score 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?

The description clearly states the tool's purpose: 'Get prediction markets with the biggest probability swings — momentum detection for trending events.' It specifies the verb ('Get'), resource ('prediction markets'), and scope ('biggest probability swings'), and distinguishes it from siblings like 'list_markets' or 'get_market_stats' by focusing on momentum detection rather than listing or general statistics.

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?

The description provides explicit guidance on when to use this tool: 'Use when looking for actionable opportunities, volatile markets, or events where consensus is rapidly changing.' It also implies alternatives by differentiating its purpose from siblings, such as using 'list_markets' for general listing or 'get_market_stats' for detailed statistics, without needing to name them directly.

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

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