Skip to main content
Glama
PaulieB14

Limitless MCP

get_market_lifecycle

Retrieve the complete lifecycle of a market, including creation, trading statistics, splits/merges, resolution status, and redemptions from on-chain data with metadata.

Instructions

Get the complete lifecycle of a market: creation, trading stats, splits/merges, resolution status, and redemptions — all from on-chain data with metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conditionIdYesMarket conditionId

Implementation Reference

  • The handler function for 'get_market_lifecycle' performs queries against both Simple and NegRisk markets, aggregates metadata, and returns a comprehensive market lifecycle object.
    async ({ conditionId }) => {
      try {
        const lifecycleQuery = (marketEntity: string) => `{
          ${marketEntity}(id: "${conditionId}") {
            id venue tradesCount buysCount sellsCount
            volumeUSD buyVolumeUSD sellVolumeUSD feesUSD createdAt createdTx
          }
          condition(id: "${conditionId}") {
            id oracle questionId outcomeSlotCount resolved
            payoutNumerators resolvedAt resolvedTx createdAt
          }
          splits(where: { conditionId: "${conditionId}" }, first: 100, orderBy: timestamp) {
            id stakeholder { id } amount amountUSD timestamp
          }
          merges(where: { conditionId: "${conditionId}" }, first: 100, orderBy: timestamp) {
            id stakeholder { id } amount amountUSD timestamp
          }
          redemptions(where: { conditionId: "${conditionId}" }, first: 100, orderBy: timestamp) {
            id redeemer { id } payout payoutUSD timestamp
          }
        }`;
    
        const [simpleData, negriskData, meta] = await Promise.all([
          querySimple(lifecycleQuery("market")).catch(() => ({})),
          queryNegRisk(lifecycleQuery("negRiskMarket")).catch(() => ({})),
          getMarketMeta(conditionId),
        ]);
    
        const market = (simpleData as any).market || (negriskData as any).negRiskMarket;
        const condition = (simpleData as any).condition || (negriskData as any).condition;
        const splits = [...((simpleData as any).splits || []), ...((negriskData as any).splits || [])];
        const merges = [...((simpleData as any).merges || []), ...((negriskData as any).merges || [])];
        const redemptions = [...((simpleData as any).redemptions || []), ...((negriskData as any).redemptions || [])];
    
        const totalSplitUSD = splits.reduce((a: number, s: any) => a + parseFloat(s.amountUSD || "0"), 0);
        const totalMergeUSD = merges.reduce((a: number, m: any) => a + parseFloat(m.amountUSD || "0"), 0);
        const totalRedemptionUSD = redemptions.reduce((a: number, r: any) => a + parseFloat(r.payoutUSD || "0"), 0);
    
        return textResult({
          title: meta?.title || "Unknown",
          description: meta?.description || "",
          categories: meta?.categories || [],
          expirationDate: meta?.expirationDate || "",
          currentPrices: meta?.prices || [],
          marketType: (simpleData as any).market ? "simple" : "negrisk",
          creation: {
            createdAt: market?.createdAt || condition?.createdAt,
            createdTx: market?.createdTx,
          },
          trading: market || null,
          condition: condition || null,
          liquidity: {
            splitsCount: splits.length,
            totalSplitUSD,
            mergesCount: merges.length,
            totalMergeUSD,
            redemptionsCount: redemptions.length,
            totalRedemptionUSD,
          },
          resolved: condition?.resolved || false,
          resolution: condition?.resolved
            ? {
                payoutNumerators: condition.payoutNumerators,
                resolvedAt: condition.resolvedAt,
                resolvedTx: condition.resolvedTx,
              }
            : null,
        });
      } catch (e) {
        return errorResult(e);
  • Registration of the 'get_market_lifecycle' tool including its description and input schema.
    server.registerTool(
      "get_market_lifecycle",
      {
        description:
          "Get the complete lifecycle of a market: creation, trading stats, splits/merges, resolution status, and redemptions — all from on-chain data with metadata.",
        inputSchema: {
          conditionId: z.string().describe("Market conditionId"),
        },
      },
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 by specifying 'on-chain data with metadata' as the source, but lacks critical details about authentication requirements, rate limiting, pagination behavior, or the structure of returned lifecycle data.

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 is a single, well-structured sentence that front-loads the core purpose ('Get the complete lifecycle'), enumerates specific components after the colon, and concludes with data source context. Zero wasted words; every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the single parameter with full schema coverage and no output schema, the description adequately covers what the tool retrieves. It lists all major lifecycle components comprehensively. The only gap is the lack of return format details, though this is partially mitigated by the specificity of listed components.

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?

With 100% schema description coverage, the baseline score is 3. The description appropriately does not redundantly document the conditionId parameter since the schema already defines it as 'Market conditionId'. No additional parameter semantics are provided in the description, but none are required given complete schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description excellently specifies the tool's scope with concrete lifecycle phases: creation, trading stats, splits/merges, resolution status, and redemptions. The verb 'Get' is precise, and the phrase 'complete lifecycle' distinguishes this from siblings that return partial data (e.g., get_market_trades, get_market_positions).

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 the description implies usage through 'complete lifecycle' (suggesting use this when needing full history versus partial data from siblings), it lacks explicit guidance on when to prefer this over alternatives like get_market_analytics or get_conditions. No explicit exclusions or prerequisites 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