diff --git a/apps/docs/content/docs/en/tools/kalshi.mdx b/apps/docs/content/docs/en/tools/kalshi.mdx index 0fb48c9e9b..7d976ceba7 100644 --- a/apps/docs/content/docs/en/tools/kalshi.mdx +++ b/apps/docs/content/docs/en/tools/kalshi.mdx @@ -52,8 +52,8 @@ Retrieve a list of prediction markets from Kalshi with optional filtering | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Markets data and metadata | +| `markets` | array | Array of market objects | +| `paging` | object | Pagination cursor for fetching more results | ### `kalshi_get_market` @@ -69,8 +69,7 @@ Retrieve details of a specific prediction market by ticker | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Market data and metadata | +| `market` | object | Market object with details | ### `kalshi_get_events` @@ -90,8 +89,8 @@ Retrieve a list of events from Kalshi with optional filtering | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Events data and metadata | +| `events` | array | Array of event objects | +| `paging` | object | Pagination cursor for fetching more results | ### `kalshi_get_event` @@ -108,8 +107,7 @@ Retrieve details of a specific event by ticker | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Event data and metadata | +| `event` | object | Event object with details | ### `kalshi_get_balance` @@ -126,8 +124,10 @@ Retrieve your account balance and portfolio value from Kalshi | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Balance data and metadata | +| `balance` | number | Account balance in cents | +| `portfolioValue` | number | Portfolio value in cents | +| `balanceDollars` | number | Account balance in dollars | +| `portfolioValueDollars` | number | Portfolio value in dollars | ### `kalshi_get_positions` @@ -149,8 +149,8 @@ Retrieve your open positions from Kalshi | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Positions data and metadata | +| `positions` | array | Array of position objects | +| `paging` | object | Pagination cursor for fetching more results | ### `kalshi_get_orders` @@ -172,8 +172,8 @@ Retrieve your orders from Kalshi with optional filtering | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Orders data and metadata | +| `orders` | array | Array of order objects | +| `paging` | object | Pagination cursor for fetching more results | ### `kalshi_get_order` @@ -191,8 +191,7 @@ Retrieve details of a specific order by ID from Kalshi | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Order data | +| `order` | object | Order object with details | ### `kalshi_get_orderbook` @@ -208,8 +207,7 @@ Retrieve the orderbook (yes and no bids) for a specific market | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Orderbook data and metadata | +| `orderbook` | object | Orderbook with yes/no bids and asks | ### `kalshi_get_trades` @@ -226,8 +224,8 @@ Retrieve recent trades across all markets | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Trades data and metadata | +| `trades` | array | Array of trade objects | +| `paging` | object | Pagination cursor for fetching more results | ### `kalshi_get_candlesticks` @@ -247,8 +245,7 @@ Retrieve OHLC candlestick data for a specific market | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Candlestick data and metadata | +| `candlesticks` | array | Array of OHLC candlestick data | ### `kalshi_get_fills` @@ -271,8 +268,8 @@ Retrieve your portfolio | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Fills data and metadata | +| `fills` | array | Array of fill/trade objects | +| `paging` | object | Pagination cursor for fetching more results | ### `kalshi_get_series_by_ticker` @@ -288,8 +285,7 @@ Retrieve details of a specific market series by ticker | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Series data and metadata | +| `series` | object | Series object with details | ### `kalshi_get_exchange_status` @@ -304,8 +300,7 @@ Retrieve the current status of the Kalshi exchange (trading and exchange activit | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Exchange status data and metadata | +| `status` | object | Exchange status with trading_active and exchange_active flags | ### `kalshi_create_order` @@ -339,8 +334,7 @@ Create a new order on a Kalshi prediction market | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Created order data | +| `order` | object | The created order object | ### `kalshi_cancel_order` @@ -358,8 +352,8 @@ Cancel an existing order on Kalshi | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Canceled order data | +| `order` | object | The canceled order object | +| `reducedBy` | number | Number of contracts canceled | ### `kalshi_amend_order` @@ -387,8 +381,7 @@ Modify the price or quantity of an existing order on Kalshi | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Amended order data | +| `order` | object | The amended order object | diff --git a/apps/docs/content/docs/en/tools/polymarket.mdx b/apps/docs/content/docs/en/tools/polymarket.mdx index ac7037e06e..feda033a9c 100644 --- a/apps/docs/content/docs/en/tools/polymarket.mdx +++ b/apps/docs/content/docs/en/tools/polymarket.mdx @@ -47,15 +47,14 @@ Retrieve a list of prediction markets from Polymarket with optional filtering | `order` | string | No | Sort field \(e.g., volumeNum, liquidityNum, startDate, endDate, createdAt\) | | `ascending` | string | No | Sort direction \(true for ascending, false for descending\) | | `tagId` | string | No | Filter by tag ID | -| `limit` | string | No | Number of results per page \(recommended: 25-50\) | +| `limit` | string | No | Number of results per page \(max 50\) | | `offset` | string | No | Pagination offset \(skip this many results\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Markets data and metadata | +| `markets` | array | Array of market objects | ### `polymarket_get_market` @@ -72,8 +71,7 @@ Retrieve details of a specific prediction market by ID or slug | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Market data and metadata | +| `market` | object | Market object with details | ### `polymarket_get_events` @@ -87,15 +85,14 @@ Retrieve a list of events from Polymarket with optional filtering | `order` | string | No | Sort field \(e.g., volume, liquidity, startDate, endDate, createdAt\) | | `ascending` | string | No | Sort direction \(true for ascending, false for descending\) | | `tagId` | string | No | Filter by tag ID | -| `limit` | string | No | Number of results per page \(recommended: 25-50\) | +| `limit` | string | No | Number of results per page \(max 50\) | | `offset` | string | No | Pagination offset \(skip this many results\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Events data and metadata | +| `events` | array | Array of event objects | ### `polymarket_get_event` @@ -112,8 +109,7 @@ Retrieve details of a specific event by ID or slug | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Event data and metadata | +| `event` | object | Event object with details | ### `polymarket_get_tags` @@ -123,15 +119,14 @@ Retrieve available tags for filtering markets from Polymarket | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | -| `limit` | string | No | Number of results per page \(recommended: 25-50\) | +| `limit` | string | No | Number of results per page \(max 50\) | | `offset` | string | No | Pagination offset \(skip this many results\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Tags data and metadata | +| `tags` | array | Array of tag objects with id, label, and slug | ### `polymarket_search` @@ -142,15 +137,14 @@ Search for markets, events, and profiles on Polymarket | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `query` | string | Yes | Search query term | -| `limit` | string | No | Number of results per page \(recommended: 25-50\) | -| `offset` | string | No | Pagination offset \(skip this many results\) | +| `limit` | string | No | Number of results per page \(max 50\) | +| `offset` | string | No | Pagination offset | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Search results and metadata | +| `results` | object | Search results containing markets, events, and profiles arrays | ### `polymarket_get_series` @@ -160,15 +154,14 @@ Retrieve series (related market groups) from Polymarket | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | -| `limit` | string | No | Number of results per page \(recommended: 25-50\) | +| `limit` | string | No | Number of results per page \(max 50\) | | `offset` | string | No | Pagination offset \(skip this many results\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Series data and metadata | +| `series` | array | Array of series objects | ### `polymarket_get_series_by_id` @@ -184,8 +177,7 @@ Retrieve a specific series (related market group) by ID from Polymarket | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Series data and metadata | +| `series` | object | Series object with details | ### `polymarket_get_orderbook` @@ -201,8 +193,7 @@ Retrieve the order book summary for a specific token | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Orderbook data and metadata | +| `orderbook` | object | Order book with bids and asks arrays | ### `polymarket_get_price` @@ -219,8 +210,7 @@ Retrieve the market price for a specific token and side | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Price data and metadata | +| `price` | string | Market price | ### `polymarket_get_midpoint` @@ -236,8 +226,7 @@ Retrieve the midpoint price for a specific token | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Midpoint price data and metadata | +| `midpoint` | string | Midpoint price | ### `polymarket_get_price_history` @@ -257,8 +246,7 @@ Retrieve historical price data for a specific market token | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Price history data and metadata | +| `history` | array | Array of price history entries with timestamp \(t\) and price \(p\) | ### `polymarket_get_last_trade_price` @@ -274,8 +262,7 @@ Retrieve the last trade price for a specific token | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Last trade price and metadata | +| `price` | string | Last trade price | ### `polymarket_get_spread` @@ -291,8 +278,7 @@ Retrieve the bid-ask spread for a specific token | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Spread data and metadata | +| `spread` | object | Bid-ask spread with bid and ask prices | ### `polymarket_get_tick_size` @@ -308,8 +294,7 @@ Retrieve the minimum tick size for a specific token | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Tick size and metadata | +| `tickSize` | string | Minimum tick size | ### `polymarket_get_positions` @@ -326,8 +311,7 @@ Retrieve user positions from Polymarket | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Positions data and metadata | +| `positions` | array | Array of position objects | ### `polymarket_get_trades` @@ -339,15 +323,14 @@ Retrieve trade history from Polymarket | --------- | ---- | -------- | ----------- | | `user` | string | No | User wallet address to filter trades | | `market` | string | No | Market ID to filter trades | -| `limit` | string | No | Number of results per page \(recommended: 25-50\) | +| `limit` | string | No | Number of results per page \(max 50\) | | `offset` | string | No | Pagination offset \(skip this many results\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Trades data and metadata | +| `trades` | array | Array of trade objects | diff --git a/apps/docs/content/docs/en/tools/sendgrid.mdx b/apps/docs/content/docs/en/tools/sendgrid.mdx index 6bff00fae3..a55b71077b 100644 --- a/apps/docs/content/docs/en/tools/sendgrid.mdx +++ b/apps/docs/content/docs/en/tools/sendgrid.mdx @@ -345,19 +345,30 @@ Delete an email template from SendGrid | Parameter | Type | Description | | --------- | ---- | ----------- | | `success` | boolean | Operation success status | +| `message` | string | Status or success message | | `messageId` | string | Email message ID \(send_mail\) | +| `to` | string | Recipient email address \(send_mail\) | +| `subject` | string | Email subject \(send_mail, create_template_version\) | | `id` | string | Resource ID | | `jobId` | string | Job ID for async operations | -| `email` | string | Email address | -| `firstName` | string | First name | -| `lastName` | string | Last name | +| `email` | string | Contact email address | +| `firstName` | string | Contact first name | +| `lastName` | string | Contact last name | +| `createdAt` | string | Creation timestamp | +| `updatedAt` | string | Last update timestamp | +| `listIds` | json | Array of list IDs the contact belongs to | +| `customFields` | json | Custom field values | | `contacts` | json | Array of contacts | | `contactCount` | number | Number of contacts | | `lists` | json | Array of lists | -| `templates` | json | Array of templates | -| `message` | string | Status or success message | | `name` | string | Resource name | +| `templates` | json | Array of templates | | `generation` | string | Template generation | +| `versions` | json | Array of template versions | +| `templateId` | string | Template ID | +| `active` | boolean | Whether template version is active | +| `htmlContent` | string | HTML content | +| `plainContent` | string | Plain text content | ### `sendgrid_create_template_version` diff --git a/apps/sim/blocks/blocks/kalshi.ts b/apps/sim/blocks/blocks/kalshi.ts index c4fd306b95..6438b32daa 100644 --- a/apps/sim/blocks/blocks/kalshi.ts +++ b/apps/sim/blocks/blocks/kalshi.ts @@ -583,7 +583,29 @@ export const KalshiBlock: BlockConfig = { status: { type: 'string', description: 'Filter by status' }, }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { type: 'json', description: 'Operation result data' }, + // List operations + markets: { type: 'json', description: 'Array of market objects (get_markets)' }, + events: { type: 'json', description: 'Array of event objects (get_events)' }, + orders: { type: 'json', description: 'Array of order objects (get_orders)' }, + positions: { type: 'json', description: 'Array of position objects (get_positions)' }, + fills: { type: 'json', description: 'Array of fill objects (get_fills)' }, + trades: { type: 'json', description: 'Array of trade objects (get_trades)' }, + candlesticks: { type: 'json', description: 'Array of candlestick data (get_candlesticks)' }, + // Single item operations + market: { type: 'json', description: 'Single market object (get_market)' }, + event: { type: 'json', description: 'Single event object (get_event)' }, + order: { + type: 'json', + description: 'Single order object (get_order, create_order, amend_order, cancel_order)', + }, + series: { type: 'json', description: 'Series object (get_series_by_ticker)' }, + // Account operations + balance: { type: 'number', description: 'Account balance in cents (get_balance)' }, + // Orderbook + orderbook: { type: 'json', description: 'Orderbook data with bids/asks (get_orderbook)' }, + // Exchange status + status: { type: 'json', description: 'Exchange status (get_exchange_status)' }, + // Pagination + paging: { type: 'json', description: 'Pagination cursor for fetching more results' }, }, } diff --git a/apps/sim/blocks/blocks/polymarket.ts b/apps/sim/blocks/blocks/polymarket.ts index 5ed9c4be12..0897e4f114 100644 --- a/apps/sim/blocks/blocks/polymarket.ts +++ b/apps/sim/blocks/blocks/polymarket.ts @@ -242,7 +242,7 @@ export const PolymarketBlock: BlockConfig = { id: 'limit', title: 'Limit', type: 'short-input', - placeholder: 'Number of results (recommended: 25-50)', + placeholder: 'Number of results (max 50)', condition: { field: 'operation', value: ['get_markets', 'get_events', 'get_tags', 'search', 'get_series', 'get_trades'], @@ -379,7 +379,30 @@ export const PolymarketBlock: BlockConfig = { endTs: { type: 'number', description: 'End timestamp (Unix)' }, }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { type: 'json', description: 'Operation result data' }, + // List operations + markets: { type: 'json', description: 'Array of market objects (get_markets)' }, + events: { type: 'json', description: 'Array of event objects (get_events)' }, + tags: { type: 'json', description: 'Array of tag objects (get_tags)' }, + series: { + type: 'json', + description: 'Array or single series object (get_series, get_series_by_id)', + }, + positions: { type: 'json', description: 'Array of position objects (get_positions)' }, + trades: { type: 'json', description: 'Array of trade objects (get_trades)' }, + // Single item operations + market: { type: 'json', description: 'Single market object (get_market)' }, + event: { type: 'json', description: 'Single event object (get_event)' }, + // Search + results: { + type: 'json', + description: 'Search results with markets, events, profiles (search)', + }, + // CLOB operations + orderbook: { type: 'json', description: 'Order book with bids and asks (get_orderbook)' }, + price: { type: 'string', description: 'Market price (get_price, get_last_trade_price)' }, + midpoint: { type: 'string', description: 'Midpoint price (get_midpoint)' }, + history: { type: 'json', description: 'Price history entries (get_price_history)' }, + spread: { type: 'json', description: 'Bid-ask spread (get_spread)' }, + tickSize: { type: 'string', description: 'Minimum tick size (get_tick_size)' }, }, } diff --git a/apps/sim/blocks/blocks/sendgrid.ts b/apps/sim/blocks/blocks/sendgrid.ts index 130ef13156..48cae2635d 100644 --- a/apps/sim/blocks/blocks/sendgrid.ts +++ b/apps/sim/blocks/blocks/sendgrid.ts @@ -460,19 +460,36 @@ export const SendGridBlock: BlockConfig = { }, outputs: { + // Common success: { type: 'boolean', description: 'Operation success status' }, + message: { type: 'string', description: 'Status or success message' }, + // Send mail outputs messageId: { type: 'string', description: 'Email message ID (send_mail)' }, + to: { type: 'string', description: 'Recipient email address (send_mail)' }, + subject: { type: 'string', description: 'Email subject (send_mail, create_template_version)' }, + // Contact outputs id: { type: 'string', description: 'Resource ID' }, jobId: { type: 'string', description: 'Job ID for async operations' }, - email: { type: 'string', description: 'Email address' }, - firstName: { type: 'string', description: 'First name' }, - lastName: { type: 'string', description: 'Last name' }, + email: { type: 'string', description: 'Contact email address' }, + firstName: { type: 'string', description: 'Contact first name' }, + lastName: { type: 'string', description: 'Contact last name' }, + createdAt: { type: 'string', description: 'Creation timestamp' }, + updatedAt: { type: 'string', description: 'Last update timestamp' }, + listIds: { type: 'json', description: 'Array of list IDs the contact belongs to' }, + customFields: { type: 'json', description: 'Custom field values' }, contacts: { type: 'json', description: 'Array of contacts' }, contactCount: { type: 'number', description: 'Number of contacts' }, + // List outputs lists: { type: 'json', description: 'Array of lists' }, - templates: { type: 'json', description: 'Array of templates' }, - message: { type: 'string', description: 'Status or success message' }, name: { type: 'string', description: 'Resource name' }, + // Template outputs + templates: { type: 'json', description: 'Array of templates' }, generation: { type: 'string', description: 'Template generation' }, + versions: { type: 'json', description: 'Array of template versions' }, + // Template version outputs + templateId: { type: 'string', description: 'Template ID' }, + active: { type: 'boolean', description: 'Whether template version is active' }, + htmlContent: { type: 'string', description: 'HTML content' }, + plainContent: { type: 'string', description: 'Plain text content' }, }, } diff --git a/apps/sim/blocks/blocks/wordpress.ts b/apps/sim/blocks/blocks/wordpress.ts index d96e388245..bc1471f693 100644 --- a/apps/sim/blocks/blocks/wordpress.ts +++ b/apps/sim/blocks/blocks/wordpress.ts @@ -945,6 +945,7 @@ export const WordPressBlock: BlockConfig = { categories: { type: 'json', description: 'List of categories' }, // Tag outputs tag: { type: 'json', description: 'Tag data' }, + tags: { type: 'json', description: 'List of tags' }, // User outputs user: { type: 'json', description: 'User data' }, users: { type: 'json', description: 'List of users' }, diff --git a/apps/sim/blocks/blocks/zoom.ts b/apps/sim/blocks/blocks/zoom.ts index 5436151418..5bbd2c46e9 100644 --- a/apps/sim/blocks/blocks/zoom.ts +++ b/apps/sim/blocks/blocks/zoom.ts @@ -540,33 +540,19 @@ export const ZoomBlock: BlockConfig = { deleteAction: { type: 'string', description: 'Delete action (trash or delete)' }, }, outputs: { + // Success indicator + success: { type: 'boolean', description: 'Operation success status' }, // Meeting outputs - meeting: { type: 'json', description: 'Meeting data' }, - meetings: { type: 'json', description: 'List of meetings' }, - // Specific meeting fields - id: { type: 'number', description: 'Meeting ID' }, - uuid: { type: 'string', description: 'Meeting UUID' }, - topic: { type: 'string', description: 'Meeting topic' }, - join_url: { type: 'string', description: 'Join URL for participants' }, - start_url: { type: 'string', description: 'Start URL for host' }, - start_time: { type: 'string', description: 'Start time' }, - duration: { type: 'number', description: 'Duration in minutes' }, - timezone: { type: 'string', description: 'Timezone' }, - password: { type: 'string', description: 'Meeting password' }, - agenda: { type: 'string', description: 'Meeting agenda' }, - settings: { type: 'json', description: 'Meeting settings' }, + meeting: { type: 'json', description: 'Meeting data (create_meeting, get_meeting)' }, + meetings: { type: 'json', description: 'List of meetings (list_meetings)' }, // Invitation - invitation: { type: 'string', description: 'Meeting invitation text' }, + invitation: { type: 'string', description: 'Meeting invitation text (get_meeting_invitation)' }, // Recording outputs - recording: { type: 'json', description: 'Recording data' }, - recordings: { type: 'json', description: 'List of recordings' }, - recording_files: { type: 'json', description: 'Recording files' }, - share_url: { type: 'string', description: 'Share URL for recording' }, + recording: { type: 'json', description: 'Recording data (get_meeting_recordings)' }, + recordings: { type: 'json', description: 'List of recordings (list_recordings)' }, // Participant outputs - participants: { type: 'json', description: 'List of participants' }, + participants: { type: 'json', description: 'List of participants (list_past_participants)' }, // Pagination pageInfo: { type: 'json', description: 'Pagination information' }, - // Success indicator - success: { type: 'boolean', description: 'Operation success status' }, }, } diff --git a/apps/sim/tools/kalshi/amend_order.ts b/apps/sim/tools/kalshi/amend_order.ts index ed823e5b0a..3d56fdebce 100644 --- a/apps/sim/tools/kalshi/amend_order.ts +++ b/apps/sim/tools/kalshi/amend_order.ts @@ -20,10 +20,6 @@ export interface KalshiAmendOrderResponse { success: boolean output: { order: KalshiOrder - metadata: { - operation: 'amend_order' - } - success: boolean } } @@ -140,24 +136,14 @@ export const kalshiAmendOrderTool: ToolConfig export interface KalshiGetExchangeStatusResponse { success: boolean output: { - exchangeStatus: KalshiExchangeStatus - metadata: { - operation: 'get_exchange_status' - } - success: boolean + status: KalshiExchangeStatus } } @@ -43,7 +39,7 @@ export const kalshiGetExchangeStatusTool: ToolConfig< handleKalshiError(data, response.status, 'get_exchange_status') } - const exchangeStatus = { + const status = { trading_active: data.trading_active ?? false, exchange_active: data.exchange_active ?? false, } @@ -51,25 +47,15 @@ export const kalshiGetExchangeStatusTool: ToolConfig< return { success: true, output: { - exchangeStatus, - metadata: { - operation: 'get_exchange_status' as const, - }, - success: true, + status, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { + status: { type: 'object', - description: 'Exchange status data and metadata', - properties: { - exchangeStatus: { type: 'object', description: 'Exchange status object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + description: 'Exchange status with trading_active and exchange_active flags', }, }, } diff --git a/apps/sim/tools/kalshi/get_fills.ts b/apps/sim/tools/kalshi/get_fills.ts index 456b54cdae..5579d7a12a 100644 --- a/apps/sim/tools/kalshi/get_fills.ts +++ b/apps/sim/tools/kalshi/get_fills.ts @@ -19,11 +19,6 @@ export interface KalshiGetFillsResponse { output: { fills: KalshiFill[] paging?: KalshiPagingInfo - metadata: { - operation: 'get_fills' - totalReturned: number - } - success: boolean } } @@ -115,26 +110,18 @@ export const kalshiGetFillsTool: ToolConfig ({ @@ -97,25 +93,14 @@ export const polymarketGetEventsTool: ToolConfig< success: true, output: { events, - metadata: { - operation: 'get_events' as const, - totalReturned: events.length, - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Events data and metadata', - properties: { - events: { type: 'array', description: 'Array of event objects' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + events: { + type: 'array', + description: 'Array of event objects', }, }, } diff --git a/apps/sim/tools/polymarket/get_last_trade_price.ts b/apps/sim/tools/polymarket/get_last_trade_price.ts index 451d9a03ef..cb12f81bb2 100644 --- a/apps/sim/tools/polymarket/get_last_trade_price.ts +++ b/apps/sim/tools/polymarket/get_last_trade_price.ts @@ -9,11 +9,6 @@ export interface PolymarketGetLastTradePriceResponse { success: boolean output: { price: string - metadata: { - operation: 'get_last_trade_price' - tokenId: string - } - success: boolean } } @@ -46,7 +41,7 @@ export const polymarketGetLastTradePriceTool: ToolConfig< }), }, - transformResponse: async (response: Response, params) => { + transformResponse: async (response: Response) => { const data = await response.json() if (!response.ok) { @@ -57,25 +52,14 @@ export const polymarketGetLastTradePriceTool: ToolConfig< success: true, output: { price: typeof data === 'string' ? data : data.price || '', - metadata: { - operation: 'get_last_trade_price' as const, - tokenId: params?.tokenId || '', - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Last trade price and metadata', - properties: { - price: { type: 'string', description: 'Last trade price' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + price: { + type: 'string', + description: 'Last trade price', }, }, } diff --git a/apps/sim/tools/polymarket/get_market.ts b/apps/sim/tools/polymarket/get_market.ts index 4d674e25ac..7b69d8ba80 100644 --- a/apps/sim/tools/polymarket/get_market.ts +++ b/apps/sim/tools/polymarket/get_market.ts @@ -11,10 +11,6 @@ export interface PolymarketGetMarketResponse { success: boolean output: { market: PolymarketMarket - metadata: { - operation: 'get_market' - } - success: boolean } } @@ -65,24 +61,14 @@ export const polymarketGetMarketTool: ToolConfig< success: true, output: { market: data, - metadata: { - operation: 'get_market' as const, - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { + market: { type: 'object', - description: 'Market data and metadata', - properties: { - market: { type: 'object', description: 'Market object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + description: 'Market object with details', }, }, } diff --git a/apps/sim/tools/polymarket/get_markets.ts b/apps/sim/tools/polymarket/get_markets.ts index 9539b90b7b..fa15e69553 100644 --- a/apps/sim/tools/polymarket/get_markets.ts +++ b/apps/sim/tools/polymarket/get_markets.ts @@ -13,11 +13,6 @@ export interface PolymarketGetMarketsResponse { success: boolean output: { markets: PolymarketMarket[] - metadata: { - operation: 'get_markets' - totalReturned: number - } - success: boolean } } @@ -54,7 +49,7 @@ export const polymarketGetMarketsTool: ToolConfig< limit: { type: 'string', required: false, - description: 'Number of results per page (recommended: 25-50)', + description: 'Number of results per page (max 50)', }, offset: { type: 'string', @@ -70,12 +65,13 @@ export const polymarketGetMarketsTool: ToolConfig< if (params.order) queryParams.append('order', params.order) if (params.ascending) queryParams.append('ascending', params.ascending) if (params.tagId) queryParams.append('tag_id', params.tagId) - if (params.limit) queryParams.append('limit', params.limit) + // Default limit to 50 to prevent browser crashes from large data sets + queryParams.append('limit', params.limit || '50') if (params.offset) queryParams.append('offset', params.offset) const query = queryParams.toString() const url = buildGammaUrl('/markets') - return query ? `${url}?${query}` : url + return `${url}?${query}` }, method: 'GET', headers: () => ({ @@ -97,25 +93,14 @@ export const polymarketGetMarketsTool: ToolConfig< success: true, output: { markets, - metadata: { - operation: 'get_markets' as const, - totalReturned: markets.length, - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Markets data and metadata', - properties: { - markets: { type: 'array', description: 'Array of market objects' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + markets: { + type: 'array', + description: 'Array of market objects', }, }, } diff --git a/apps/sim/tools/polymarket/get_midpoint.ts b/apps/sim/tools/polymarket/get_midpoint.ts index d39e6e85b5..85dd64408a 100644 --- a/apps/sim/tools/polymarket/get_midpoint.ts +++ b/apps/sim/tools/polymarket/get_midpoint.ts @@ -9,10 +9,6 @@ export interface PolymarketGetMidpointResponse { success: boolean output: { midpoint: string - metadata: { - operation: 'get_midpoint' - } - success: boolean } } @@ -56,24 +52,14 @@ export const polymarketGetMidpointTool: ToolConfig< success: true, output: { midpoint: data.mid || data.midpoint || data, - metadata: { - operation: 'get_midpoint' as const, - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Midpoint price data and metadata', - properties: { - midpoint: { type: 'string', description: 'Midpoint price' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + midpoint: { + type: 'string', + description: 'Midpoint price', }, }, } diff --git a/apps/sim/tools/polymarket/get_orderbook.ts b/apps/sim/tools/polymarket/get_orderbook.ts index 707c230fc6..890a5c01b9 100644 --- a/apps/sim/tools/polymarket/get_orderbook.ts +++ b/apps/sim/tools/polymarket/get_orderbook.ts @@ -10,10 +10,6 @@ export interface PolymarketGetOrderbookResponse { success: boolean output: { orderbook: PolymarketOrderBook - metadata: { - operation: 'get_orderbook' - } - success: boolean } } @@ -57,24 +53,14 @@ export const polymarketGetOrderbookTool: ToolConfig< success: true, output: { orderbook: data, - metadata: { - operation: 'get_orderbook' as const, - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { + orderbook: { type: 'object', - description: 'Orderbook data and metadata', - properties: { - orderbook: { type: 'object', description: 'Order book with bids and asks' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + description: 'Order book with bids and asks arrays', }, }, } diff --git a/apps/sim/tools/polymarket/get_positions.ts b/apps/sim/tools/polymarket/get_positions.ts index 1e4c17fcfb..3f164f6954 100644 --- a/apps/sim/tools/polymarket/get_positions.ts +++ b/apps/sim/tools/polymarket/get_positions.ts @@ -11,12 +11,6 @@ export interface PolymarketGetPositionsResponse { success: boolean output: { positions: PolymarketPosition[] - metadata: { - operation: 'get_positions' - user: string - totalReturned: number - } - success: boolean } } @@ -56,7 +50,7 @@ export const polymarketGetPositionsTool: ToolConfig< }), }, - transformResponse: async (response: Response, params) => { + transformResponse: async (response: Response) => { const data = await response.json() if (!response.ok) { @@ -70,26 +64,14 @@ export const polymarketGetPositionsTool: ToolConfig< success: true, output: { positions, - metadata: { - operation: 'get_positions' as const, - user: params?.user || '', - totalReturned: positions.length, - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Positions data and metadata', - properties: { - positions: { type: 'array', description: 'Array of position objects' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + positions: { + type: 'array', + description: 'Array of position objects', }, }, } diff --git a/apps/sim/tools/polymarket/get_price.ts b/apps/sim/tools/polymarket/get_price.ts index 3dbc37bfa9..c5c56924bc 100644 --- a/apps/sim/tools/polymarket/get_price.ts +++ b/apps/sim/tools/polymarket/get_price.ts @@ -10,11 +10,6 @@ export interface PolymarketGetPriceResponse { success: boolean output: { price: string - side: string - metadata: { - operation: 'get_price' - } - success: boolean } } @@ -64,26 +59,14 @@ export const polymarketGetPriceTool: ToolConfig< success: true, output: { price: data.price || data, - side: data.side || '', - metadata: { - operation: 'get_price' as const, - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Price data and metadata', - properties: { - price: { type: 'string', description: 'Market price' }, - side: { type: 'string', description: 'Order side' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + price: { + type: 'string', + description: 'Market price', }, }, } diff --git a/apps/sim/tools/polymarket/get_price_history.ts b/apps/sim/tools/polymarket/get_price_history.ts index a7fb4c4cba..f3c3783284 100644 --- a/apps/sim/tools/polymarket/get_price_history.ts +++ b/apps/sim/tools/polymarket/get_price_history.ts @@ -3,22 +3,17 @@ import type { PolymarketPriceHistoryEntry } from './types' import { buildClobUrl, handlePolymarketError } from './types' export interface PolymarketGetPriceHistoryParams { - tokenId: string // The token ID (CLOB token ID from market) - interval?: string // Duration: 1m, 1h, 6h, 1d, 1w, max (mutually exclusive with startTs/endTs) - fidelity?: number // Data resolution in minutes - startTs?: number // Start timestamp (Unix seconds UTC) - endTs?: number // End timestamp (Unix seconds UTC) + tokenId: string + interval?: string + fidelity?: number + startTs?: number + endTs?: number } export interface PolymarketGetPriceHistoryResponse { success: boolean output: { history: PolymarketPriceHistoryEntry[] - metadata: { - operation: 'get_price_history' - totalReturned: number - } - success: boolean } } @@ -65,9 +60,12 @@ export const polymarketGetPriceHistoryTool: ToolConfig< const queryParams = new URLSearchParams() queryParams.append('market', params.tokenId) if (params.interval) queryParams.append('interval', params.interval) - if (params.fidelity !== undefined) queryParams.append('fidelity', String(params.fidelity)) - if (params.startTs !== undefined) queryParams.append('startTs', String(params.startTs)) - if (params.endTs !== undefined) queryParams.append('endTs', String(params.endTs)) + if (params.fidelity != null && !Number.isNaN(params.fidelity)) + queryParams.append('fidelity', String(params.fidelity)) + if (params.startTs != null && !Number.isNaN(params.startTs)) + queryParams.append('startTs', String(params.startTs)) + if (params.endTs != null && !Number.isNaN(params.endTs)) + queryParams.append('endTs', String(params.endTs)) return `${buildClobUrl('/prices-history')}?${queryParams.toString()}` }, method: 'GET', @@ -83,32 +81,20 @@ export const polymarketGetPriceHistoryTool: ToolConfig< handlePolymarketError(data, response.status, 'get_price_history') } - // Response is typically { history: [...] } or just an array const history = data.history || (Array.isArray(data) ? data : []) return { success: true, output: { history, - metadata: { - operation: 'get_price_history' as const, - totalReturned: history.length, - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Price history data and metadata', - properties: { - history: { type: 'array', description: 'Array of price history entries' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + history: { + type: 'array', + description: 'Array of price history entries with timestamp (t) and price (p)', }, }, } diff --git a/apps/sim/tools/polymarket/get_series.ts b/apps/sim/tools/polymarket/get_series.ts index f1c9d61f9a..5a35a1285e 100644 --- a/apps/sim/tools/polymarket/get_series.ts +++ b/apps/sim/tools/polymarket/get_series.ts @@ -8,11 +8,6 @@ export interface PolymarketGetSeriesResponse { success: boolean output: { series: PolymarketSeries[] - metadata: { - operation: 'get_series' - totalReturned: number - } - success: boolean } } @@ -29,7 +24,7 @@ export const polymarketGetSeriesTool: ToolConfig< limit: { type: 'string', required: false, - description: 'Number of results per page (recommended: 25-50)', + description: 'Number of results per page (max 50)', }, offset: { type: 'string', @@ -41,12 +36,13 @@ export const polymarketGetSeriesTool: ToolConfig< request: { url: (params) => { const queryParams = new URLSearchParams() - if (params.limit) queryParams.append('limit', params.limit) + // Default limit to 50 to prevent browser crashes from large data sets + queryParams.append('limit', params.limit || '50') if (params.offset) queryParams.append('offset', params.offset) const query = queryParams.toString() const url = buildGammaUrl('/series') - return query ? `${url}?${query}` : url + return `${url}?${query}` }, method: 'GET', headers: () => ({ @@ -61,32 +57,44 @@ export const polymarketGetSeriesTool: ToolConfig< handlePolymarketError(data, response.status, 'get_series') } - // Response is an array of series - const series = Array.isArray(data) ? data : [] + // Response is an array of series - each series can contain thousands of nested events + // Strip the events array to prevent browser crashes (use get_events to fetch events separately) + const series = Array.isArray(data) + ? data.map((s: any) => ({ + id: s.id, + ticker: s.ticker, + slug: s.slug, + title: s.title, + seriesType: s.seriesType, + recurrence: s.recurrence, + image: s.image, + icon: s.icon, + active: s.active, + closed: s.closed, + archived: s.archived, + featured: s.featured, + restricted: s.restricted, + createdAt: s.createdAt, + updatedAt: s.updatedAt, + volume: s.volume, + liquidity: s.liquidity, + commentCount: s.commentCount, + eventCount: s.events?.length || 0, // Include count instead of full array + })) + : [] return { success: true, output: { series, - metadata: { - operation: 'get_series' as const, - totalReturned: series.length, - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Series data and metadata', - properties: { - series: { type: 'array', description: 'Array of series objects' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + series: { + type: 'array', + description: 'Array of series objects', }, }, } diff --git a/apps/sim/tools/polymarket/get_series_by_id.ts b/apps/sim/tools/polymarket/get_series_by_id.ts index 8a92585636..f57b3c8674 100644 --- a/apps/sim/tools/polymarket/get_series_by_id.ts +++ b/apps/sim/tools/polymarket/get_series_by_id.ts @@ -10,11 +10,6 @@ export interface PolymarketGetSeriesByIdResponse { success: boolean output: { series: PolymarketSeries - metadata: { - operation: 'get_series_by_id' - seriesId: string - } - success: boolean } } @@ -43,7 +38,7 @@ export const polymarketGetSeriesByIdTool: ToolConfig< }), }, - transformResponse: async (response: Response, params) => { + transformResponse: async (response: Response) => { const data = await response.json() if (!response.ok) { @@ -54,25 +49,14 @@ export const polymarketGetSeriesByIdTool: ToolConfig< success: true, output: { series: data, - metadata: { - operation: 'get_series_by_id' as const, - seriesId: params?.seriesId || '', - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { + series: { type: 'object', - description: 'Series data and metadata', - properties: { - series: { type: 'object', description: 'Series object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + description: 'Series object with details', }, }, } diff --git a/apps/sim/tools/polymarket/get_spread.ts b/apps/sim/tools/polymarket/get_spread.ts index 940925584b..707366893d 100644 --- a/apps/sim/tools/polymarket/get_spread.ts +++ b/apps/sim/tools/polymarket/get_spread.ts @@ -10,11 +10,6 @@ export interface PolymarketGetSpreadResponse { success: boolean output: { spread: PolymarketSpread - metadata: { - operation: 'get_spread' - tokenId: string - } - success: boolean } } @@ -47,7 +42,7 @@ export const polymarketGetSpreadTool: ToolConfig< }), }, - transformResponse: async (response: Response, params) => { + transformResponse: async (response: Response) => { const data = await response.json() if (!response.ok) { @@ -58,25 +53,14 @@ export const polymarketGetSpreadTool: ToolConfig< success: true, output: { spread: data, - metadata: { - operation: 'get_spread' as const, - tokenId: params?.tokenId || '', - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { + spread: { type: 'object', - description: 'Spread data and metadata', - properties: { - spread: { type: 'object', description: 'Bid-ask spread object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + description: 'Bid-ask spread with bid and ask prices', }, }, } diff --git a/apps/sim/tools/polymarket/get_tags.ts b/apps/sim/tools/polymarket/get_tags.ts index 93032e4b22..b0c5bcba32 100644 --- a/apps/sim/tools/polymarket/get_tags.ts +++ b/apps/sim/tools/polymarket/get_tags.ts @@ -8,11 +8,6 @@ export interface PolymarketGetTagsResponse { success: boolean output: { tags: PolymarketTag[] - metadata: { - operation: 'get_tags' - totalReturned: number - } - success: boolean } } @@ -27,7 +22,7 @@ export const polymarketGetTagsTool: ToolConfig { const queryParams = new URLSearchParams() - if (params.limit) queryParams.append('limit', params.limit) + // Default limit to 50 to prevent browser crashes from large data sets + queryParams.append('limit', params.limit || '50') if (params.offset) queryParams.append('offset', params.offset) const query = queryParams.toString() const url = buildGammaUrl('/tags') - return query ? `${url}?${query}` : url + return `${url}?${query}` }, method: 'GET', headers: () => ({ @@ -66,25 +62,14 @@ export const polymarketGetTagsTool: ToolConfig { + transformResponse: async (response: Response) => { const data = await response.json() if (!response.ok) { @@ -61,25 +56,14 @@ export const polymarketGetTickSizeTool: ToolConfig< success: true, output: { tickSize: String(tickSize), - metadata: { - operation: 'get_tick_size' as const, - tokenId: params?.tokenId || '', - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Tick size and metadata', - properties: { - tickSize: { type: 'string', description: 'Minimum tick size' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + tickSize: { + type: 'string', + description: 'Minimum tick size', }, }, } diff --git a/apps/sim/tools/polymarket/get_trades.ts b/apps/sim/tools/polymarket/get_trades.ts index 3eb371b04c..e1afe13355 100644 --- a/apps/sim/tools/polymarket/get_trades.ts +++ b/apps/sim/tools/polymarket/get_trades.ts @@ -11,11 +11,6 @@ export interface PolymarketGetTradesResponse { success: boolean output: { trades: PolymarketTrade[] - metadata: { - operation: 'get_trades' - totalReturned: number - } - success: boolean } } @@ -42,7 +37,7 @@ export const polymarketGetTradesTool: ToolConfig< limit: { type: 'string', required: false, - description: 'Number of results per page (recommended: 25-50)', + description: 'Number of results per page (max 50)', }, offset: { type: 'string', @@ -56,12 +51,13 @@ export const polymarketGetTradesTool: ToolConfig< const queryParams = new URLSearchParams() if (params.user) queryParams.append('user', params.user) if (params.market) queryParams.append('market', params.market) - if (params.limit) queryParams.append('limit', params.limit) + // Default limit to 50 to prevent browser crashes from large data sets + queryParams.append('limit', params.limit || '50') if (params.offset) queryParams.append('offset', params.offset) const query = queryParams.toString() const url = buildDataUrl('/trades') - return query ? `${url}?${query}` : url + return `${url}?${query}` }, method: 'GET', headers: () => ({ @@ -83,25 +79,14 @@ export const polymarketGetTradesTool: ToolConfig< success: true, output: { trades, - metadata: { - operation: 'get_trades' as const, - totalReturned: trades.length, - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Trades data and metadata', - properties: { - trades: { type: 'array', description: 'Array of trade objects' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + trades: { + type: 'array', + description: 'Array of trade objects', }, }, } diff --git a/apps/sim/tools/polymarket/search.ts b/apps/sim/tools/polymarket/search.ts index 99c32a604c..044b8ce4f9 100644 --- a/apps/sim/tools/polymarket/search.ts +++ b/apps/sim/tools/polymarket/search.ts @@ -10,11 +10,6 @@ export interface PolymarketSearchResponse { success: boolean output: { results: PolymarketSearchResult - metadata: { - operation: 'search' - query: string - } - success: boolean } } @@ -33,20 +28,21 @@ export const polymarketSearchTool: ToolConfig { const queryParams = new URLSearchParams() - queryParams.append('query', params.query) - if (params.limit) queryParams.append('limit', params.limit) + queryParams.append('q', params.query) + // Default limit to 50 to prevent browser crashes from large data sets + queryParams.append('limit', params.limit || '50') if (params.offset) queryParams.append('offset', params.offset) return `${buildGammaUrl('/public-search')}?${queryParams.toString()}` @@ -57,7 +53,7 @@ export const polymarketSearchTool: ToolConfig { + transformResponse: async (response: Response) => { const data = await response.json() if (!response.ok) { @@ -75,25 +71,14 @@ export const polymarketSearchTool: ToolConfig