Skip to main content
Glama
Polymarket MCP Server

Polymarket MCP Server

by yashhsm

ws_get_orderbook

Fetch a live Polymarket orderbook snapshot over WebSocket by asset ID to view current bids and asks for market analysis.

Instructions

Get live orderbook snapshot for a Polymarket asset via WebSocket. Returns current bids and asks.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "assetId": "<assetId>"
    },
    "name": "ws_get_orderbook"
  }
}

Input Schema

NameRequiredDescriptionDefault
assetIdYesToken/asset ID to get orderbook for (required). Get this from market clobTokenIds field.
durationSecondsNoHow long to wait for orderbook snapshot in seconds (default: 3, max: 10)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full disclosure burden. It states that the tool returns a live snapshot with current bids and asks via WebSocket, but omits auth requirements, failure or timeout behavior, and whether a connection is retained; durationSeconds is documented only in the schema.

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?

Two sentences are front-loaded with the action and resource, with no filler. The return sentence earns its place by stating what the snapshot contains.

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 definition covers the essential what and rough return content for a two-parameter tool. However, with no output schema and no annotations, it should clarify snapshot-versus-subscription behavior and return shape more fully for a WebSocket data tool.

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?

Schema coverage is 100%; assetId and durationSeconds are fully documented in the schema, including the source hint for assetId and the default/max for durationSeconds. The description adds no parameter-specific meaning beyond that baseline.

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 states a specific verb ('Get'), resource ('live orderbook snapshot for a Polymarket asset'), and transport ('via WebSocket'), so the purpose is clear. It does not name or contrast with ws_subscribe_prices or ws_subscribe_trades, so sibling differentiation is only implied by the word 'snapshot'.

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

Usage Guidelines3/5

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

There is no explicit when-to-use guidance, no exclusions, and no mention of when a snapshot is preferable to a streaming subscription. The word 'snapshot' implies one-shot use, but an agent must infer this without a named alternative.

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