TypeScriptADK-TS

MCP Limitless

An MCP server for interacting with Limitless prediction markets

  • Package: @iqai/mcp-limitless
  • Purpose: Interacting with the Limitless prediction markets for market data and analysis.

Usage with ADK TypeScript

import {McpLimitless} from "@iqai/adk";

const toolset = McpLimitless()

const tools = await toolset.getTools()
import {McpToolset} from "@iqai/adk";

const toolset = new McpToolset({
  name: "Limitless MCP Client",
  description: "Client for Limitless prediction markets",
  transport: {
    mode: "stdio",
    command: "pnpm",
    args: ["dlx", "@iqai/mcp-limitless"],
    env: {
      PATH: process.env.PATH || "",
    },
  },
})

const tools = await toolset.getTools()
{
  "mcpServers": {
    "limitless-mcp-server": {
      "command": "pnpm",
      "args": ["dlx", "@iqai/mcp-limitless"]
    }
  }
}

Available Tools

GET_AUTH_STATUS

No parameters

Description

Check the current authentication status for the Limitless API session. Returns whether you're logged in and your Ethereum address. Session persists automatically across all tool calls.

GET_SIGNING_MESSAGE
address:string

Description

Get a signing message with a randomly generated nonce for authentication purposes. Use this before logging in. Requires a wallet address.

VERIFY_AUTH

No parameters

Description

Verify if the user is authenticated by checking the session cookie. Returns the authenticated Ethereum address.

LOGIN
account:stringsigningMessage:stringsignature:stringuserData:object

Description

Authenticate a user with a signed message and create a session. First get a signing message, sign it with your wallet, then call this with the signature.

LOGOUT

No parameters

Description

Log out the user by clearing the session cookie. Requires authentication.

SEARCH_MARKETS
query:stringlimit:numberpage:numbersimilarityThreshold:number

Description

Search for prediction markets on Limitless based on semantic similarity. Returns markets matching the search query with details like volume, liquidity, and end dates.

GET_MARKET
addressOrSlug:string

Description

Get detailed information about a specific prediction market on Limitless. Provides market question, outcomes, prices, volume, liquidity, and other trading data.

GET_ACTIVE_MARKETS
categoryId:numberpage:numberlimit:numbersortBy:string

Description

Browse active (unresolved) prediction markets on Limitless. Returns markets with volume, liquidity, and other trading data. Supports filtering by category and sorting.

GET_ACTIVE_MARKETS_BY_CATEGORY
categoryId:numberpage:numberlimit:numbersortBy:string

Description

Browse active (unresolved) markets filtered by category ID with optional pagination and sorting.

GET_CATEGORIES

No parameters

Description

Get all available categories on Limitless with their IDs, names, priorities, and metadata. Use this to discover available categories for filtering markets.

GET_CATEGORIES_COUNT

No parameters

Description

Get the number of active markets for each category and the total market count.

GET_ACTIVE_SLUGS

No parameters

Description

Get slugs, strike prices, tickers, and deadlines for all active markets and groups. Useful for discovering available markets.

GET_MARKET_ORDERBOOK
slug:string

Description

Get the current orderbook for a prediction market on Limitless. Shows all open buy (bids) and sell (asks) orders with prices and sizes.

GET_HISTORICAL_PRICE
slug:stringfrom:stringto:stringinterval:string

Description

Retrieve historical price data for a specific market with configurable time intervals. Useful for analyzing price trends.

GET_FEED_EVENTS
slug:stringpage:numberlimit:number

Description

Get the latest feed events related to a specific market with pagination support.

GET_MARKET_EVENTS
slug:stringpage:numberlimit:number

Description

Get recent events for a specific market including trades, orders, and liquidity changes.

GET_LOCKED_BALANCE
slug:string

Description

Get the amount of funds locked in open orders for the authenticated user in a specific market. Requires authentication.

GET_USER_ORDERS
slug:string

Description

Get all orders placed by the authenticated user for a specific market. Requires authentication.

GET_PORTFOLIO_POSITIONS

No parameters

Description

Get your active portfolio positions on Limitless with P&L calculations and market values. Requires authentication via session token.

GET_PORTFOLIO_TRADES

No parameters

Description

Retrieve all trades executed by the authenticated user. Requires authentication.

GET_PORTFOLIO_HISTORY
page:numberlimit:numberfrom:stringto:string

Description

Get paginated history including AMM trades, CLOB trades, splits/merges, and NegRisk conversions. Requires authentication.

GET_PORTFOLIO_POINTS

No parameters

Description

Get points breakdown for the authenticated user. Requires authentication.

GET_USER_TRADED_VOLUME
account:string

Description

Get total traded volume and statistics for a specific user. This is a public endpoint that doesn't require authentication.

GET_PUBLIC_USER_POSITIONS
account:string

Description

Get all positions for a specific user address. This is a public endpoint that doesn't require authentication.

GET_USER_PROFILE
address:string

Description

Get detailed profile information for a user by their Ethereum address. Returns comprehensive user data including username, bio, profile picture, rank, points, leaderboard position, referral information, and account status. Requires authentication. Users can view their own profile when authenticated.

GET_TRADING_ALLOWANCE
type:string

Description

Check USDC allowance for CLOB or NegRisk trading contracts. Requires authentication.

CREATE_ORDER
order:objectownerId:numberorderType:stringmarketSlug:string

Description

Create a buy or sell order for prediction market positions on Limitless. Requires signed order data and authentication. Returns order details and match information if filled immediately.

CANCEL_ORDER
orderId:string

Description

Cancel an open order on Limitless and return locked funds. Requires authentication and order ownership.

CANCEL_ORDER_BATCH
orderIds:array

Description

Cancel multiple orders in a single batch operation on Limitless. All orders must be from the same market. Requires authentication and order ownership.

CANCEL_ALL_ORDERS
slug:string

Description

Cancel all of a user's open orders in a specific market on Limitless. Requires authentication.

Environment Variables

No required environment variables. This MCP server works out of the box.

Usage Examples

Here's a complete example of using MCP Limitless with an ADK agent:

import { McpLimitless, AgentBuilder } from "@iqai/adk";
import dotenv from "dotenv";

dotenv.config();

async function main() {
  // Initialize Limitless MCP toolset
  const toolset = McpLimitless({
    debug: false,
    retryOptions: {
      maxRetries: 3,
      initialDelay: 500,
    },
  });

  // Get available tools
  const limitlessTools = await toolset.getTools();

  // Create agent with Limitless tools
  const { runner } = await AgentBuilder.create("limitless_agent")
    .withModel("gemini-2.5-flash")
    .withDescription(
      "An agent that interacts with Limitless prediction markets",
    )
    .withTools(...limitlessTools)
    .build();

  try {
    // Example queries
    const response = await runner.ask(
      "Show me trending prediction markets on Limitless",
    );
    console.log(response);
  } finally {
    // Clean up resources
    await toolset.close();
  }
}

main().catch(console.error);

Best Practices

  • Resource Cleanup: Always call await toolset.close() when done to properly close connections
  • Error Handling: Implement proper error handling for market data requests
  • Rate Limits: Be aware of API rate limits and implement appropriate retry logic

Error Handling

Error Scenarios

The server handles various error scenarios gracefully.

🔄 Invalid market identifiers: Verify market IDs are correct 🌐 Network issues: Check your internet connection and API status

Resources