Skip to main content
Glama
Vijayakumar-DevOps

MongoDB MCP Server

connect

Read-only

Establish a connection to a MongoDB instance using a connection string. Use this to create a new connection or switch to a different cluster.

Instructions

Connect to a MongoDB instance. The config resource captures if the server is already connected to a MongoDB cluster. If the user has configured a connection string or has previously called the connect tool, a connection is already established and there's no need to call this tool unless the user has explicitly requested to switch to a new MongoDB cluster.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionStringYesMongoDB connection string (in the mongodb:// or mongodb+srv:// format)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectedYes
Behavior4/5

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

The description goes beyond the readOnlyHint/destructiveHint annotations by explaining the connection state persistence through a config resource and the idempotency-like behavior (no need to reconnect unless switching). It does not describe failure modes or what happens to the existing connection during a switch, but given the presence of an output schema and annotations, the added context is valuable and sufficient.

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 three sentences, front-loaded with the core purpose, and each subsequent sentence adds meaningful usage context. There is no redundant filler; every sentence contributes to the agent's understanding of when and how to use the tool.

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?

Given the tool's simplicity (one required parameter, no nested objects), the description, combined with the schema and annotations, fully covers the necessary information. It explains the tool's purpose, connection state tracking, and when to avoid calling it. The presence of an output schema means return format does not need to be described in prose.

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 schema already documents the connectionString parameter fully with a description that includes the expected URI format. The tool description adds no new parameter-specific semantics—it only discusses when the parameter may already be configured, which is contextual but not about the parameter's meaning or syntax. With 100% schema coverage, the baseline score of 3 is appropriate.

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 opens with a clear, specific verb and resource: 'Connect to a MongoDB instance.' This immediately distinguishes the tool from sibling data-operation tools like find, aggregate, and create-collection. It also explains the tool's role in managing server connections, which is unique among the siblings.

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?

The description provides explicit guidance on when to call the tool and when not to: it states that if a connection string is configured or connect was already called, there's no need to call it again unless switching clusters. This gives the agent clear decision-making criteria, surpassing typical usage notes.

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/Vijayakumar-DevOps/mongo-mcp-1.14.0'

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