search
Find Polymarket prediction markets, events, and profiles by entering search terms like 'election', 'bitcoin', or 'AI'.
Instructions
Full-text search across Polymarket events, markets, and profiles. Use this to find markets on any topic.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (e.g. 'election', 'bitcoin', 'AI') |
Implementation Reference
- src/tools/gamma/search.ts:12-22 (handler)The handler function for the 'search' tool, which calls the Gamma API and formats the result.
async (args) => { try { const data = await gamma.search(args.query); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${(error as Error).message}` }], isError: true, }; } }, - src/tools/gamma/search.ts:5-24 (registration)Registration logic for the 'search' tool with the MCP server.
export function register(server: McpServer, gamma: GammaApi) { server.tool( "search", "Full-text search across Polymarket events, markets, and profiles. Use this to find markets on any topic.", { query: z.string().min(1).describe("Search query (e.g. 'election', 'bitcoin', 'AI')"), }, async (args) => { try { const data = await gamma.search(args.query); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${(error as Error).message}` }], isError: true, }; } }, ); }