Skip to main content
Glama
PaulieB14

Limitless MCP

get_trader_trades

Retrieve a trader's recent trades across markets with enriched market names, filtering by trade role and wallet address.

Instructions

Get a trader's recent trades across both market types, enriched with market names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesTrader wallet address
firstNo
roleNoFilter by role in tradeboth

Implementation Reference

  • The handler function for 'get_trader_trades' that queries both 'simple' and 'negrisk' markets, hydrates market names, and returns enriched trade data.
    async ({ address, first, role }) => {
      try {
        const addr = address.toLowerCase();
        let where = "";
        if (role === "maker") where = `maker: "${addr}"`;
        else if (role === "taker") where = `taker: "${addr}"`;
        else where = `or: [{maker: "${addr}"}, {taker: "${addr}"}]`;
    
        const tradesQuery = `{
          trades(first: ${first}, orderBy: timestamp, orderDirection: desc, where: { ${where} }) {
            id market { id } type maker taker amountUSD feeUSD price venue timestamp txHash
          }
        }`;
    
        const negriskTradesQuery = tradesQuery.replace("market { id }", "market { id }");
    
        const { simple, negrisk } = await queryBoth(tradesQuery, negriskTradesQuery);
    
        const allTrades = [
          ...(simple.trades || []).map((t: any) => ({ ...t, marketType: "simple" })),
          ...(negrisk.trades || []).map((t: any) => ({ ...t, marketType: "negrisk" })),
        ]
          .sort((a, b) => Number(b.timestamp) - Number(a.timestamp))
          .slice(0, first);
    
        // Hydrate market names
        const conditionIds = [...new Set(allTrades.map((t: any) => t.market?.id).filter(Boolean))];
        const names = new Map<string, string>();
        await Promise.all(
          conditionIds.map(async (id: string) => {
            names.set(id, await hydrateName(id));
          })
        );
    
        const enriched = allTrades.map((t: any) => ({
          ...t,
          marketName: names.get(t.market?.id) || t.market?.id || "unknown",
        }));
    
        return textResult({ address: addr, trades: enriched });
  • Tool registration for 'get_trader_trades' including input schema definition.
    server.registerTool(
      "get_trader_trades",
      {
        description:
          "Get a trader's recent trades across both market types, enriched with market names.",
        inputSchema: {
          address: z.string().describe("Trader wallet address"),
          first: z.number().default(20),
          role: z
            .enum(["maker", "taker", "both"])
            .default("both")
            .describe("Filter by role in trade"),
        },
      },
Behavior3/5

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

With no annotations provided, the description carries full disclosure burden. It successfully notes the 'enriched with market names' output characteristic and 'across both market types' scope, but fails to specify the time window for 'recent', pagination mechanics (cursor vs offset), or behavior when no trades exist.

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?

Single, well-structured sentence that front-loads the action ('Get a trader's recent trades') and layers scope and enrichment details without waste. Every clause 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?

Given moderate complexity (3 params, no output schema, no annotations), the description adequately covers the core retrieval purpose and output enrichment. However, gaps remain regarding temporal boundaries of 'recent' and the undocumented 'first' parameter's precise behavior.

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

Parameters4/5

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

Schema coverage is 67% (address and role described, first is not). The description adds value by implying 'first' controls the count of 'recent' results, suggesting chronological ordering. It also contextualizes 'role' as applying across 'both market types', adding semantic clarity beyond the raw schema.

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 provides a specific verb ('Get'), resource ('trader's recent trades'), and scope ('across both market types'). The 'enriched with market names' detail adds specificity. However, it could better distinguish from sibling tool get_market_trades (market-centric vs trader-centric).

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?

While there are no explicit 'when to use' statements, the description implicitly guides selection by specifying 'trader's' (distinguishing from get_market_trades) and 'trades' (distinguishing from get_trader_positions). For explicit alternatives or prerequisites, the user must infer from sibling names.

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