Skip to main content
Glama

Disconnect

disconnect

Closes the active MCP server connection and clears its state. Safe to call even when no connection exists, returning disconnection details.

Instructions

Close the current MCP server connection.

Safely disconnects from the active MCP server and clears all connection state and statistics. This method is safe to call even if no connection exists.

Returns: Dictionary with disconnection details including: - success: Always True - message: Human-readable status message - was_connected: Whether a connection existed before disconnect - metadata: Request timing information and previous connection info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.2
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the burden of explaining behavior. It discloses that it disconnects, clears state and statistics, is safe when no connection exists, and returns a result dictionary. This is transparent, though it does not mention potential side effects beyond connection state.

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?

The description is compact and uses clear structure, including a return-value summary. The first two sentences are slightly redundant ('Close...' vs. 'Safely disconnects...'), but overall the description is well organized and not overly verbose.

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 no parameters, an output schema, and no annotations, the description is reasonably complete: it explains what the tool does, safety behavior, and return content. It could be slightly stronger by explicitly relating to connect_to_server or get_connection_status, but the context is sufficient.

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

Parameters4/5

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

The tool has zero parameters and the schema coverage is complete, so there is no parameter information needing explanation. The baseline for a zero-parameter tool is appropriate here.

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?

Clearly states the tool closes/disconnects the current MCP server connection and clears connection state and statistics. This distinguishes it from sibling tools like connect_to_server and get_connection_status.

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?

Provides the useful note that it is safe to call even when no connection exists, implying idempotent usage. However, it does not explicitly compare with sibling tools or state when to prefer this over alternatives.

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