list_open_rfqs
Retrieve open request-for-quotes (RFQs) to view active market demand. Use to decide which RFQs to quote as a market-maker.
Instructions
List currently open (ACTIVE) RFQs awaiting market-maker quotes. Read-only.
USE WHEN: acting as a market-maker agent deciding what to quote on, or showing the user live demand. DO NOT USE WHEN: you want your own trade history (use list_my_trades).
Returns a page of RFQs (id, baseToken, quoteToken, side, amount, isBlind, status, expiresAt). To quote, call respond_rfq with the rfqId.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | 1-based page number. Default 1. | |
| pageSize | No | Page size, 1-100. Default 20. |
Implementation Reference
- src/index.ts:292-294 (handler)The handler function that executes the list_open_rfqs tool logic. It calls hl.listRFQs (from the HashLock SDK) with status='ACTIVE', passing optional page and pageSize parameters (defaulting to 1 and 20 respectively), and returns the result wrapped in okContent.
wrapTool(async ({ page, pageSize }) => okContent( await hl.listRFQs({ status: 'ACTIVE', page: page ?? 1, pageSize: pageSize ?? 20 }), )), - src/index.ts:288-290 (schema)Input schema for list_open_rfqs using Zod. Accepts optional 'page' (1-based, min 1) and 'pageSize' (1-100, default 20).
{ page: z.number().int().min(1).optional().describe('1-based page number. Default 1.'), pageSize: z.number().int().min(1).max(100).optional().describe('Page size, 1-100. Default 20.'), - src/index.ts:279-295 (registration)Registration of the 'list_open_rfqs' tool on the MCP server. The server.tool() call registers the tool name, description, Zod input schema, and handler function.
server.tool( 'list_open_rfqs', [ 'List currently open (ACTIVE) RFQs awaiting market-maker quotes. Read-only.', '', 'USE WHEN: acting as a market-maker agent deciding what to quote on, or showing the user live demand. DO NOT USE WHEN: you want your own trade history (use list_my_trades).', '', 'Returns a page of RFQs (id, baseToken, quoteToken, side, amount, isBlind, status, expiresAt). To quote, call respond_rfq with the rfqId.', ].join('\n'), { page: z.number().int().min(1).optional().describe('1-based page number. Default 1.'), pageSize: z.number().int().min(1).max(100).optional().describe('Page size, 1-100. Default 20.'), }, wrapTool(async ({ page, pageSize }) => okContent( await hl.listRFQs({ status: 'ACTIVE', page: page ?? 1, pageSize: pageSize ?? 20 }), )), ); - src/lib/errors.ts:85-95 (helper)The wrapTool helper that wraps the handler to catch errors and return structured error envelopes (machine-readable) instead of throwing.
export function wrapTool<A extends unknown[]>( handler: (...args: A) => Promise<ToolContent>, ): (...args: A) => Promise<ToolContent> { return async (...args: A) => { try { return await handler(...args); } catch (err) { return toErrorEnvelope(err); } }; }