Skip to main content
Glama

Polymarket Arbitrage Opportunities

pm_arb_opportunities

Identify cross-market arbitrage opportunities on Polymarket by analyzing price spreads and implied probability mismatches to estimate profit.

Instructions

Get cross-market arbitrage opportunities on Polymarket. Shows price spreads between correlated markets, implied probability mismatches, and estimated profit. Cost: $0.01 per query. Source: Polymarket spread analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
min_spreadNoMinimum spread threshold (0-1, default 0.05)
market_idNoFilter by specific market ID
limitNoMaximum results (default 25)

Implementation Reference

  • The async handler function that executes the pm_arb_opportunities tool logic. It calls the API endpoint /api/v1/pm/arb/opportunities with parameters min_spread, market_id, and limit, then returns formatted results.
      async ({ min_spread, market_id, limit }) => {
        const res = await apiGet<PmArbQueryResponse>("/api/v1/pm/arb/opportunities", {
          min_spread: min_spread ?? 0.05,
          market_id,
          limit: limit ?? 25,
        });
    
        if (!res.ok) {
          return {
            content: [
              {
                type: "text" as const,
                text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
              },
            ],
            isError: true,
          };
        }
    
        const { count, data } = res.data;
        const warn = stalenessWarning(res);
        const summary = `${warn}Found ${count} arbitrage opportunity/opportunities.`;
        const json = JSON.stringify(data, null, 2);
    
        return {
          content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
        };
      },
    );
  • Input schema for pm_arb_opportunities using Zod validation: min_spread (0-1, optional), market_id (string, optional), limit (int 1-100, optional).
    inputSchema: {
      min_spread: z
        .number()
        .min(0)
        .max(1)
        .optional()
        .describe("Minimum spread threshold (0-1, default 0.05)"),
      market_id: z
        .string()
        .optional()
        .describe("Filter by specific market ID"),
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .optional()
        .describe("Maximum results (default 25)"),
    },
  • Registration of the tool via server.registerTool() with name 'pm_arb_opportunities', title, description, inputSchema, and the handler callback.
    server.registerTool(
      "pm_arb_opportunities",
      {
        title: "Polymarket Arbitrage Opportunities",
        description:
          "Get cross-market arbitrage opportunities on Polymarket. Shows price spreads " +
          "between correlated markets, implied probability mismatches, and estimated profit. " +
          "Cost: $0.01 per query. Source: Polymarket spread analysis.",
        inputSchema: {
          min_spread: z
            .number()
            .min(0)
            .max(1)
            .optional()
            .describe("Minimum spread threshold (0-1, default 0.05)"),
          market_id: z
            .string()
            .optional()
            .describe("Filter by specific market ID"),
          limit: z
            .number()
            .int()
            .min(1)
            .max(100)
            .optional()
            .describe("Maximum results (default 25)"),
        },
      },
      async ({ min_spread, market_id, limit }) => {
        const res = await apiGet<PmArbQueryResponse>("/api/v1/pm/arb/opportunities", {
          min_spread: min_spread ?? 0.05,
          market_id,
          limit: limit ?? 25,
        });
    
        if (!res.ok) {
          return {
            content: [
              {
                type: "text" as const,
                text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
              },
            ],
            isError: true,
          };
        }
    
        const { count, data } = res.data;
        const warn = stalenessWarning(res);
        const summary = `${warn}Found ${count} arbitrage opportunity/opportunities.`;
        const json = JSON.stringify(data, null, 2);
    
        return {
          content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
        };
      },
    );
  • src/index.ts:55-55 (registration)
    Where the registerPmArbTools function is called to register the tool on the MCP server.
    registerPmArbTools(server);
  • The PmArbQueryResponse interface used to type the API response for the handler.
    interface PmArbQueryResponse {
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses cost ($0.01 per query) and source, adding some behavioral context. However, it omits whether the tool is read-only, caching, rate limits, or error handling, which is necessary for safe invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences that are front-loaded with the main purpose. Every sentence adds value (action, output description, cost, source). No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is relatively simple with only optional params. However, without an output schema, the description should hint at the output structure (e.g., list of opportunities with fields). It mentions what it shows but not the format, leaving some incompleteness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema covers 100% of parameters with descriptions. The description adds no additional parameter semantics beyond what the schema provides, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool fetches cross-market arbitrage opportunities on Polymarket, specifying the resource and action. However, it does not explicitly differentiate this tool from siblings like pm_arb_changes or pm_arb_stats, preventing a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions cost and source but does not address use cases, prerequisites, or exclude scenarios, leaving the agent without clear decision criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/carrierone/verilexdata-mcp'

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