Skip to main content
Glama
Liquidiction

Liquidiction

get_market_detail

Retrieve detailed information about a prediction market outcome by ID, including odds and liquidity.

Instructions

Get detailed info about a specific market outcome

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
outcome_idYesOutcome ID

Implementation Reference

  • The tool handler for 'get_market_detail'. It fetches outcome metadata and mid prices via hlInfo, looks up the outcome by outcome_id, finds its parent question, and formats a detailed description including sides with current mid prices (converted to percentage).
    server.tool(
      'get_market_detail',
      'Get detailed info about a specific market outcome',
      { outcome_id: z.number().describe('Outcome ID') },
      async ({ outcome_id }) => {
        const [meta, mids] = await Promise.all([
          hlInfo<OutcomeMeta>({ type: 'outcomeMeta' }),
          hlInfo<Record<string, string>>({ type: 'allMids' }),
        ]);
    
        const outcome = meta.outcomes.find(o => o.outcome === outcome_id);
        if (!outcome) {
          return { content: [{ type: 'text', text: `Outcome ${outcome_id} not found.` }] };
        }
    
        const question = meta.questions.find(q => q.namedOutcomes.includes(outcome_id));
    
        const lines: string[] = [];
        if (question) lines.push(`Question: ${question.name}`);
        lines.push(`Outcome: ${outcome.name}`);
        lines.push(`Description: ${outcome.description}`);
        lines.push(`Sides:`);
        for (let i = 0; i < outcome.sideSpecs.length; i++) {
          const coin = outcomeToCoin(outcome_id, i);
          const mid = mids[coin] ? (parseFloat(mids[coin]) * 100).toFixed(2) + '%' : 'N/A';
          lines.push(`  ${outcome.sideSpecs[i].name}: ${mid} (${coin})`);
        }
    
        return { content: [{ type: 'text', text: lines.join('\n') }] };
      },
    );
  • mcp-server.ts:249-279 (registration)
    The tool is registered using server.tool() with name 'get_market_detail' and the handler function, which is the standard MCP registration pattern in this file.
    server.tool(
      'get_market_detail',
      'Get detailed info about a specific market outcome',
      { outcome_id: z.number().describe('Outcome ID') },
      async ({ outcome_id }) => {
        const [meta, mids] = await Promise.all([
          hlInfo<OutcomeMeta>({ type: 'outcomeMeta' }),
          hlInfo<Record<string, string>>({ type: 'allMids' }),
        ]);
    
        const outcome = meta.outcomes.find(o => o.outcome === outcome_id);
        if (!outcome) {
          return { content: [{ type: 'text', text: `Outcome ${outcome_id} not found.` }] };
        }
    
        const question = meta.questions.find(q => q.namedOutcomes.includes(outcome_id));
    
        const lines: string[] = [];
        if (question) lines.push(`Question: ${question.name}`);
        lines.push(`Outcome: ${outcome.name}`);
        lines.push(`Description: ${outcome.description}`);
        lines.push(`Sides:`);
        for (let i = 0; i < outcome.sideSpecs.length; i++) {
          const coin = outcomeToCoin(outcome_id, i);
          const mid = mids[coin] ? (parseFloat(mids[coin]) * 100).toFixed(2) + '%' : 'N/A';
          lines.push(`  ${outcome.sideSpecs[i].name}: ${mid} (${coin})`);
        }
    
        return { content: [{ type: 'text', text: lines.join('\n') }] };
      },
    );
  • The input schema for the tool defines a single required parameter 'outcome_id' of type number.
    { outcome_id: z.number().describe('Outcome ID') },
  • Helper function outcomeToCoin converts an outcome ID and side index to a coin identifier (e.g., #900), used by the get_market_detail handler to look up mid prices.
    function outcomeToCoin(outcomeId: number, side: number): string {
      return `#${10 * outcomeId + side}`;
    }
  • The hlInfo helper function is a generic API caller used to fetch both outcome metadata and all mid prices, which are the two data sources used by the handler.
    async function hlInfo<T>(body: object): Promise<T> {
      const res = await fetch(`${API_URL}/info`, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(body),
      });
      if (!res.ok) throw new Error(`HL API error: ${res.status}`);
      return res.json() as Promise<T>;
    }
Behavior2/5

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

No annotations provided; only 'get detailed info' is stated. Lacks disclosure of what constitutes 'detail', error handling, or data latency. With zero annotation support, description should provide more behavioral context.

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?

Single sentence is efficient and direct. Could be slightly more informative but not verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, and description does not explain return format or structure of 'detailed info'. For a single-param tool, more detail about the response would improve completeness.

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?

Schema coverage is 100% for the single parameter. Description adds no extra meaning beyond the schema's existing 'Outcome ID' description. Baseline 3 applies.

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?

Description clearly states the verb (get), specific resource (market outcome), and scope (detailed info). Distinguishes from siblings like get_market_summary which likely provides aggregated data.

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?

No guidance on when to use this tool versus alternatives like get_market_summary or when not to use. Missing context for selection.

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