We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Swathi3255/13-MCP-session'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
test_mcp_tools.pyโข1.2 KiB
#!/usr/bin/env python3
"""
Quick test script to verify MCP tools work correctly
"""
from server import mcp
import asyncio
async def test_tools():
"""Test all three MCP tools"""
print("๐งช Testing MCP Tools...\n")
# Test 1: Crypto Price (doesn't need API key)
print("1๏ธโฃ Testing get_crypto_price...")
try:
from server import get_crypto_price
result = get_crypto_price("bitcoin")
print(f"โ Result: {result}\n")
except Exception as e:
print(f"โ Error: {e}\n")
# Test 2: Dice Roller
print("2๏ธโฃ Testing roll_dice...")
try:
from server import roll_dice
result = roll_dice("2d20k1")
print(f"โ Result: {result}\n")
except Exception as e:
print(f"โ Error: {e}\n")
# Test 3: Web Search (needs Tavily API key)
print("3๏ธโฃ Testing web_search...")
try:
from server import web_search
result = web_search("What is Python?")
print(f"โ Result preview: {result[:200]}...\n")
except Exception as e:
print(f"โ Error: {e}\n")
print("๐ก Note: Make sure TAVILY_API_KEY is set in .env\n")
if __name__ == "__main__":
asyncio.run(test_tools())