get_server_config
Retrieve current Threat.Zone MCP Server configuration details including API URL, version, and connection status for monitoring and verification purposes.
Instructions
Get current server configuration including API URL and connection status.
Returns: Configuration details including API URL, version, and status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/threatzone_mcp/server.py:208-234 (handler)The get_server_config tool handler function, registered using the @app.tool decorator from FastMCP. It returns the server configuration including API URL, version, API key status, and tests the connection to the ThreatZone API by fetching user info if possible.@app.tool async def get_server_config() -> Dict[str, Any]: """ Get current server configuration including API URL and connection status. Returns: Configuration details including API URL, version, and status """ config = { "api_url": API_BASE_URL, "version": "0.1.0", "api_key_configured": bool(API_KEY and len(API_KEY) > 10) } # Test connection if API key is available if config["api_key_configured"]: try: user_info = await get_client().get("/public-api/me") config["connection_status"] = "connected" config["workspace"] = user_info.get("userInfo", {}).get("workspace", {}).get("name", "Unknown") except Exception as e: config["connection_status"] = "failed" config["error"] = str(e) else: config["connection_status"] = "no_api_key" return config