Skip to main content
Glama
Liquidiction

Liquidiction

get_market_summary

Retrieve a comprehensive overview of all prediction markets, including current probabilities, settlement statuses, and parsed metadata.

Instructions

Get a rich overview of all markets with probabilities, settlement status, and parsed metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The full handler for the 'get_market_summary' tool. It fetches outcome metadata and all mids from the Hyperliquid API, builds a rich JSON summary including each outcome's sides (with probabilities), settlement status, and parsed metadata fields (expiry, underlying, targetPrice, period) extracted from the description.
    server.tool(
      'get_market_summary',
      'Get a rich overview of all markets with probabilities, settlement status, and parsed metadata',
      {},
      async () => {
        const [meta, mids] = await Promise.all([
          hlInfo<OutcomeMeta>({ type: 'outcomeMeta' }),
          hlInfo<Record<string, string>>({ type: 'allMids' }),
        ]);
    
        const questionMap = new Map<number, QuestionRaw>();
        for (const q of meta.questions) questionMap.set(q.question, q);
    
        const summary = meta.outcomes.map(o => {
          const question = [...questionMap.values()].find(q => q.namedOutcomes.includes(o.outcome));
          const sides = o.sideSpecs.map((s, i) => {
            const coin = outcomeToCoin(o.outcome, i);
            const mid = mids[coin];
            return {
              label: s.name,
              coin,
              probability: mid ? `${(parseFloat(mid) * 100).toFixed(1)}%` : null,
            };
          });
    
          // Parse key fields from description
          const desc = o.description;
          const expiry = desc.match(/expiry:([^\s|]+)/)?.[1] ?? null;
          const underlying = desc.match(/underlying:([^\s|]+)/)?.[1] ?? null;
          const targetPrice = desc.match(/targetPrice:([^\s|]+)/)?.[1] ?? null;
          const period = desc.match(/period:([^\s|]+)/)?.[1] ?? null;
    
          const isSettled = question
            ? question.settledNamedOutcomes?.includes(o.outcome) ?? false
            : false;
    
          return {
            id: o.outcome,
            name: o.name,
            question: question?.name ?? null,
            sides,
            isSettled,
            expiry,
            underlying,
            targetPrice,
            period,
          };
        });
    
        return { content: [{ type: 'text', text: JSON.stringify(summary, null, 2) }] };
      },
    );
  • mcp-server.ts:335-386 (registration)
    The tool is registered on the McpServer instance via server.tool() at line 335, with the name 'get_market_summary' and a human-readable description.
    server.tool(
      'get_market_summary',
      'Get a rich overview of all markets with probabilities, settlement status, and parsed metadata',
      {},
      async () => {
        const [meta, mids] = await Promise.all([
          hlInfo<OutcomeMeta>({ type: 'outcomeMeta' }),
          hlInfo<Record<string, string>>({ type: 'allMids' }),
        ]);
    
        const questionMap = new Map<number, QuestionRaw>();
        for (const q of meta.questions) questionMap.set(q.question, q);
    
        const summary = meta.outcomes.map(o => {
          const question = [...questionMap.values()].find(q => q.namedOutcomes.includes(o.outcome));
          const sides = o.sideSpecs.map((s, i) => {
            const coin = outcomeToCoin(o.outcome, i);
            const mid = mids[coin];
            return {
              label: s.name,
              coin,
              probability: mid ? `${(parseFloat(mid) * 100).toFixed(1)}%` : null,
            };
          });
    
          // Parse key fields from description
          const desc = o.description;
          const expiry = desc.match(/expiry:([^\s|]+)/)?.[1] ?? null;
          const underlying = desc.match(/underlying:([^\s|]+)/)?.[1] ?? null;
          const targetPrice = desc.match(/targetPrice:([^\s|]+)/)?.[1] ?? null;
          const period = desc.match(/period:([^\s|]+)/)?.[1] ?? null;
    
          const isSettled = question
            ? question.settledNamedOutcomes?.includes(o.outcome) ?? false
            : false;
    
          return {
            id: o.outcome,
            name: o.name,
            question: question?.name ?? null,
            sides,
            isSettled,
            expiry,
            underlying,
            targetPrice,
            period,
          };
        });
    
        return { content: [{ type: 'text', text: JSON.stringify(summary, null, 2) }] };
      },
    );
  • Helper function used in the handler to convert an outcome ID and side index into a coin string (e.g., '#123') for looking up mid prices.
    function outcomeToCoin(outcomeId: number, side: number): string {
      return `#${10 * outcomeId + side}`;
    }
  • Type definitions (OutcomeRaw, QuestionRaw, OutcomeMeta) used by the get_market_summary handler to type the HL API response.
    interface OutcomeRaw {
      outcome: number;
      name: string;
      description: string;
      sideSpecs: { name: string }[];
    }
    interface QuestionRaw {
      question: number;
      name: string;
      description: string;
      fallbackOutcome: number;
      namedOutcomes: number[];
      settledNamedOutcomes: number[];
    }
    interface OutcomeMeta { outcomes: OutcomeRaw[]; questions: QuestionRaw[] }
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the output content (probabilities, settlement status, parsed metadata) but omits behavioral traits like data freshness, pagination, authentication, or side effects. It is adequate but not rich.

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?

Single sentence, front-loaded with action and resource. Every word adds value, no redundancy. Concise and well-structured.

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?

Given no parameters and no output schema, the description provides a basic sense of return content. However, it is vague on the structure (e.g., format of probabilities, how settlement status is represented) and lacks details like whether results are aggregated or per-market. Adequate but could be more complete.

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

Parameters4/5

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

The tool has no parameters (schema coverage 100%), so baseline is 4. The description does not need to add parameter information, and it correctly avoids mentioning nonexistent params. No improvement needed.

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 verb ('Get') and resource ('rich overview of all markets'), and specifies the content (probabilities, settlement status, parsed metadata). This distinguishes it from siblings like 'list_markets' (likely just names) and 'get_market_detail' (single market).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use when you need an overview of all markets, but provides no explicit guidance on when to use it vs. alternatives, nor any exclusions or prerequisites. For example, it doesn't mention when 'get_market_detail' would be more appropriate.

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/Liquidiction/liquidiction-mcp'

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