Skip to main content
Glama

conclave_estimate

Estimate query costs for AI conclave consultations before execution. Provides approximate cost breakdowns for quick, ranked, and full query tiers based on question complexity.

Instructions

Estimate cost for a conclave query before running it.

Provides approximate cost breakdown for quick/ranked/full query types.

Args: question: The question (used to estimate token count) tier: Which tier to estimate - "quick", "ranked", "full" (default: all)

Returns: Cost estimates for each query type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYes
tierNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The conclave_estimate tool handler function that estimates costs for conclave queries. Takes a question string and optional tier parameter, estimates token count from question length, and returns formatted cost breakdown for quick/ranked/full query types.
    @mcp.tool()
    async def conclave_estimate(question: str, tier: Optional[str] = None) -> str:
        """Estimate cost for a conclave query before running it.
    
        Provides approximate cost breakdown for quick/ranked/full query types.
    
        Args:
            question: The question (used to estimate token count)
            tier: Which tier to estimate - "quick", "ranked", "full" (default: all)
    
        Returns:
            Cost estimates for each query type
        """
        # Rough token estimate (4 chars per token)
        query_tokens = len(question) // 4 + 50
    
        tiers_to_estimate = [tier] if tier in ("quick", "ranked", "full") else ["quick", "ranked", "full"]
    
        estimates = {}
        for t in tiers_to_estimate:
            estimates[t] = estimate_cost(query_tokens, tier=t)
    
        output = "## Cost Estimates\n\n"
        for t, est in estimates.items():
            output += f"### {t.title()}\n"
            output += f"- Stage 1: ${est['stage1']:.4f}\n"
            output += f"- Stage 2: ${est['stage2']:.4f}\n"
            output += f"- Stage 3: ${est['stage3']:.4f}\n"
            output += f"- **Total: ${est['total']:.4f}**\n\n"
    
        output += f"_Estimates based on ~{query_tokens} input tokens. Actual costs may vary._"
    
        return output
  • Helper function that calculates cost estimates for council queries. Takes query_tokens, tier, models, and chairman parameters, and returns a dict with cost breakdown for stage1, stage2, stage3, and total. Uses MODEL_COSTS dictionary for per-model pricing data.
    def estimate_cost(
        query_tokens: int,
        tier: str = "full",
        models: list[str] = None,
        chairman: str = None,
    ) -> dict:
        """
        Estimate cost for a council query.
    
        Args:
            query_tokens: Approximate tokens in the query
            tier: "quick" (stage 1), "ranked" (stage 1+2), or "full" (all stages)
            models: Council models to use (defaults to COUNCIL_MODELS)
            chairman: Chairman model (defaults to current chairman)
    
        Returns:
            Dict with cost breakdown and total
        """
        models = models or COUNCIL_MODELS
        chairman = chairman or get_current_chairman()
    
        def get_cost(model: str) -> tuple[float, float]:
            return MODEL_COSTS.get(model, DEFAULT_MODEL_COST)
    
        # Rough estimates for response sizes
        avg_response_tokens = 500
        ranking_tokens = 300
        synthesis_tokens = 800
    
        cost_breakdown = {
            "stage1": 0.0,
            "stage2": 0.0,
            "stage3": 0.0,
            "total": 0.0,
        }
    
        # Stage 1: Each model gets query, produces response
        for model in models:
            input_cost, output_cost = get_cost(model)
            cost_breakdown["stage1"] += (
                (query_tokens / 1000) * input_cost +
                (avg_response_tokens / 1000) * output_cost
            )
    
        if tier in ["ranked", "full"]:
            # Stage 2: Each model evaluates all responses
            eval_input_tokens = query_tokens + (avg_response_tokens * len(models))
            for model in models:
                input_cost, output_cost = get_cost(model)
                cost_breakdown["stage2"] += (
                    (eval_input_tokens / 1000) * input_cost +
                    (ranking_tokens / 1000) * output_cost
                )
    
        if tier == "full":
            # Stage 3: Chairman synthesizes everything
            synthesis_input = query_tokens + (avg_response_tokens * len(models)) + (ranking_tokens * len(models))
            input_cost, output_cost = get_cost(chairman)
            cost_breakdown["stage3"] = (
                (synthesis_input / 1000) * input_cost +
                (synthesis_tokens / 1000) * output_cost
            )
    
        cost_breakdown["total"] = sum([
            cost_breakdown["stage1"],
            cost_breakdown["stage2"],
            cost_breakdown["stage3"],
        ])
    
        return cost_breakdown
  • server.py:340-340 (registration)
    The @mcp.tool() decorator registers the conclave_estimate function as an MCP tool with the FastMCP server instance.
    @mcp.tool()
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool provides 'approximate cost breakdown' and estimates based on token count, which adds useful behavioral context. However, it doesn't mention potential limitations like accuracy, rate limits, or authentication needs, leaving gaps for a tool with no annotation coverage.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by brief elaboration. Every sentence adds value without redundancy, and the structure with 'Args:' and 'Returns:' sections enhances readability without unnecessary verbosity.

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 2 parameters with 0% schema coverage and an output schema present, the description is mostly complete. It explains parameters and return values ('Cost estimates for each query type'), but could benefit from more detail on behavioral aspects like error handling or prerequisites, especially since no annotations are provided.

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 description coverage is 0%, so the description must compensate. It adds meaning beyond the schema by explaining that 'question' is 'used to estimate token count' and 'tier' specifies 'quick/ranked/full query types' with a default of 'all'. This clarifies parameter purposes, though it doesn't detail format constraints or examples.

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 clearly states the tool's purpose: 'Estimate cost for a conclave query before running it.' It specifies the verb ('estimate'), resource ('cost'), and scope ('before running it'), distinguishing it from sibling tools like conclave_quick or conclave_full that likely execute queries rather than estimate costs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: 'before running it' implies it's for pre-execution cost estimation. However, it doesn't explicitly state when not to use it or name alternatives among siblings, such as comparing to conclave_config or conclave_select, which might have overlapping or related purposes.

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/stephenpeters/conclave-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server