Skip to main content
Glama
yigitabi5444

Polymarket MCP Server

by yigitabi5444

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
NameRequiredDescriptionDefault
queryYesSearch query (e.g. 'election', 'bitcoin', 'AI')

Implementation Reference

  • 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,
        };
      }
    },
  • 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,
            };
          }
        },
      );
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yigitabi5444/yigit_polymarket_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server