test_mcp_server
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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The MCP server ID or slug to test |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded and returned structured data | |
| data | No | Structured success payload when ok is true | |
| error | No | Structured error payload when ok is false |
Implementation Reference
- src/tools/mcp-servers.tools.ts:266-281 (registration)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), }, ], }; }, ); - src/tools/mcp-servers.tools.ts:51-53 (schema)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"), }, - src/tools/mcp-servers.tools.ts:270-280 (handler)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"; }