Skip to main content
Glama
stat-guy

Chain of Draft (CoD) MCP Server

by stat-guy

get_performance_stats

Retrieve performance statistics comparing Chain of Draft and Chain of Thought approaches to analyze token efficiency and accuracy metrics.

Instructions

Get performance statistics for CoD vs CoT approaches

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainNoFilter for specific domain

Implementation Reference

  • Primary Python handler for the MCP 'get_performance_stats' tool. Uses @app.tool() decorator for registration and execution. Fetches stats from AnalyticsService and formats output string.
    @app.tool()
    async def get_performance_stats(
        domain: str = None
    ) -> str:
        """Get performance statistics for CoD vs CoT approaches.
        
        Args:
            domain: Filter for specific domain (optional)
        """
        stats = await analytics.get_performance_by_domain(domain)
        
        result = "Performance Comparison (CoD vs CoT):\n\n"
        
        if not stats:
            return "No performance data available yet."
        
        for stat in stats:
            result += f"Domain: {stat['domain']}\n"
            result += f"Approach: {stat['approach']}\n"
            result += f"Average tokens: {stat['avg_tokens']:.1f}\n"
            result += f"Average time: {stat['avg_time_ms']:.1f}ms\n"
            
            if stat['accuracy'] is not None:
                result += f"Accuracy: {stat['accuracy'] * 100:.1f}%\n"
            
            result += f"Sample size: {stat['count']}\n\n"
        
        return result
  • JavaScript handler in the CallToolRequestSchema request handler. Dispatches 'get_performance_stats' tool calls, computes stats from in-memory analyticsDb, and returns formatted text response.
    if (name === "get_performance_stats") {
      const stats = analyticsDb.getPerformanceByDomain(args.domain);
      
      let result = "Performance Comparison (CoD vs CoT):\n\n";
      
      if (!stats || stats.length === 0) {
        result = "No performance data available yet.";
      } else {
        for (const stat of stats) {
          result += `Domain: ${stat.domain}\n`;
          result += `Approach: ${stat.approach}\n`;
          result += `Average tokens: ${stat.avg_tokens.toFixed(1)}\n`;
          result += `Average time: ${stat.avg_time_ms.toFixed(1)}ms\n`;
          
          if (stat.accuracy !== null) {
            result += `Accuracy: ${(stat.accuracy * 100).toFixed(1)}%\n`;
          }
          
          result += `Sample size: ${stat.count}\n\n`;
        }
      }
      
      return {
        content: [{
          type: "text",
          text: result
        }]
      };
  • Explicit input schema for the get_performance_stats tool in the JavaScript MCP server implementation.
    const PERFORMANCE_TOOL = {
      name: "get_performance_stats",
      description: "Get performance statistics for CoD vs CoT approaches",
      inputSchema: {
        type: "object",
        properties: {
          domain: {
            type: "string",
            description: "Filter for specific domain"
          }
        }
      }
    };
  • index.js:581-591 (registration)
    Registration of get_performance_stats tool (as PERFORMANCE_TOOL) in the list of tools advertised via ListToolsRequestHandler.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        CHAIN_OF_DRAFT_TOOL,
        MATH_TOOL,
        CODE_TOOL,
        LOGIC_TOOL,
        PERFORMANCE_TOOL,
        TOKEN_TOOL,
        COMPLEXITY_TOOL
      ],
    }));
  • Helper method in ChainOfDraftClient class that proxies performance stats retrieval from its analytics service, used internally by the server tool.
    async def get_performance_stats(self, domain=None):
        """Get performance statistics for CoD vs CoT approaches."""
        return await self.analytics.get_performance_by_domain(domain)
Behavior2/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 of behavioral disclosure. It states the tool 'Get[s] performance statistics,' implying a read-only operation, but doesn't specify whether it requires authentication, has rate limits, returns real-time or historical data, or what format the statistics are in. For a tool with no annotations, this is a significant gap in behavioral context.

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, efficient sentence: 'Get performance statistics for CoD vs CoT approaches.' It's front-loaded with the core purpose, has zero wasted words, and is appropriately sized for the tool's apparent complexity. Every part of the sentence contributes to understanding the tool's function.

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

Completeness2/5

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

Given the complexity (performance statistics comparison), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'performance statistics' entail (e.g., metrics like accuracy, speed, cost), how CoD vs CoT are defined, or what the return values look like. For a tool that likely involves nuanced data analysis, this leaves too many gaps for effective agent use.

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?

The input schema has 100% description coverage, with one parameter 'domain' documented as 'Filter for specific domain.' The description doesn't add any meaning beyond this, such as examples of domains or how filtering affects the results. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description neither compensates nor detracts from the schema's information.

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 tool's purpose: 'Get performance statistics for CoD vs CoT approaches.' It specifies the verb ('Get') and resource ('performance statistics'), and distinguishes the scope (CoD vs CoT approaches). However, it doesn't explicitly differentiate from sibling tools like 'get_token_reduction' or 'analyze_problem_complexity', which might also relate to performance metrics, so it's not a perfect 5.

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. It doesn't mention any prerequisites, context, or exclusions, and with sibling tools like 'get_token_reduction' that might overlap in performance analysis, there's no explicit comparison or usage rules. This leaves the agent without clear direction on tool selection.

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/stat-guy/chain-of-draft'

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