Skip to main content
Glama
PiyapatRag

MS SQL Server MCP Server

by PiyapatRag

mssql_top_queries

Read-only

Identify the most resource-intensive queries from the SQL Server plan cache. Rank by CPU, duration, reads, writes, memory, or executions to start performance tuning.

Instructions

Find the most expensive queries from the plan cache, ranked by a chosen metric: cpu, duration, reads (logical I/O), writes, memory (grant size), or executions. Returns per-query totals and averages with the SQL text — the starting point for performance tuning.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNoNumber of queries to return (default: 10, max: 50)
metricNoRanking metric (default: cpu)cpu
response_formatNoResponse format (default: markdown)markdown
Behavior3/5

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

The description confirms read-only behavior (finding expensive queries) which aligns with annotations (readOnlyHint=true). No additional behavioral traits beyond annotations are disclosed, but no contradictions exist. The description adds minimal value beyond what annotations provide.

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 two sentences long, direct, and contains no redundant information. Every word serves a purpose, making it highly efficient for an AI agent to parse quickly.

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 tool has three well-described parameters, no output schema, and clear annotations, the description adequately explains purpose, metrics, and return content. It could provide more detail on output structure, but for a starting-point tool, it is sufficiently complete.

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 coverage is 100% with detailed parameter descriptions. The description adds context by explaining the metrics (e.g., 'reads (logical I/O)') and that returns include per-query totals and averages, enhancing understanding beyond the raw schema. This justifies a score above the baseline of 3.

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 finds the most expensive queries from the plan cache, ranked by a chosen metric, and returns per-query totals and averages with SQL text. It distinguishes itself from siblings by focusing on plan cache and performance tuning, though it does not explicitly contrast with similar tools like mssql_performance_health.

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?

The description describes the tool as 'the starting point for performance tuning', which implies when to use it. However, it lacks explicit guidance on when not to use it or clear differentiation from sibling tools. The context is implied but not directly stated.

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/PiyapatRag/mssql-mcp-server'

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