Skip to main content
Glama

Google Calendar MCP Server

by Ahmed-AG
test_mcp_queries.pyโ€ข1.8 kB
#!/usr/bin/env python3 """ Test MCP server queries to demonstrate functionality """ import asyncio import json from mcp_server import CalendarMCPServer async def test_mcp_queries(): """Test different MCP query types""" print("๐Ÿงช Testing MCP Calendar Server Queries") print("=" * 50) # Initialize the MCP server server = CalendarMCPServer() await server.calendar_service.initialize() # Test queries test_cases = [ { "name": "Natural Language Query - Today", "tool": "query_calendar", "args": {"query": "What's on my schedule today?"} }, { "name": "Natural Language Query - This Week", "tool": "query_calendar", "args": {"query": "Show me this week's appointments"} }, { "name": "Get Upcoming Events", "tool": "get_upcoming_events", "args": {"max_results": 5, "days_ahead": 14} } ] for test_case in test_cases: print(f"\n๐Ÿ“‹ {test_case['name']}") print("-" * 30) try: # Call the appropriate handler if test_case['tool'] == 'query_calendar': result = await server._handle_calendar_query(test_case['args']) elif test_case['tool'] == 'get_upcoming_events': result = await server._handle_upcoming_events(test_case['args']) else: continue # Print the result for content in result: print(content.text) except Exception as e: print(f"โŒ Error: {e}") print("\nโœ… MCP Server testing completed!") if __name__ == "__main__": asyncio.run(test_mcp_queries())

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/Ahmed-AG/mcp-test'

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