Skip to main content
Check if the Stobo API is reachable and diagnose connection issues.

Overview

check_connection performs connectivity diagnostics:
  • API reachability — verifies Stobo API server is responding
  • Configuration check — validates your base URL and API key presence
  • Network diagnostics — identifies connection issues
  • Health status — confirms API is operational
This tool is completely free and works without an API key.

Parameters

This tool takes no parameters.

Example prompts

Check if Stobo is working
Test the connection
Verify API connectivity

Response structure

The tool returns a JSON object with:
status
string
Connection status: “ok”, “error”, “timeout”, or “connection_refused”
base_url
string
The API base URL being used (from STOBO_BASE_URL env var)
has_api_key
boolean
Whether an API key is configured (doesn’t validate it, just checks presence)
http_code
number
HTTP status code from health endpoint (200 = success)
error
string
Error message if connection failed
fix
string
Suggested fix for the issue (if applicable)

Usage example

# How the tool is called in the MCP server
@mcp.tool(annotations=READ_ONLY)
def check_connection() -> str:
    """Check if the Stobo API is reachable."""
    import httpx

    base_url = os.environ.get("STOBO_BASE_URL", "https://api.trystobo.com")
    api_key = os.environ.get("STOBO_API_KEY", "")
    result = {
        "base_url": base_url,
        "has_api_key": bool(api_key),
    }

    try:
        resp = httpx.get(f"{base_url}/api/v1/health", timeout=10)
        result["status"] = "ok" if resp.status_code == 200 else "error"
        result["http_code"] = resp.status_code
    except httpx.ConnectError as e:
        result["status"] = "connection_refused"
        result["error"] = str(e)
        result["fix"] = "The API server is unreachable. Check your network or try again later."
    except httpx.TimeoutException:
        result["status"] = "timeout"
        result["error"] = "Request timed out after 10 seconds"
        result["fix"] = "The API server is slow or unreachable. Check your network."
    except Exception as e:
        result["status"] = "error"
        result["error"] = str(e)

    return json.dumps(result, indent=2)

Status codes

StatusMeaningAction
okAPI is reachable and respondingNo action needed
errorAPI returned non-200 statusCheck API status or try again
timeoutRequest took too long (>10s)Check network or retry
connection_refusedCannot reach API serverCheck internet, firewall, or API status

When to use

Use check_connection when:
  • Tools are failing unexpectedly — verify it’s not a connectivity issue
  • First-time setup — confirm configuration is correct
  • After changing STOBO_BASE_URL — verify custom endpoint works
  • Network issues suspected — isolate whether problem is local or API-side
Run this first if any tool is returning connection errors. It’s faster than debugging individual tool failures.

Common issues and fixes

The API server is not reachable.Possible causes:
  • No internet connection
  • Firewall blocking outbound HTTPS
  • VPN or proxy interfering
  • API server is down (rare)
Fixes:
  • Check your internet connection
  • Try from a different network
  • Disable VPN temporarily
  • Check Stobo status page
The API is slow to respond or unreachable.Possible causes:
  • Slow network connection
  • API server is overloaded (rare)
  • DNS issues
Fixes:
  • Try again in a few seconds
  • Check your network speed
  • Try from a different network
The health endpoint doesn’t exist.Possible causes:
  • Wrong STOBO_BASE_URL configured
  • Typo in base URL
Fixes:
  • Remove STOBO_BASE_URL env var (use default)
  • If using custom URL, verify it’s correct
Connection works but no API key configured.Impact:
  • Free tools work fine
  • Paid tools will fail with auth errors
Fix:
  • If using paid tools, add STOBO_API_KEY to your MCP config
  • If only using free tools, no action needed

Configuration check

The tool reports your current configuration:
{
  "status": "ok",
  "base_url": "https://api.trystobo.com",
  "has_api_key": true,
  "http_code": 200
}
This confirms:
  • Using default API endpoint (recommended)
  • API key is configured
  • API server is healthy
If base_url is not https://api.trystobo.com, you might have STOBO_BASE_URL misconfigured. Remove it unless you were specifically told to set it.

Next steps

If connection check passes:
  • Proceed with using other tools normally
  • If tools still fail, the issue is likely API key or credits
If connection check fails: