Skip to main content
Glama
yigitabi5444

Polymarket MCP Server

by yigitabi5444

get_last_trade_price

Retrieve the most recent executed trade price for a Polymarket prediction market token to monitor real-time market activity and price movements.

Instructions

Get the last executed trade price for a Polymarket token.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_idYesCLOB token ID

Implementation Reference

  • The definition and handler implementation for the `get_last_trade_price` tool.
    server.tool(
      "get_last_trade_price",
      "Get the last executed trade price for a Polymarket token.",
      {
        token_id: z.string().describe("CLOB token ID"),
      },
      async (args) => {
        try {
          const data = await clob.getLastTradePrice(args.token_id);
          return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error: ${(error as Error).message}` }],
            isError: true,
          };
        }
      },
    );
  • The underlying API method that fetches the last trade price data from the server.
    async getLastTradePrice(tokenId: string): Promise<ClobLastTradePrice> {
      return this.client.clob<ClobLastTradePrice>("/last-trade-price", {
        token_id: tokenId,
      });
    }

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