Skip to main content
Glama
db-conn-mcp

db-conn-mcp

close_cursor

Idempotent

Close an open database cursor to immediately release its connection and slot, ensuring you free resources when you stop reading before the result set is exhausted.

Instructions

Close an open cursor and release its database connection. Idempotent.

Call it when you stop reading a cursor before fetch_rows reports exhausted: a drained or failed cursor closes itself, and an idle one is reaped after 15 minutes, but an open one holds a connection and one of the 5 cursor slots until then. It never stops a running statement — use cancel_query for that.

Returns meta, cursor_id, closed and was_open (false when the cursor was already closed or never existed).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cursor_id": "<cursor_id>"
    },
    "name": "close_cursor"
  }
}

Input Schema

NameRequiredDescriptionDefault
cursor_idYesThe cursor_id returned by open_query_cursor. An unknown or already-closed id is fine: the call just reports was_open=false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.1
    • addedInput schema / properties / cursor_id / description
      Added value: +"The cursor_id returned by open_query_cursor. An unknown or already-closed id is fine: the call just reports was_open=false."
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare idempotentHint=true and destructiveHint=false, and the description reinforces idempotency rather than contradicting it. Beyond that it discloses resource consequences the annotations cannot express: an open cursor holds a connection and one of 5 cursor slots, and idle cursors are reaped after 15 minutes. It also enumerates the returned fields (meta, cursor_id, closed, was_open) in the absence of an output schema.

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 core action and idempotency are front-loaded in the first line, followed by the usage condition and the return contract. Every sentence carries distinct information — no restatement of the tool name, no filler.

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

Completeness5/5

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

For a single-parameter lifecycle tool with no output schema, the description covers purpose, idempotency, resource impact, timing (15-minute reap), the boundary against cancel_query, and the return shape. Nothing an agent needs to decide whether and how to call it is missing.

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?

Schema coverage is 100% and the schema itself already documents that an unknown or already-closed cursor_id is harmless (was_open=false). The description's return-value note ('false when the cursor was already closed or never existed') overlaps with that schema text rather than adding new parameter semantics. Baseline 3 applies when the schema carries the full parameter burden.

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?

States a specific verb and resource ('Close an open cursor and release its database connection') and immediately clarifies what it does NOT do by naming the sibling cancel_query. An agent can distinguish it from cancel_query and fetch_rows without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit trigger condition ('when you stop reading a cursor before fetch_rows reports exhausted'), an explicit exclusion (drained or failed cursors close themselves, so no call needed), and an explicit alternative for a different need (cancel_query to stop a running statement). This is the full when/when-not/alternative triad.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.