Skip to main content
Glama

connect_to_server

Establish a connection to a target MCP server for testing purposes using stdio or HTTP transport protocols. Verifies connectivity and returns detailed connection state information.

Instructions

Connect to an MCP server for testing.

Establishes a connection to a target MCP server using the appropriate transport protocol (stdio for file paths, streamable-http for URLs). Only one connection can be active at a time.

Returns: Dictionary with connection details including: - success: Always True on successful connection - connection: Full ConnectionState with server info and statistics - message: Human-readable success message - metadata: Request timing information

Raises: Returns error dict on failure with: - success: False - error: Error details (type, message, suggestion) - metadata: Request timing information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesServer URL (http://..., https://...) or file path for stdio transport

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: the single-connection constraint, transport protocol selection based on input type (stdio for file paths, streamable-http for URLs), and detailed return structure including success/error cases. It also specifies that this is for testing purposes, which adds important context about the tool's intended use case.

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 well-structured with clear sections (purpose, constraints, returns, raises) and uses bullet points for readability. While comprehensive, some sentences could be more concise (e.g., the returns section is quite detailed). Overall, it's appropriately sized for a connection tool with complex behavior, though not perfectly minimal.

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 complexity (connection establishment with protocol selection and single-connection constraint), no annotations, 100% schema coverage, and the presence of an output schema (implied by the detailed return documentation), the description is complete. It covers purpose, constraints, return values, and error cases thoroughly, providing all necessary context for an agent to use the tool correctly.

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 100%, so the schema already documents the single 'url' parameter with its description. The description adds marginal value by mentioning the transport protocol implications ('stdio for file paths, streamable-http for URLs'), but doesn't provide additional syntax, format, or validation details beyond what the schema provides. The baseline of 3 is appropriate when the schema does most of the parameter documentation work.

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 purpose: 'Connect to an MCP server for testing' and 'Establishes a connection to a target MCP server using the appropriate transport protocol'. It specifies the verb ('connect', 'establishes') and resource ('MCP server'), though it doesn't explicitly differentiate from siblings like 'get_connection_status' or 'disconnect' beyond the testing context.

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?

The description implies usage context ('for testing') and mentions 'Only one connection can be active at a time', which provides some guidance on when to use it. However, it doesn't explicitly state when to use this tool versus alternatives like 'get_connection_status' or 'disconnect', nor does it provide clear prerequisites or exclusions beyond the single-connection constraint.

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/rdwj/mcp-test-mcp'

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