Skip to main content
Glama

test_mcp_server

Read-only

Test connectivity to an MCP server by sending a live check. Returns success, response time, HTTP status, and error details.

Instructions

Test connectivity to an MCP server. Sends a live check and returns success, response time, HTTP status, and any error; use this before changing configuration or when diagnosing reachability.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe MCP server ID or slug to test

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the tool call succeeded and returned structured data
dataNoStructured success payload when ok is true
errorNoStructured error payload when ok is false

Implementation Reference

  • The tool 'test_mcp_server' is registered on the MCP server via server.tool() with its schema and handler callback.
    server.tool(
    	"test_mcp_server",
    	"Test connectivity to an MCP server. Sends a live check and returns success, response time, HTTP status, and any error; use this before changing configuration or when diagnosing reachability.",
    	MCP_SERVERS_TOOL_SCHEMAS.testMcpServer,
    	async (params) => {
    		const result = await service.mcpServers.testMcpServer(params.id);
    		return {
    			content: [
    				{
    					type: "text",
    					text: JSON.stringify(formatMcpServerTest(result), null, 2),
    				},
    			],
    		};
    	},
    );
  • Input schema for test_mcp_server: requires a single 'id' (string) parameter describing the MCP server ID or slug to test.
    testMcpServer: {
    	id: z.string().describe("The MCP server ID or slug to test"),
    },
  • Handler function that calls service.mcpServers.testMcpServer(params.id) and formats the result using formatMcpServerTest.
    async (params) => {
    	const result = await service.mcpServers.testMcpServer(params.id);
    	return {
    		content: [
    			{
    				type: "text",
    				text: JSON.stringify(formatMcpServerTest(result), null, 2),
    			},
    		],
    	};
    },
  • Helper function formatMcpServerTest that transforms the TestMcpServerResponse into a formatted object for the tool output.
    function formatMcpServerTest(result: TestMcpServerResponse): {
    	success: boolean;
    	server_name?: string;
    	url?: string;
    	status_code?: number;
    	response_time_ms?: number;
    	error?: string;
    } {
    	return {
    		success: result.success,
    		server_name: result.server_name,
    		url: result.url,
    		status_code: result.status_code,
    		response_time_ms: result.response_time_ms,
    		error: result.error,
    	};
    }
  • The TestMcpServerResponse interface defining the response structure from the API call.
    export interface TestMcpServerResponse {
    	success: boolean;
    	error?: string;
    	url?: string;
    	server_name?: string;
    	status_code?: number;
    	response_time_ms?: number;
    	object: "mcp-server";
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is clear. The description adds operational specifics (live check, HTTP status) but does not reveal additional behavioral traits like rate limits or concurrency.

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?

Two sentences, front-loaded with the primary action, followed by outcomes and use cases. No redundant words; every sentence earns its place.

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 and the presence of an output schema, the description adequately covers purpose, usage, and return fields. No gaps identified for a diagnostic tool.

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 sole parameter 'id' is fully described in the schema (100% coverage). The description adds context about the parameter's purpose (testing connectivity) but does not enhance the meaning beyond what the schema provides, leading to a baseline score of 3.

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 explicitly states the action (test connectivity), resource (MCP server), and outcomes (success, response time, HTTP status, error), clearly distinguishing it from sibling tools like create_mcp_server or get_mcp_server.

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 guidance: 'use this before changing configuration or when diagnosing reachability.' It lacks explicit exclusion criteria or alternative tools, but the context is sufficient for typical use.

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/s-b-e-n-s-o-n/portkey-admin-mcp'

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