list_adapters
List all configured health data adapters and view their authentication status to manage integrations.
Instructions
List all available health data adapters and their authentication status.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_adapters"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.py:497-549 (handler)The main handler for the list_adapters tool. It calls config.get_adapter_status() to get status of all adapters (whoop, strava), checks authentication status for enabled adapters, and formats a markdown response showing enabled/disabled/not-configured status for each adapter.
async def _handle_list_adapters(self, args: dict) -> list[TextContent]: """Handle list_adapters tool call.""" status = self.config.get_adapter_status() lines = [ "## Health Data Adapters", "", ] for adapter_name, info in status.items(): enabled = info["enabled"] configured = info["configured"] if enabled: # Check authentication status adapter = getattr(self, adapter_name, None) if adapter: try: is_auth = await adapter.is_authenticated() auth_status = "✅ Authenticated" if is_auth else "⚠️ Not authenticated" except Exception: auth_status = "❓ Unknown" else: auth_status = "❌ Not initialized" lines.append(f"### {adapter_name.title()}") lines.append(f"- Status: **Enabled**") lines.append(f"- Auth: {auth_status}") elif configured: lines.append(f"### {adapter_name.title()}") lines.append(f"- Status: **Disabled** (credentials configured but explicitly disabled)") else: lines.append(f"### {adapter_name.title()}") lines.append(f"- Status: **Not configured**") lines.append(f"- Add credentials to config.yaml to enable") lines.append("") # Add setup instructions if no adapters are enabled enabled_adapters = self.config.get_enabled_adapters() if not enabled_adapters: lines.extend([ "---", "**No adapters enabled.** To get started:", "", "1. Copy `config.example.yaml` to `config.yaml`", "2. Add your API credentials for at least one provider:", " - **Whoop:** https://developer.whoop.com/", " - **Strava:** https://www.strava.com/settings/api", "3. Restart the MCP server", ]) return [TextContent(type="text", text="\n".join(lines))] - src/server.py:419-425 (registration)Tool call routing in _register_tools(): routes 'list_adapters' name to _handle_list_adapters handler via the MCP call_tool decorator.
@self.server.call_tool() async def call_tool(name: str, arguments: dict) -> list[TextContent]: """Handle tool calls.""" try: # General tools if name == "list_adapters": return await self._handle_list_adapters(arguments) - src/server.py:390-401 (schema)Tool definition in _get_general_tools(): defines 'list_adapters' with no input parameters (empty inputSchema) and a description about listing adapters and their authentication status.
def _get_general_tools(self) -> list[Tool]: """Get general tools available regardless of adapters.""" return [ Tool( name="list_adapters", description="List all available health data adapters and their authentication status.", inputSchema={ "type": "object", "properties": {}, }, ), ] - src/server.py:406-417 (registration)Tool listing registration: _get_general_tools() is called in list_tools() to register list_adapters as a general tool available regardless of which adapters are enabled.
@self.server.list_tools() async def list_tools() -> list[Tool]: """List all available health tools based on enabled adapters.""" tools = self._get_general_tools() if self.whoop: tools.extend(self._get_whoop_tools()) if self.strava: tools.extend(self._get_strava_tools()) return tools - src/config.py:222-237 (helper)Helper function get_adapter_status() in Config class returns a dict with enabled/configured status for 'whoop' and 'strava' adapters, used by the list_adapters handler.
def get_adapter_status(self) -> dict[str, dict[str, Any]]: """Get status of all adapters. Returns: Dict mapping adapter names to their status info. """ return { "whoop": { "enabled": self.whoop_enabled, "configured": bool(self.whoop_client_id and self.whoop_client_secret), }, "strava": { "enabled": self.strava_enabled, "configured": bool(self.strava_client_id and self.strava_client_secret), }, }