Skip to main content
Glama
PaulieB14

Limitless MCP

get_top_traders

Identify top-performing traders by analyzing volume, trade frequency, or profit/loss metrics across market types to inform trading strategies.

Instructions

Get top traders ranked by volume, trade count, or PnL. Queries both subgraphs and merges rankings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderByNototalVolumeUSD
firstNo
marketTypeNoFilter by market type or combine bothall

Implementation Reference

  • The handler for 'get_top_traders' retrieves data from subgraphs and merges results based on the provided marketType.
    async ({ orderBy, first, marketType }) => {
      try {
        const userQuery = `{
          users(first: ${first * 2}, orderBy: ${orderBy}, orderDirection: desc, where: { tradesCount_gt: "0" }) {
            id tradesCount totalVolumeUSD totalFeesUSD realizedPnlUSD
            firstTradeAt lastTradeAt
          }
        }`;
    
        if (marketType === "simple") {
          const data = await querySimple(userQuery);
          return textResult({ marketType, traders: (data.users || []).slice(0, first) });
        }
        if (marketType === "negrisk") {
          const data = await queryNegRisk(userQuery);
          return textResult({ marketType, traders: (data.users || []).slice(0, first) });
        }
    
        // Merge both
        const { simple, negrisk } = await queryBoth(userQuery, userQuery);
        const merged = new Map<string, any>();
    
        for (const u of [...(simple.users || []), ...(negrisk.users || [])]) {
          const existing = merged.get(u.id);
          if (existing) {
            existing.tradesCount =
              parseInt(existing.tradesCount) + parseInt(u.tradesCount);
            existing.totalVolumeUSD =
              parseFloat(existing.totalVolumeUSD) + parseFloat(u.totalVolumeUSD);
            existing.totalFeesUSD =
              parseFloat(existing.totalFeesUSD) + parseFloat(u.totalFeesUSD);
            existing.realizedPnlUSD =
              parseFloat(existing.realizedPnlUSD) + parseFloat(u.realizedPnlUSD);
          } else {
            merged.set(u.id, {
              ...u,
              tradesCount: parseInt(u.tradesCount),
              totalVolumeUSD: parseFloat(u.totalVolumeUSD),
              totalFeesUSD: parseFloat(u.totalFeesUSD),
              realizedPnlUSD: parseFloat(u.realizedPnlUSD),
            });
          }
        }
  • Tool registration and input schema definition for 'get_top_traders'.
    server.registerTool(
      "get_top_traders",
      {
        description:
          "Get top traders ranked by volume, trade count, or PnL. Queries both subgraphs and merges rankings.",
        inputSchema: {
          orderBy: z
            .enum(["totalVolumeUSD", "tradesCount", "totalFeesUSD"])
            .default("totalVolumeUSD"),
          first: z.number().default(20),
          marketType: z
            .enum(["simple", "negrisk", "all"])
            .default("all")
            .describe("Filter by market type or combine both"),
        },
      },
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds valuable context about the implementation (queries both subgraphs and merges rankings), indicating it's an aggregated read-only operation. However, it lacks details on rate limits, pagination behavior, or what constitutes 'top' (ascending vs descending).

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?

The description consists of two tightly constructed sentences with zero extraneous content. The first sentence establishes purpose and ranking dimensions; the second explains the data source pattern. 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?

Given the low schema coverage, absence of annotations, and lack of output schema, the description provides the minimum viable context for a ranking tool. It adequately explains the core ranking logic but omits important details about the filtering capabilities (marketType) and result limiting (first).

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 only 33% (marketType described; orderBy and first are not). The description maps the orderBy options to human-readable concepts (volume, trade count, PnL), adding semantic value for that parameter. However, it fails to document the 'first' (limit) parameter or elaborate on 'marketType' beyond what's in the 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 clearly states the specific action (get) and resource (top traders) with ranking criteria (volume, trade count, PnL). However, it does not explicitly differentiate from sibling tools like get_trader_profile (individual lookup) vs. this aggregate ranking view.

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?

The description provides no guidance on when to use this tool versus alternatives such as get_trader_profile for specific trader lookups or get_market_positions for position-specific analysis. No prerequisites or exclusions are mentioned.

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