Skip to main content
Glama
madorn
by madorn

list_devices

Discover all connected Bond Bridge smart home devices to manage ceiling fans, motorized shades, dimmable lights, and RF-controlled devices through comprehensive device listing.

Instructions

List all Bond devices connected to the bridge.

Returns: Dictionary containing all devices with their basic information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'list_devices' using FastMCP @mcp.tool() decorator. Lists Bond Bridge devices, transforms API response for readability, and handles BondAPIError and general exceptions.
    @mcp.tool()
    async def list_devices() -> Dict[str, Any]:
        """List all Bond devices connected to the bridge.
        
        Returns:
            Dictionary containing all devices with their basic information.
        """
        try:
            async with await get_bond_client() as client:
                devices_data = await client.list_devices()
                
                # Transform the data for better readability
                devices = {}
                for device_id, device_info in devices_data.items():
                    if not device_id.startswith('_'):  # Skip metadata
                        devices[device_id] = {
                            "id": device_id,
                            "name": device_info.get("name", "Unknown"),
                            "type": device_info.get("type", "Unknown"),
                            "location": device_info.get("location", "")
                        }
                
                return {
                    "devices": devices,
                    "total_count": len(devices)
                }
        except BondAPIError as e:
            return {"error": f"Failed to list devices: {str(e)}"}
        except Exception as e:
            logger.error(f"Unexpected error listing devices: {e}")
            return {"error": f"Unexpected error: {str(e)}"}
  • BondClient helper method that performs the HTTP GET request to the Bond Bridge API endpoint '/v2/devices' to retrieve the list of devices.
    async def list_devices(self) -> Dict[str, Any]:
        """List all devices connected to the Bond Bridge."""
        return await self._request("GET", "devices")
  • Underlying _request method in BondClient used by list_devices to make authenticated HTTP requests to the Bond Bridge API, with error handling and logging.
    async def _request(self, method: str, endpoint: str, **kwargs) -> Dict[str, Any]:
        """Make HTTP request to Bond API.
  • Factory function to create BondClient instance from configuration, used as context manager in the list_devices handler.
    async def get_bond_client() -> BondClient:
        """Get configured Bond client."""
        return BondClient(
            host=config.bond_host,
            token=config.bond_token,
            timeout=config.timeout
        )
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that the tool returns a dictionary with basic information, which is useful behavioral context. However, it doesn't mention potential limitations like rate limits, authentication needs, or whether the list is real-time or cached. The description doesn't contradict any annotations (since none exist), but it lacks depth for a tool that might have operational constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with only two sentences, front-loading the core purpose ('List all Bond devices connected to the bridge') and following with return details. Every sentence earns its place by clarifying the action and output, with zero wasted words. This is a model of efficiency for a simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (0 parameters, simple listing operation), the description is reasonably complete. It states what the tool does and what it returns. With an output schema available, the description doesn't need to detail return values extensively. However, for a tool with no annotations, it could benefit from more behavioral context (e.g., permissions or performance hints) to fully guide an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameters need documentation. The description doesn't add parameter details, which is appropriate here. It does mention the return type ('Dictionary containing all devices with their basic information'), which provides semantic value beyond the schema, though an output schema exists to cover this fully.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('Bond devices connected to the bridge'), making the purpose immediately understandable. It distinguishes this from siblings like 'get_device_info' (single device) and 'get_device_state' (state rather than listing), though it doesn't explicitly mention these distinctions. The description avoids tautology by not just repeating the tool name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying 'all Bond devices connected to the bridge,' suggesting this is for inventory purposes. However, it doesn't provide explicit guidance on when to use this versus alternatives like 'get_device_info' (for single device details) or 'get_bridge_info' (for bridge metadata). No exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/madorn/bond-mcp-server'

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