get_hip4_outcomes
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
| Name | Required | Description | Default |
|---|---|---|---|
| is_settled | No | Filter by settlement status. Omit to return all outcomes. | |
| limit | No | Max records to return (default 100, max 1000) | |
| cursor | No | Pagination cursor from previous response's nextCursor |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| records | Yes | Array of result records | |
| count | Yes | Total number of records in the full result set | |
| nextCursor | No | Cursor for next page, if more results available |
Implementation Reference
- src/index.ts:1598-1606 (handler)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); } ); - src/index.ts:63-101 (schema)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"); - src/index.ts:88-96 (schema)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"); - src/index.ts:129-136 (schema)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"), };