Skip to main content
Glama
mongodb-js

MongoDB MCP Server

Official
by mongodb-js

disconnect

Read-only

Terminate a MongoDB connection and invalidate its connectionId. If the connection is preconfigured, it will auto-reconnect on next use.

Instructions

Close a MongoDB connection and revoke its connectionId. Disconnecting the "preconfigured" connection only closes it — it reconnects automatically on next use because the server configuration still declares it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionIdYesThe connectionId to disconnect.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
outcomeYes
Behavior1/5

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

The description contradicts the annotations: readOnlyHint=true implies no state modification, but disconnecting and revoking a connectionId is a state-changing operation. The description does add context about auto-reconnect behavior, but the contradiction makes the behavioral transparency invalid.

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 two compact sentences with a front-loaded verb and no filler. Every phrase earns its place, including the valuable preconfigured-connection caveat.

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?

Although this is a simple one-parameter tool with an output schema, the description omits the return value and fails to clarify the inconsistency with readOnlyHint. It provides a useful behavioral note about auto-reconnect, but the contradictory annotation undermines overall completeness.

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 only parameter, connectionId, is fully described in the schema (100% coverage), so the description adds no further parameter semantics. A baseline of 3 is appropriate because the schema carries the full burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: closing a MongoDB connection and revoking its connectionId. It uses a specific verb and resource, and it is distinguishable from sibling tools like connect or list-connections, though it does not explicitly differentiate them.

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

Usage Guidelines2/5

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

No guidance is provided on when to use disconnect versus alternatives, nor are exclusions or prerequisites mentioned. The caveat about the preconfigured connection is useful but not enough to orient an agent choosing among connection-related tools.

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/mongodb-js/mongodb-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server