Skip to main content
Glama
TeleKashOracle

telekash-mcp-server

get_history

Retrieve historical probability changes and trend data for prediction markets to analyze shifts in odds, sentiment, and market consensus over time.

Instructions

Get historical probability changes and trend data for a prediction market over time.

Returns probability snapshots showing how odds, sentiment, and market consensus have shifted over 1h, 24h, 7d, or 30d. Use for trend analysis, momentum detection, volatility assessment, and understanding how predictions evolve. Essential for backtesting strategies, identifying probability swings, and spotting market-moving events.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idYesThe market UUID or external_id (ticker)
timeframeNoTime range for history (default: 24h)

Implementation Reference

  • The get_history tool handler, which queries the 'telekash_probability_history' table for historical probability and volume data for a given market.
    async function getHistory(
      supabase: SupabaseClient,
      args: { market_id: string; timeframe?: string },
    ): Promise<ToolResult> {
      const { market_id, timeframe = "24h" } = args;
      const market = await findMarket(supabase, market_id);
      if (!market) return err("Market not found");
    
      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("probability, volume, recorded_at")
        .eq("market_id", market.id)
        .gte("recorded_at", startTime)
        .order("recorded_at", { ascending: true });
    
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      const history = (historyData || []).map((h: any) => ({
        probability: Math.round(h.probability * 100),
        volume: h.volume || 0,
        timestamp: h.recorded_at,
      }));
    
      let trend = "stable";
      if (history.length >= 2) {
        const change =
          history[history.length - 1].probability - history[0].probability;
        trend = change > 1 ? "up" : change < -1 ? "down" : "stable";
      }
    
      return json({
        market_id: market.id,
        title: market.title,
        timeframe,
        data_points: history.length,
        trend,
        history,
        current: {
          yes_probability: Math.round((market.external_odds?.yes || 0.5) * 100),
          no_probability: Math.round((market.external_odds?.no || 0.5) * 100),
          volume: market.raw_data?.volume || 0,
          timestamp: market.updated_at,
        },
      });
    }
  • The registration of 'get_history' within the tool dispatcher in worker/src/tools.ts.
    case "get_history":
      return getHistory(
        supabase,
        args as { market_id: string; timeframe?: string },
      );
Behavior3/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 describes what the tool returns ('probability snapshots showing how odds, sentiment, and market consensus have shifted') and the timeframe options, but doesn't mention important behavioral aspects like rate limits, authentication requirements, error conditions, or pagination for potentially large datasets.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with three focused paragraphs: purpose, return values, and usage scenarios. Each sentence adds value, though the third paragraph could be slightly more concise by combining some of the use case examples.

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?

For a tool with 2 parameters, 100% schema coverage, but no annotations or output schema, the description provides adequate context about what the tool does and when to use it. However, it lacks details about the return format structure, error handling, and operational constraints that would be important for an agent to use this tool effectively.

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?

With 100% schema description coverage, the schema already documents both parameters thoroughly. The description adds marginal value by mentioning the timeframe options in context ('over 1h, 24h, 7d, or 30d') but doesn't provide additional semantic context beyond what's in the schema descriptions for market_id and timeframe.

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 with specific verbs ('Get historical probability changes and trend data') and resource ('for a prediction market over time'). It distinguishes from siblings like get_market_stats, get_probability, and get_sentiment by focusing on historical trends rather than current state or aggregated statistics.

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 provides clear usage context ('Use for trend analysis, momentum detection, volatility assessment...') and mentions specific applications like backtesting and identifying market-moving events. However, it doesn't explicitly state when NOT to use this tool or name specific alternatives among the sibling tools for different use cases.

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