Skip to main content
Glama
Dinesh-Satram

Health & Fitness Coach MCP

test-tool-discovery.mjs1.64 kB
#!/usr/bin/env node import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"; import { spawn } from "child_process"; async function testToolDiscovery() { console.log("Testing MCP Tool Discovery...\n"); const serverUrl = process.argv[2] || "https://agent-engineering-bootcamp-mcp.vercel.app/mcp"; console.log(`Testing server: ${serverUrl}\n`); try { const transport = new StdioClientTransport({ command: "npx", args: ["-y", "@modelcontextprotocol/server-everything", serverUrl], }); const client = new Client( { name: "test-tool-discovery", version: "1.0.0", }, { capabilities: {}, } ); await client.connect(transport); console.log("✅ Connected to MCP server\n"); console.log("📋 Listing available tools:"); const toolsResponse = await client.listTools(); if (toolsResponse.tools.length === 0) { console.log("❌ No tools found!"); } else { console.log(`✅ Found ${toolsResponse.tools.length} tools:\n`); toolsResponse.tools.forEach((tool, index) => { console.log(`${index + 1}. ${tool.name}`); console.log(` Description: ${tool.description}`); console.log( ` Input Schema: ${JSON.stringify(tool.inputSchema, null, 2)}` ); console.log(""); }); } await client.close(); } catch (error) { console.error("❌ Error:", error.message); if (error.cause) { console.error("Cause:", error.cause); } } } testToolDiscovery();

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/Dinesh-Satram/fitness_coach_MCP'

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