Skip to main content
Glama

get_memory_grants

Read-only

Retrieve active and pending memory grants to identify queries waiting for memory or likely to spill to tempdb.

Instructions

Get active and pending memory grants. Identifies queries waiting for memory (RESOURCE_SEMAPHORE) and queries likely spilling to tempdb.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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=true and destructiveHint=false, and the description adds meaningful behavioral context: it specifically surfaces queries waiting on RESOURCE_SEMAPHORE and those likely spilling to tempdb. This goes beyond the schema and annotations by clarifying what the query results represent, though it does not discuss return formatting or limitations.

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 extremely concise: two sentences that front-load the primary action and then add specific diagnostic value. There is no unnecessary verbosity or repetition; every clause adds relevant detail.

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 output schema exists, the description sufficiently covers the tool's purpose and key diagnostic dimensions (active/pending, RESOURCE_SEMAPHORE, tempdb spill). It does not explain concepts like 'pending' or how to interpret results, but the output schema and read-only nature make this reasonably complete for an agent.

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 schema provides 100% coverage for the single optional parameter, including a default behavior description. The tool description adds no additional meaning about the parameter, so it relies on the schema, which is adequate. Baseline 3 is appropriate given the high schema coverage.

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 retrieves memory grants, specifically active and pending ones. It also identifies the exact resource types (queries waiting on RESOURCE_SEMAPHORE and likely tempdb spills), making it distinct from sibling tools like get_wait_stats or get_tempdb_usage.

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 implies use for diagnosing memory pressure by identifying waiters and tempdb spills, but it does not explicitly mention alternative tools or provide when-to-use versus when-not-to-use guidance. Context is present but indirect.

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