Skip to main content
Glama
FOX2920

WeWork MCP Server

by FOX2920

test_connection

Verify connectivity to the WeWork API to check service status and ensure data access for project management tasks.

Instructions

Test kết nối với WeWork API

Returns:
    Thông tin về trạng thái kết nối

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'test_connection' MCP tool. It tests the connection to WeWork API by checking client initialization and fetching projects. Decorated with @mcp.tool() for registration.
    @mcp.tool()
    def test_connection() -> Dict[str, Any]:
        """
        Test kết nối với WeWork API
        
        Returns:
            Thông tin về trạng thái kết nối
        """
        try:
            if not wework_client:
                return {
                    'success': False,
                    'error': 'WeWork client not initialized',
                    'token_available': bool(WEWORK_ACCESS_TOKEN)
                }
            
            logger.info("Testing WeWork API connection")
            projects = wework_client.fetch_projects()
            
            return {
                'success': True,
                'connection_status': 'Connected',
                'projects_count': len(projects) if projects else 0,
                'token_available': bool(WEWORK_ACCESS_TOKEN),
                'sample_projects': [p.get('name', 'Unknown') for p in (projects[:3] if projects else [])]
            }
            
        except Exception as e:
            logger.error(f"Error in test_connection: {e}")
            return {
                'success': False,
                'error': str(e),
                'token_available': bool(WEWORK_ACCESS_TOKEN)
            }

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/FOX2920/Aplus-MCP'

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