Skip to main content
Glama
cfrs2005

GS Robot MCP Server

by cfrs2005

list_robot_commands

Retrieve and view historical commands sent to a GS cleaning robot by serial number, with pagination support for managing command history.

Instructions

Lists historical commands sent to a robot.

Args:
    serial_number: The serial number of the target robot.
    page: Page number (default: 1).
    page_size: Number of items per page (default: 10).

Returns:
    A dictionary containing the historical commands list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serial_numberYes
pageNo
page_sizeNo

Implementation Reference

  • MCP tool handler for 'list_robot_commands'. This decorated function is the entry point invoked by the MCP server when the tool is called. It delegates to the underlying GausiumMCP instance.
    @mcp.tool()
    async def list_robot_commands(serial_number: str, page: int = 1, page_size: int = 10):
        """Lists historical commands sent to a robot.
    
        Args:
            serial_number: The serial number of the target robot.
            page: Page number (default: 1).
            page_size: Number of items per page (default: 10).
    
        Returns:
            A dictionary containing the historical commands list.
        """
        return await mcp.list_robot_commands(serial_number=serial_number, page=page, page_size=page_size)
  • Core helper method implementing the list_robot_commands logic in the GausiumMCP class. Uses GausiumAPIClient to call the 'list_commands' API endpoint.
    async def list_robot_commands(
        self,
        serial_number: str,
        page: int = 1,
        page_size: int = 10
    ) -> Dict[str, Any]:
        """
        获取机器人历史发出指令。
    
        Args:
            serial_number: 机器人序列号
            page: 页码,默认1
            page_size: 每页数量,默认10
    
        Returns:
            历史指令列表
    
        Raises:
            ValueError: 序列号为空
            httpx.HTTPStatusError: API调用错误
            httpx.RequestError: 网络问题
        """
        if not serial_number:
            raise ValueError("Serial number cannot be empty")
    
        async with GausiumAPIClient() as client:
            return await client.call_endpoint(
                'list_commands',
                path_params={'serial_number': serial_number},
                query_params={
                    'page': page,
                    'pageSize': page_size
                }
            )
  • Registration of the MCP tool via @mcp.tool() decorator, which registers the handler with the MCP server.
    @mcp.tool()
    async def list_robot_commands(serial_number: str, page: int = 1, page_size: int = 10):
        """Lists historical commands sent to a robot.
    
        Args:
            serial_number: The serial number of the target robot.
            page: Page number (default: 1).
            page_size: Number of items per page (default: 10).
    
        Returns:
            A dictionary containing the historical commands list.
        """
        return await mcp.list_robot_commands(serial_number=serial_number, page=page, page_size=page_size)
  • API endpoint configuration for 'list_commands' used by the GausiumAPIClient, with name 'list_robot_commands'.
    'list_commands': APIEndpoint(
        name="list_robot_commands",
        path="robots/{serial_number}/commands",
        method=HTTPMethod.GET,
        version=APIVersion.V1_ALPHA1,
        description="获取机器人历史发出指令"
    )

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/cfrs2005/mcp-gs-robot'

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