Skip to main content
Glama
db-conn-mcp

db-conn-mcp

open_query_cursor

Opens a server-side cursor over a read-only query so large results can be fetched in batches, returning a cursor_id for fetch_rows and close_cursor calls.

Instructions

Open a server-side cursor over a read-only query for batched fetching.

Use for results too large for one execute_read_query response. Returns a cursor_id for fetch_rows/close_cursor. The cursor pins one read-only connection until closed (auto-reaped after 15 idle minutes; max 5 open).

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": {
      "database": "<database>",
      "sql": "<sql>"
    },
    "name": "open_query_cursor"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
paramsNo
databaseYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it discloses that the cursor pins one read-only connection until closed, is auto-reaped after 15 idle minutes, and that a maximum of 5 can be open, plus the cursor_id return value. The only gap is failure behavior when the 5-cursor cap is hit or what errors look like, which is why this isn't a 5.

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?

Three tight sentences, front-loaded with the core action, then usage, then lifecycle constraints. No filler and no repetition of the tool name.

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?

For a tool with no output schema, the definition covers the return value (cursor_id), the resource-pinning side effect, the idle timeout, and the concurrency cap, which is enough to call and manage cursors safely. The residual gap is that the two non-required-shaped parameters (`params`, `database`) are left unexplained everywhere.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% for all three parameters, so the description has to carry the meaning and largely doesn't: it never explains what `params` are (bind parameters?), what `database` refers to, or what form `sql` takes beyond being read-only. The phrase 'read-only query" implies SELECT-only for sql, but params and database are entirely undocumented in both places.

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 uses a specific verb and resource combination: 'Open a server-side cursor over a read-only query for batched fetching.' It also names the sibling it replaces for large result sets (execute_read_query) and the tools that continue the workflow (fetch_rows, close_cursor), so the agent can distinguish it from siblings without reading 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?

It states the selecting condition explicitly: use it for results too large for a single execute_read_query response, and it names the lifecycle tools to call afterwards (fetch_rows/close_cursor). The choice between this tool and the sibling read tool is unambiguous.

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