Skip to main content
Glama

nodus_get_signal

Analyze Polymarket or Kalshi prediction markets to get AI-powered Oracle signals with probability, confidence, and reasoning for informed trading decisions.

Instructions

Get an Oracle signal for a Polymarket or Kalshi prediction market. Requires a session token from nodusai.app ($1 USDC = 3 queries). Optionally pass a desiredOutcome (YES/NO) to focus the analysis. Returns probability, confidence, reasoning, and grounding sources.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
marketUrlYesFull URL of the Polymarket or Kalshi market
sessionTokenYesSession token from nodusai.app (pay $1 USDC to get one)
desiredOutcomeNo(Optional) Desired outcome to analyze e.g. YES or NO
walletAddressNo(Optional) Your wallet address for query history
agentNameNo(Optional) Name for your agent in the registry

Implementation Reference

  • The implementation of the `nodus_get_signal` tool, which validates input, calls the Oracle, logs the result, and returns the signal data.
    // ── 2. nodus_get_signal ────────────────────────────────────────────────────────
    export async function nodusGetSignal({ marketUrl, sessionToken, desiredOutcome, walletAddress, agentName }) {
      const urlCheck = validateMarketUrl(marketUrl);
      if (!urlCheck.valid) return err(urlCheck.reason);
    
      if (!sessionToken) {
        return err(
          "sessionToken is required.\n\n" +
          "To get a session token:\n" +
          "1. Visit https://nodusai.app\n" +
          "2. Connect your wallet\n" +
          "3. Paste the market URL and pay $1 USDC\n" +
          "4. Copy the session token and pass it here."
        );
      }
    
      const platform = detectPlatform(marketUrl);
    
      // Register agent if wallet provided
      const agent = walletAddress
        ? registerAgent({ name: agentName || "unnamed-agent", walletAddress })
        : { id: "anonymous", name: agentName || "anonymous" };
    
      // Call Oracle
      let signal, success, errorMessage, needsPayment = false;
      try {
        if (USE_MOCK) {
          signal  = mockOracleSignal(marketUrl, desiredOutcome);
          success = true;
        } else {
          const result = await fetchSignal(marketUrl, sessionToken, desiredOutcome);
          if (result.needsPayment) {
            return ok({
              _status:    402,
              message:    result.reason,
              paymentUrl: "https://nodusai.app",
              steps: [
                "1. Visit https://nodusai.app",
                "2. Connect your wallet",
                "3. Pay $1 USDC to get a new session token",
                "4. Call nodus_get_signal again with the new token",
              ],
            });
          }
          signal  = result.signal;
          success = result.success;
          if (!success) errorMessage = result.reason;
        }
      } catch (e) {
        success      = false;
        errorMessage = e.message;
      }
    
      if (success && signal) {
        const check = validateSignalSchema(signal);
        if (!check.valid) { success = false; errorMessage = check.reason; }
      }
    
      // Log to registry
      const entry = logQuery({
        agentId:      agent.id,
        agentName:    agent.name,
        marketUrl,
        platform,
        sessionToken,
        desiredOutcome: desiredOutcome || null,
        signal,
        success,
        errorMessage,
      });
    
      if (!success) return err(errorMessage || "Oracle query failed");
    
      return ok({
        queryId: entry.id,
        signal: {
          market_name:       signal.market_name,
          predicted_outcome: signal.predicted_outcome,
          probability:       signal.probability,
          confidence_score:  signal.confidence_score,
          key_reasoning:     signal.key_reasoning,
          grounding_sources: signal.grounding_sources,
        },
        meta: {
          platform,
          desiredOutcome: desiredOutcome || null,
          queryId:        entry.id,
          timestamp:      entry.timestamp,
        },
      });
    }

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/NodusAI-Your-Prediction-Broker/nodusai-mcp-server'

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