Skip to main content
Glama
egarcia74

Warp SQL Server MCP

by egarcia74

get_performance_stats

Retrieve SQL Server performance statistics and health summaries to monitor database efficiency and identify optimization opportunities.

Instructions

Get overall performance statistics and health summary

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeframeNoTime period for stats: "recent" (last 5 min), "session" (since startup), "all" (default)

Implementation Reference

  • The main handler function for the 'get_performance_stats' tool. It retrieves performance statistics from the PerformanceMonitor instance and formats them as a JSON text response.
    getPerformanceStats() {
      const stats = this.performanceMonitor.getStats();
      return [
        {
          type: 'text',
          text: JSON.stringify(
            {
              success: true,
              data: stats
            },
            null,
            2
          )
        }
      ];
    }
  • The input schema definition for the 'get_performance_stats' tool, defining an optional 'timeframe' parameter.
    {
      name: 'get_performance_stats',
      description: 'Get overall performance statistics and health summary',
      inputSchema: {
        type: 'object',
        properties: {
          timeframe: {
            type: 'string',
            description:
              'Time period for stats: "recent" (last 5 min), "session" (since startup), "all" (default)',
            enum: ['recent', 'session', 'all']
          }
        }
      }
    },
  • index.js:313-316 (registration)
    The switch case registration in the CallToolRequest handler that routes 'get_performance_stats' calls to the getPerformanceStats() method.
    case 'get_performance_stats':
      return {
        content: this.getPerformanceStats()
      };
  • The core PerformanceMonitor.getStats() method that computes and returns the performance statistics (overall, recent, pool, monitoring) used by the tool handler.
    getStats() {
      if (!this.config.enabled) {
        return { enabled: false };
      }
    
      const now = Date.now();
      const uptime = now - this.startTime;
    
      // Calculate recent performance (last 5 minutes)
      const recentThreshold = now - 5 * 60 * 1000;
      const recentQueries = this.metrics.queries.filter(
        q => q.startTime > recentThreshold && q.status === 'completed'
      );
    
      const recentStats = this.calculateQueryStats(recentQueries);
    
      return {
        enabled: true,
        uptime,
        overall: this.metrics.aggregates,
        recent: recentStats,
        pool: this.metrics.poolStats,
        monitoring: {
          totalQueriesTracked: this.metrics.queries.length,
          totalConnectionEvents: this.metrics.connections.length,
          samplingRate: this.config.samplingRate,
          slowQueryThreshold: this.config.slowQueryThreshold
        }
      };
    }
Behavior2/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 mentions 'overall performance statistics and health summary', implying a read-only operation, but fails to specify details like response format, data freshness, or any limitations (e.g., rate limits, authentication needs). This leaves significant gaps for a tool that likely returns critical system 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, efficient sentence that directly states the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 the tool's moderate complexity (performance statistics with a timeframe parameter) and lack of annotations or output schema, the description is minimally adequate. It covers the basic purpose but lacks details on behavior, output format, and differentiation from siblings, leaving room for improvement in completeness.

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, fully documenting the single parameter 'timeframe' with its enum values and meaning. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline score of 3 for adequate but not enhanced semantics.

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 with a specific verb ('Get') and resource ('overall performance statistics and health summary'), making it easy to understand what it does. However, it doesn't explicitly differentiate from sibling tools like 'get_query_performance' or 'get_connection_health', which prevents a perfect score.

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 like 'get_query_performance' or 'get_connection_health'. It lacks any context about prerequisites, exclusions, or specific scenarios where this tool is preferred, leaving the agent to infer usage from the name alone.

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/egarcia74/warp-sql-server-mcp'

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