Skip to main content
Glama
PaulieB14

Limitless MCP

get_conditions

Retrieve prepared on-chain market conditions and filter by resolution status to identify resolved or unresolved markets.

Instructions

Get conditions (markets that have been prepared on-chain) with resolution status. Useful for finding resolved/unresolved markets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resolvedNoFilter by resolution status
firstNo

Implementation Reference

  • The handler function for the 'get_conditions' tool, which queries a subgraph for conditions and hydrates their names.
      async ({ resolved, first }) => {
        try {
          const resolvedFilter = resolved !== undefined ? `resolved: ${resolved}` : "";
          const condQuery = `{
            conditions(
              first: ${first}
              orderBy: createdAt
              orderDirection: desc
              ${resolvedFilter ? `where: { ${resolvedFilter} }` : ""}
            ) {
              id oracle questionId outcomeSlotCount resolved
              payoutNumerators createdAt resolvedAt
            }
          }`;
    
          const { simple, negrisk } = await queryBoth(condQuery, condQuery);
    
          // Deduplicate by id (same CTF contract, same conditions in both)
          const seen = new Set<string>();
          const conditions: any[] = [];
          for (const c of [...(simple.conditions || []), ...(negrisk.conditions || [])]) {
            if (!seen.has(c.id)) {
              seen.add(c.id);
              conditions.push(c);
            }
          }
    
          conditions.sort((a, b) => Number(b.createdAt) - Number(a.createdAt));
          const top = conditions.slice(0, first);
    
          // Hydrate names
          const names = new Map<string, string>();
          await Promise.all(top.map(async (c: any) => names.set(c.id, await hydrateName(c.id))));
          const enriched = top.map((c: any) => ({ ...c, title: names.get(c.id) }));
    
          return textResult({ count: enriched.length, conditions: enriched });
        } catch (e) {
          return errorResult(e);
        }
      }
    );
  • Tool registration for 'get_conditions' in the MCP server.
    server.registerTool(
      "get_conditions",
      {
        description:
          "Get conditions (markets that have been prepared on-chain) with resolution status. Useful for finding resolved/unresolved markets.",
        inputSchema: {
          resolved: z.boolean().optional().describe("Filter by resolution status"),
          first: z.number().default(20),
        },
      },
Behavior3/5

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

No annotations provided, so description carries full burden. Adds valuable domain context ('on-chain', 'resolution status') but omits behavioral details like pagination behavior, data freshness, or return structure that agents need when annotations are absent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two efficient sentences with no wasted words. Front-loaded with action and resource. Briefness appropriate for simple list operation, though content could be redistributed to cover the missing parameter documentation.

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 simple 2-parameter listing tool. Explains the domain-specific term 'conditions' effectively, but gaps remain around the undocumented 'first' parameter andcomparison to numerous sibling market tools.

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

Parameters2/5

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

Schema coverage is only 50% (parameter 'first' undocumented). Description mentions 'resolution status' conceptually aligning with the 'resolved' parameter, but completely fails to document the 'first' parameter's purpose (likely pagination limit), providing no compensation for schema gaps.

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 ('Get') and resource ('conditions') with helpful parenthetical clarifying domain terminology ('markets that have been prepared on-chain'). However, lacks explicit differentiation from siblings like 'search_markets' or '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 Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States utility ('Useful for finding resolved/unresolved markets') implying when to use, but provides no explicit comparison to alternative tools or exclusion criteria (e.g., when to prefer search_markets instead).

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