Skip to main content
Glama

get_cached_routine_stats

Read-onlyIdempotent

Retrieve cached execution statistics for Azure SQL stored procedures and functions, including bounded metrics and missing-index flags, without raw plan XML.

Instructions

Get cached stored procedure and UDF execution statistics. Returns bounded routine metrics and missing-index flags without raw plan XML.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum routines per section.
sort_byNoSort by execution_count, total_worker_time, avg_worker_time, total_elapsed_time, avg_elapsed_time, total_logical_reads, total_physical_reads, or total_logical_writes.total_worker_time
routine_typeNoRoutine type: all, procedure, or function.all
database_nameNoOptional database name. Defaults to AZURE_SQL_DEFAULT_DATABASE.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint false, but the description adds useful behavioral context: results are 'bounded' (limiting output size) and include 'missing-index flags' while excluding raw plan XML. This goes beyond the annotations without contradicting them.

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?

A single concise sentence that front-loads the core purpose and immediately follows with key differentiators. No filler or redundancies; every part earns its place.

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?

With an output schema available and comprehensive annotations, the description fully covers the essential purpose, scope (cached routines), and notable constraints (bounded results, no raw plan XML). It is sufficiently complete for a read-only stats tool of this simplicity.

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?

Input schema has 100% description coverage for all parameters, including defaults and allowed sort values. The description itself does not add parameter-specific meaning beyond what the schema already provides, so baseline 3 is appropriate.

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?

Description clearly states the tool 'Get cached stored procedure and UDF execution statistics', identifying both the action (get) and the resource (cached routine stats). The additional clause 'Returns bounded routine metrics and missing-index flags without raw plan XML' differentiates it from sibling tools that return raw plan XML or focus on other cache aspects.

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?

Implied usage: the description indicates this tool is for routine-level execution metrics and missing-index flags, with the phrase 'without raw plan XML' hinting at a distinction from plan-returning tools. However, it does not explicitly name alternatives or state when to prefer this tool over siblings like get_top_cached_queries or get_plan_cache_analysis.

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/akaalholdings/azure-sql-mcp'

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