Skip to main content
Glama

get_device_list

Retrieve a list of connected Ecovacs robot vacuums to identify available devices for cleaning, charging, or status monitoring tasks.

Instructions

Query robot list

Returns: Dict: Dictionary containing list of robot nicknames

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function implementing the 'get_device_list' tool logic. Decorated with @mcp.tool() for registration in the MCP server. Calls the shared call_api helper with the specific device list endpoint to retrieve the list of devices.
    @mcp.tool()
    async def get_device_list() -> dict:
        """
        Query robot list
    
        Returns:
            Dict: Dictionary containing list of robot nicknames
        """
        return await call_api(ENDPOINT_ROBOT_DEVICE_LIST, {}, method='get')
  • Helper constant defining the API endpoint specifically used by the get_device_list tool.
    ENDPOINT_ROBOT_DEVICE_LIST = "robot/deviceList"
  • Shared helper function used by get_device_list (and other tools) to make authenticated HTTP requests to the Ecovacs API.
    async def call_api(endpoint: str, params: dict, method: str = 'post') -> dict:
        """
        General API call function
        
        Args:
            endpoint: API endpoint
            params: Request parameters
            method: Request method, 'get' or 'post'
        
        Returns:
            Dict: API response result, format {"msg": "OK", "code": 0, "data": [...]}
        """
        # Build complete URL
        url = f"{API_URL}/{endpoint}"
        
        # Ensure all parameters are strings
        params = {k: str(v) for k, v in params.items()}
        
        # Add API key
        if API_KEY:
            params.update({"ak": API_KEY})
        
        try:
            async with httpx.AsyncClient() as client:
                headers = {"Content-Type": "application/json"}
                if method.lower() == 'get':
                    response = await client.get(url, params=params, timeout=REQUEST_TIMEOUT)
                else:
                    response = await client.post(url, json=params, headers=headers, timeout=REQUEST_TIMEOUT)
                
                response.raise_for_status()
                return response.json()
        
        except Exception as e:
            # Return unified error format when an error occurs
            return {"msg": f"Request failed: {str(e)}", "code": -1, "data": []}
  • The @mcp.tool() decorator registers the get_device_list function as an MCP tool in the FastMCP server.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool returns a dictionary of robot nicknames, which implies a read-only operation, but doesn't disclose behavioral traits like authentication needs, rate limits, error handling, or whether it's a safe operation. The description is minimal and lacks crucial context for an agent to understand how it behaves beyond basic output.

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

Conciseness4/5

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

The description is very concise with two short sentences: 'Query robot list' and 'Returns: Dict: Dictionary containing list of robot nicknames'. It's front-loaded with the purpose and efficiently states the return type. However, it could be slightly more structured by clarifying the tool's role relative to siblings, but it earns high marks for brevity and lack of waste.

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

Completeness3/5

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

Given the tool has 0 parameters, no annotations, and no output schema, the description provides minimal but adequate context for a simple query tool. It states what the tool does and the return format, but lacks details on behavioral aspects like safety or usage guidelines. For a tool with no structured data, it meets the minimum viable threshold but has clear gaps in completeness.

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 parameter documentation is needed. The description doesn't add parameter info, which is appropriate here. Baseline is 4 for zero parameters, as the schema fully covers the absence of inputs, and the description doesn't need to compensate.

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

Purpose3/5

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

The description states 'Query robot list' which indicates the tool retrieves robot information, but it's vague about what specific data is returned beyond 'list of robot nicknames'. It doesn't distinguish from sibling tools like get_work_state, set_charging, or set_cleaning, which have different purposes. The description provides a basic purpose but lacks specificity about scope or differentiation.

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

Usage Guidelines2/5

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

There is no guidance on when to use this tool versus alternatives. The description doesn't mention prerequisites, context, or exclusions. It fails to explain how this tool relates to siblings like get_work_state (which might provide status info) or set_charging/set_cleaning (which are mutation tools). No explicit or implied usage scenarios are provided.

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/ecovacs-ai/ecovacs-mcp'

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