get_top_markets
Retrieve active Polymarket prediction markets by trading volume with current probability data. Filter by category to analyze specific market trends.
Instructions
Get the most active Polymarket markets by volume with current probabilities.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of markets to return (default: 10) | |
| category | No | Filter by category (politics, crypto, sports, economics, etc.) |
Implementation Reference
- src/index.ts:231-260 (handler)The execution logic for the get_top_markets tool, which fetches data from the LPXPoly API and formats it for the MCP response.
case "get_top_markets": { const { limit, category } = args as any; const result = await callLPXPoly("/api/markets", { limit: limit || 10, category, }); const markets = result.markets || result; if (!markets?.length) { return { content: [{ type: "text", text: "No markets found." }], }; } const formatted = markets .map( (m: any, i: number) => `${i + 1}. ${m.question}\n Probability: ${(m.probability * 100).toFixed(1)}% | Volume: $${(m.volume || 0).toLocaleString()}` ) .join("\n\n"); return { content: [ { type: "text", text: `📊 Top Polymarket Markets\n\n${formatted}\n\n⚡ Powered by LPXPoly | lpxpoly.com`, }, ], }; - src/index.ts:78-93 (registration)The registration of the get_top_markets tool, including its description and input schema.
{ name: "get_top_markets", description: "Get the most active Polymarket markets by volume with current probabilities.", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Number of markets to return (default: 10)", default: 10, }, category: { type: "string", description: "Filter by category (politics, crypto, sports, economics, etc.)", },