Skip to main content
Glama
PaulieB14

Limitless MCP

get_liquidity_events

Retrieve liquidity lifecycle events including splits, merges, and redemptions. Filter results by market or user address to track liquidity changes.

Instructions

Get splits, merges, and redemptions — the liquidity lifecycle events. Filter by market or user address.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conditionIdNoFilter by market conditionId
addressNoFilter by user address
firstNo

Implementation Reference

  • The handler function for get_liquidity_events which queries subgraphs, merges data, and hydrates names.
    async ({ conditionId, address, first }) => {
      try {
        const condFilter = conditionId ? `conditionId: "${conditionId}"` : "";
        const addrFilter = address ? `stakeholder: "${address.toLowerCase()}"` : "";
        const redAddrFilter = address ? `redeemer: "${address.toLowerCase()}"` : "";
        const where = [condFilter, addrFilter].filter(Boolean).join(", ");
        const redWhere = [condFilter, redAddrFilter].filter(Boolean).join(", ");
    
        const eventQuery = `{
          splits(first: ${first}, orderBy: timestamp, orderDirection: desc${where ? `, where: { ${where} }` : ""}) {
            id stakeholder { id } conditionId amount amountUSD timestamp txHash
          }
          merges(first: ${first}, orderBy: timestamp, orderDirection: desc${where ? `, where: { ${where} }` : ""}) {
            id stakeholder { id } conditionId amount amountUSD timestamp txHash
          }
          redemptions(first: ${first}, orderBy: timestamp, orderDirection: desc${redWhere ? `, where: { ${redWhere} }` : ""}) {
            id redeemer { id } conditionId payout payoutUSD timestamp txHash
          }
        }`;
    
        const { simple, negrisk } = await queryBoth(eventQuery, eventQuery);
    
        // Merge all events into a unified feed
        const events: any[] = [];
        for (const s of [...(simple.splits || []), ...(negrisk.splits || [])]) {
          events.push({ type: "SPLIT", user: s.stakeholder?.id, conditionId: s.conditionId, amountUSD: s.amountUSD, timestamp: s.timestamp, txHash: s.txHash });
        }
        for (const m of [...(simple.merges || []), ...(negrisk.merges || [])]) {
          events.push({ type: "MERGE", user: m.stakeholder?.id, conditionId: m.conditionId, amountUSD: m.amountUSD, timestamp: m.timestamp, txHash: m.txHash });
        }
        for (const r of [...(simple.redemptions || []), ...(negrisk.redemptions || [])]) {
          events.push({ type: "REDEMPTION", user: r.redeemer?.id, conditionId: r.conditionId, amountUSD: r.payoutUSD, timestamp: r.timestamp, txHash: r.txHash });
        }
    
        events.sort((a, b) => Number(b.timestamp) - Number(a.timestamp));
        const top = events.slice(0, first);
    
        // Hydrate names
        const cids = [...new Set(top.map((e) => e.conditionId).filter(Boolean))];
        const names = new Map<string, string>();
        await Promise.all(cids.map(async (id) => names.set(id, await hydrateName(id))));
        const enriched = top.map((e) => ({
          ...e,
          marketName: names.get(e.conditionId) || e.conditionId,
        }));
    
        return textResult({ eventCount: enriched.length, events: enriched });
      } catch (e) {
        return errorResult(e);
      }
  • Registration of the get_liquidity_events tool in the MCP server.
    server.registerTool(
      "get_liquidity_events",
      {
        description:
          "Get splits, merges, and redemptions — the liquidity lifecycle events. Filter by market or user address.",
        inputSchema: {
          conditionId: z.string().optional().describe("Filter by market conditionId"),
          address: z.string().optional().describe("Filter by user address"),
          first: z.number().default(20),
        },
      },
Behavior3/5

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

With no annotations provided, the description carries the full disclosure burden. It successfully defines the semantic meaning of 'liquidity events' (splits, merges, redemptions), but fails to disclose operational traits like read-only status, pagination behavior beyond the schema default, auth requirements, or rate limit implications.

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 no redundancy. The first front-loads the core value (event types), while the second addresses filtering. 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 three simple parameters and no output schema, the description adequately covers the domain concept but lacks return value documentation. Since no output schema exists to clarify the structure of 'splits, merges, and redemptions' data, the description should ideally hint at the return format, which it does not.

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 67% (two of three parameters have descriptions). The description maps 'market' to conditionId and 'user address' to address, aligning with the schema's filter intent, but does not compensate for the undocumented 'first' parameter (which controls result limit/pagination).

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 uses specific verbs ('Get') and clearly identifies the resource as 'splits, merges, and redemptions — the liquidity lifecycle events.' It provides domain-specific terminology that distinguishes it from generic activity or trade tools, though it does not explicitly contrast with similar siblings like get_market_lifecycle.

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 mentions filtering capability ('Filter by market or user address') but provides no guidance on when to use this tool versus alternatives like get_market_trades or get_recent_activity, nor does it state prerequisites or exclusion criteria.

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