Skip to main content
Glama

mcp_client

Test and interact with MCP servers by connecting via HTTP or stdio transport, listing available tools, and calling tools from within a Strands Agent.

Instructions

Test and interact with MCP servers.

This tool provides a complete MCP client implementation for testing and using MCP servers from within a Strands Agent.

Returns: Result dictionary with status and content

Examples: # Connect to HTTP server mcp_client( action="connect", connection_id="my-server", transport="http", server_url="http://localhost:8000/mcp" )

# Connect to stdio server
mcp_client(
    action="connect",
    connection_id="stdio-server",
    transport="stdio",
    command="python",
    args=["mcp_server_stdio.py"]
)

# List tools from connection
mcp_client(action="list_tools", connection_id="my-server")

# Call a tool
mcp_client(
    action="call_tool",
    connection_id="my-server",
    tool_name="calculator",
    tool_args={"expression": "2 + 2"}
)

# List all connections
mcp_client(action="list_connections")

# Disconnect
mcp_client(action="disconnect", connection_id="my-server")

Notes: - stdio transport: Server must be launchable as subprocess - HTTP transport: Server must be already running - Connections are maintained in global state for reuse

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform - "connect", "disconnect", "list_tools", "call_tool", "list_connections"
connection_idNoUnique identifier for this connection
transportNoTransport type - "http", "stdio", or "sse"
server_urlNoURL for HTTP/SSE transport (e.g., "http://localhost:8000/mcp")
commandNoCommand for stdio transport (e.g., "python")
argsNoArguments for stdio command (e.g., ["mcp_server_stdio.py"])
tool_nameNoName of tool to call (for call_tool action)
tool_argsNoArguments to pass to tool (for call_tool action)
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. It discloses important behavioral traits: the tool maintains connections in global state for reuse, returns a result dictionary with status and content, and specifies requirements for different transport types (stdio servers must be launchable as subprocess, HTTP servers must be already running). This covers key operational aspects beyond basic functionality.

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 appropriately sized and well-structured with clear sections (purpose, returns, examples, notes). Every sentence adds value, though the extensive examples section makes it longer than minimal. The information is front-loaded with the core purpose stated first.

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 the tool's complexity (8 parameters, multiple actions, no output schema), the description provides substantial context: purpose, return format, comprehensive examples, and operational notes. It covers most aspects needed to use the tool effectively, though additional details about error handling or the exact structure of the result dictionary would further enhance 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?

Schema description coverage is 100%, so the schema already documents all 8 parameters thoroughly. The description doesn't add significant meaning beyond what's in the schema descriptions, though the examples help illustrate parameter usage patterns. This meets the baseline expectation when schema does the heavy lifting.

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's purpose: 'Test and interact with MCP servers' and 'provides a complete MCP client implementation for testing and using MCP servers from within a Strands Agent.' This is specific (verb+resource) and distinguishes it from sibling tools like 'greet' and 'invoke_agent' which don't involve MCP server interaction.

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 provides clear context for when to use this tool (testing and interacting with MCP servers) and includes notes about transport-specific requirements (stdio vs. HTTP). However, it doesn't explicitly state when NOT to use it or mention alternatives to the tool itself, though the examples implicitly guide usage based on action types.

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/cagataycali/strands-mcp-server'

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