Skip to main content
Glama

Connect To Server

connect_to_server

Establish a connection to an MCP server for testing, using file path, URL, or command. Allows only one active connection at a time.

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, or explicit stdio via command parameter). Only one connection can be active at a time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory for the stdio subprocess.
envNoEnvironment variables for the stdio subprocess.
urlYesServer URL (http://..., https://...) or file path for stdio transport
argsNoArguments for the stdio command (e.g. ['-y', 'some-package']).
authNoAuthentication config. Bearer token string, 'oauth', {'type': 'bearer', 'token': '...'}, or {'type': 'oauth', 'scopes': [...], 'client_id': '...', 'client_secret': '...'}. Credentials are never logged or stored.
commandNoExplicit stdio command to run (e.g. 'python', 'node', 'npx'). When provided, connects via StdioTransport instead of auto-detection.
headersNoOptional HTTP headers for authenticated connections. Ignored for stdio.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.5.2
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / args
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Arguments for the stdio command (e.g. ['-y', 'some-package'])."
      +}
    • addedInput schema / properties / auth
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Authentication config. Bearer token string, 'oauth', {'type': 'bearer', 'token': '...'}, or {'type': 'oauth', 'scopes': [...], 'client_id': '...', 'client_secret': '...'}. Credentials are never logged or stored."
      +}
    • addedInput schema / properties / command
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Explicit stdio command to run (e.g. 'python', 'node', 'npx'). When provided, connects via StdioTransport instead of auto-detection."
      +}
    • addedInput schema / properties / cwd
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Working directory for the stdio subprocess."
      +}
    • addedInput schema / properties / env
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Environment variables for the stdio subprocess."
      +}
    • addedInput schema / properties / headers
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional HTTP headers for authenticated connections. Ignored for stdio."
      +}
  2. First observed

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. It discloses the transport selection behavior and the single-connection constraint, but does not mention what happens if a connection is already active (error, auto-disconnect, etc.) or failure modes. Credentials handling is documented in the schema, not the description.

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 focused sentences with no wasted words. It front-loads the purpose and then provides essential transport logic and constraint information. It is well-structured and easy to parse quickly.

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?

The tool has 7 parameters and an output schema, so return values are covered. The description covers the core connection behavior and transport selection, but lacks details on edge cases like existing connections or authentication requirements. These are partially addressed in the schema, but the description could be more complete on behavioral nuances.

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 coverage is 100%, so the baseline is 3. The description adds some value by explaining how the url and command parameters determine the transport protocol, which ties these parameters together. However, most parameter details are already thoroughly described in the schema, so the description's additional contribution is modest.

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 clearly states the tool connects to an MCP server for testing, with a specific verb and resource. It distinguishes itself from sibling tools like disconnect and get_connection_status by focusing on establishing a connection, making its purpose unambiguous.

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 explains transport selection logic (stdio for file paths, streamable-http for URLs, explicit stdio via command) and notes that only one connection can be active at a time, implying the need to disconnect before reconnecting. However, it does not explicitly name alternatives or conditions for when not to use this tool, though the context is clear.

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