Skip to main content
Glama

get_hip4_outcomes

Read-onlyIdempotent

Retrieve aggregated HIP-4 outcome markets for both Yes and No sides, with optional filtering by settlement status.

Instructions

List HIP-4 outcome markets aggregated across both sides. Optionally filter by settlement status. Each outcome groups its '<10id>' Yes / '<10id+1>' No sides. Listen for the WebSocket outcome_settled event to get notified when an outcome resolves. The list response omits aggregated_oi; use get_hip4_outcome for the OI snapshot.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
is_settledNoFilter by settlement status. Omit to return all outcomes.
limitNoMax records to return (default 100, max 1000)
cursorNoPagination cursor from previous response's nextCursor

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
recordsYesArray of result records
countYesTotal number of records in the full result set
nextCursorNoCursor for next page, if more results available

Implementation Reference

  • The actual handler function for get_hip4_outcomes. It accepts optional is_settled (boolean filter), limit, and cursor params, builds a query object, calls hip4Request('/outcomes', q), and returns a cursor-formatted response.
      async (params) => {
        const q: Record<string, unknown> = {};
        if (params.is_settled !== undefined) q.is_settled = params.is_settled;
        if (params.limit) q.limit = resolveLimit(params.limit);
        if (params.cursor) q.cursor = params.cursor;
        const result = await hip4Request("/outcomes", q);
        return formatCursorResponse(result);
      }
    );
  • src/index.ts:1586-1606 (registration)
    The registration call for the get_hip4_outcomes tool. It registers the tool with the McpServer, providing description and inputSchema (is_settled, limit, cursor), outputSchema (ListOutputSchema).
    registerTool(
      "get_hip4_outcomes",
      "List HIP-4 outcome markets aggregated across both sides. Optionally filter by settlement status. Each outcome groups its '<10*id>' Yes / '<10*id+1>' No sides. Listen for the WebSocket `outcome_settled` event to get notified when an outcome resolves. The list response omits aggregated_oi; use get_hip4_outcome for the OI snapshot.",
      {
        is_settled: z
          .boolean()
          .optional()
          .describe("Filter by settlement status. Omit to return all outcomes."),
        limit: LimitParam,
        cursor: CursorParam,
      },
      ListOutputSchema,
      async (params) => {
        const q: Record<string, unknown> = {};
        if (params.is_settled !== undefined) q.is_settled = params.is_settled;
        if (params.limit) q.limit = resolveLimit(params.limit);
        if (params.cursor) q.cursor = params.cursor;
        const result = await hip4Request("/outcomes", q);
        return formatCursorResponse(result);
      }
    );
  • The Hip4CoinParam Zod schema — describes HIP-4 coin format but is used by other HIP-4 tools, not directly by get_hip4_outcomes. Included for context.
    const Hip4CoinParam = z
      .string()
      .describe(
        "HIP-4 outcome-market coin symbol. Canonical form is the bare numeric '<10*outcome_id + side>' (e.g. '0' for outcome 0 Yes, '1' for outcome 0 No, '10' for outcome 1 Yes). The legacy '#0' and '%230' forms are also accepted. Use get_hip4_instruments to list all."
      );
    
    const Hip4OutcomeIdParam = z
      .union([z.number(), z.string()])
      .describe("HIP-4 outcome_id (integer). Each outcome has two sides: '<10*id>' (Yes) and '<10*id+1>' (No).");
    
    const LighterCoinParam = z
      .string()
      .describe("Lighter.xyz coin symbol, e.g. 'BTC', 'ETH'");
    
    const SpotCoinParam = z
      .string()
      .describe(
        "Hyperliquid Spot dashed canonical pair symbol (e.g. 'HYPE-USDC', 'PURR-USDC'). 294 pairs available. The server resolves the dashed form to Hyperliquid's wire format ('PURR/USDC', '@107') internally. Use get_spot_pairs to list all."
      );
    
    const TimestampParam = z
      .union([z.number(), z.string()])
      .optional()
      .describe("Timestamp as Unix milliseconds or ISO 8601 string");
    
    const LimitParam = z
      .number()
      .optional()
      .describe("Max records to return (default 100, max 1000)");
    
    const CursorParam = z
      .string()
      .optional()
      .describe("Pagination cursor from previous response's nextCursor");
    
    const DepthParam = z
      .number()
      .optional()
      .describe("Orderbook depth — number of price levels per side");
  • LimitParam and CursorParam used in the input schema of get_hip4_outcomes.
    const LimitParam = z
      .number()
      .optional()
      .describe("Max records to return (default 100, max 1000)");
    
    const CursorParam = z
      .string()
      .optional()
      .describe("Pagination cursor from previous response's nextCursor");
  • ListOutputSchema defines the output shape for get_hip4_outcomes (records array, count, nextCursor).
    const ListOutputSchema: ZodRawShape = {
      records: z.array(z.record(z.unknown())).describe("Array of result records"),
      count: z.number().describe("Total number of records in the full result set"),
      nextCursor: z
        .string()
        .optional()
        .describe("Cursor for next page, if more results available"),
    };
Behavior4/5

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

Adds significant context beyond annotations: outcome grouping ('<10*id>' Yes / '<10*id+1>' No), WebSocket event notification, and omission of aggregated_oi. No contradictions with annotations.

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?

Three concise sentences with front-loaded purpose. No redundant phrases. Every sentence adds value.

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?

Covers key behavioral details (grouping, WebSocket, OI omission) and references sibling. With output schema present, return values are covered. Slight lack of pagination details, but overall complete.

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% with all parameters described. The description only reiterates the is_settled filter and implies pagination with cursor, adding minimal extra meaning.

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 explicitly states 'List HIP-4 outcome markets aggregated across both sides' with a clear verb and resource. It distinguishes from sibling get_hip4_outcome by noting this tool omits aggregated_oi.

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?

Provides clear context: optional filtering by settlement status, WebSocket event for updates, and direction to get_hip4_outcome for OI. However, no explicit when-not statements or comparisons to other siblings.

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/0xArchiveIO/0xarchive-mcp'

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