Skip to main content
Glama
PaulieB14

Limitless MCP

get_market_trades

Retrieve on-chain trade data for specific markets, including price, volume, and fee details for BUY/SELL transactions.

Instructions

Get trades for a specific market. Returns trade details with maker/taker, price, volume, and fees from on-chain data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conditionIdYesMarket conditionId
firstNoNumber of trades
tradeTypeNoFilter by trade type
orderDirectionNodesc

Implementation Reference

  • The implementation of the get_market_trades tool. It queries both simple and negrisk markets for trade data, combines the results, sorts them, and returns them along with market information.
    server.registerTool(
      "get_market_trades",
      {
        description:
          "Get trades for a specific market. Returns trade details with maker/taker, price, volume, and fees from on-chain data.",
        inputSchema: {
          conditionId: z.string().describe("Market conditionId"),
          first: z.number().default(20).describe("Number of trades"),
          tradeType: z
            .enum(["BUY", "SELL"])
            .optional()
            .describe("Filter by trade type"),
          orderDirection: z.enum(["asc", "desc"]).default("desc"),
        },
      },
      async ({ conditionId, first, tradeType, orderDirection }) => {
        try {
          const typeFilter = tradeType ? `, type: "${tradeType}"` : "";
          const tradesQuery = `{
            trades(
              where: { market: "${conditionId}"${typeFilter} }
              first: ${first}
              orderBy: timestamp
              orderDirection: ${orderDirection}
            ) {
              id type maker taker
              makerAmountFilled takerAmountFilled
              amountUSD fee feeUSD price
              venue timestamp blockNumber txHash
            }
          }`;
    
          const [simpleData, negriskData, name] = await Promise.all([
            querySimple(tradesQuery).catch(() => ({ trades: [] })),
            queryNegRisk(tradesQuery).catch(() => ({ trades: [] })),
            getMarketName(conditionId),
          ]);
    
          const simpleTrades = (simpleData.trades || []).map((t: any) => ({
            ...t,
            marketType: "simple",
          }));
          const negriskTrades = (negriskData.trades || []).map((t: any) => ({
            ...t,
            marketType: "negrisk",
          }));
    
          const allTrades = [...simpleTrades, ...negriskTrades]
            .sort((a, b) =>
              orderDirection === "desc"
                ? Number(b.timestamp) - Number(a.timestamp)
                : Number(a.timestamp) - Number(b.timestamp)
            )
            .slice(0, first);
    
          return textResult({ market: name, conditionId, trades: allTrades });
        } catch (e) {
          return errorResult(e);
        }
      }
    );
Behavior3/5

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

Provides useful context that data comes from 'on-chain' and lists specific return fields (maker/taker, price, volume, fees). However, with no annotations provided, the description carries full burden and omits operational details like data latency, pagination behavior beyond the 'first' parameter, or rate limiting.

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 efficient sentences with zero waste. Front-loaded action ('Get trades') followed by behavioral disclosure. Every word earns its place.

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?

Adequate for a read-only query tool with moderate complexity, covering core purpose and data provenance. However, gaps remain: no usage differentiation from similar trade-fetching siblings, and the orderDirection parameter is undocumented in both schema and description.

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 75% (orderDirection lacks description). The description mentions 'specific market' which maps to conditionId, but adds minimal semantic detail beyond what the schema already provides for the documented parameters. Baseline score appropriate for high schema coverage.

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?

Clear verb-resource-scope: 'Get trades for a specific market.' The 'specific market' qualifier helps distinguish from sibling tools like get_trader_trades and get_recent_activity, though it doesn't explicitly contrast with them. The second sentence clarifies return payload contents.

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?

No explicit guidance on when to use this tool versus siblings like get_trader_trades (trades filtered by trader) or get_recent_activity (global activity feed). Missing prerequisites or conditions around the conditionId parameter.

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/PaulieB14/limitless-subgraphs'

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