Skip to main content
Glama
Cloady

Cloady

Official
by Cloady

End Engine Session

endEngineSession
Destructive

Cancel a running database statement or terminate its session using a session ID. Choose cancel to stop the current query or terminate to end the connection.

Instructions

Cancels the statement a session is running (mode=cancel) or ends its connection (mode=terminate, the default): pg_cancel_backend or pg_terminate_backend, KILL QUERY or KILL, killOp on MongoDB, KILL QUERY on ClickHouse. sessionId comes from streamEngineSessions.

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": {
      "workspaceSlug": "<workspaceSlug>",
      "appSlug": "<appSlug>",
      "serviceName": "<serviceName>",
      "sessionId": "<sessionId>"
    },
    "name": "endEngineSession"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNo
modeNoterminate
regionNo
appSlugYes
sessionIdYes
serviceNameYes
workspaceSlugYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.18.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already flag readOnlyHint=false and destructiveHint=true, so the safety profile is known. The description adds genuinely new behavioral detail: which backend primitive executes per engine, that terminate is the default mode, and that terminate kills the connection rather than a single statement. It does not state irreversibility, permission requirements, or what happens to concurrent statements on the connection.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two dense sentences, front-loaded with the cancel/terminate distinction that matters most, and no filler. The per-engine primitive list is slightly long but earns its place by clarifying cross-backend behavior; nothing is redundant.

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

Completeness3/5

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

For a destructive mutation tool with no output schema and no schema descriptions, the definition covers the two decision-relevant parameters well but omits confirmation behavior, expected response, error cases for an invalid or already-ended session, and the meaning of the scope parameters. Adequate to call correctly, incomplete for predicting outcome.

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 description coverage is 0% across 7 parameters, so the description carries the burden and only partially meets it. It fully explains `mode` (both enum values plus the default) and the provenance of `sessionId`, but workspaceSlug, appSlug, serviceName, env, and region get no explanation at all, leaving most of the required routing context implicit.

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 (cancel/end) applied to a specific resource (a session's statement or connection), and immediately disambiguates the two behaviors. Naming the concrete backend primitives (pg_cancel_backend, KILL QUERY, killOp) makes the effect unambiguous across engines, and pointing to streamEngineSessions separates it from sibling read tools.

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

Usage Guidelines4/5

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

The description makes the mode choice actionable: cancel stops only the running statement, terminate ends the connection and is the default. It also tells the agent where a valid sessionId comes from (streamEngineSessions). It stops short of explicit when-not-to-use guidance, e.g. warnings about terminate being disruptive to in-flight work.

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

Deploy Server

Other Tools