generate_task_report_png
Create a PNG map visualization for robot task reports to document cleaning routes and performance data for analysis.
Instructions
Generates a PNG map for M-line task report.
Args:
serial_number: The serial number of the target robot.
report_id: The ID of the task report.
Returns:
A dictionary containing the map generation result.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| serial_number | Yes | ||
| report_id | Yes |
Implementation Reference
- Core handler implementation for the generate_task_report_png MCP tool. Calls the Gausium API to generate the PNG report map.async def generate_task_report_png( self, serial_number: str, report_id: str ) -> Dict[str, Any]: """ M线任务报告地图生成。 Args: serial_number: 机器人序列号 report_id: 报告ID Returns: 地图生成结果 Raises: ValueError: 参数为空 httpx.HTTPStatusError: API调用错误 httpx.RequestError: 网络问题 """ if not serial_number: raise ValueError("Serial number cannot be empty") if not report_id: raise ValueError("Report ID cannot be empty") async with GausiumAPIClient() as client: return await client.call_endpoint( 'generate_task_report_png', path_params={ 'serial_number': serial_number, 'report_id': report_id } )
- src/gs_openapi/main.py:225-236 (registration)MCP tool registration using @mcp.tool() decorator. Defines the tool schema via parameters and docstring, delegates to the core handler.async def generate_task_report_png(serial_number: str, report_id: str): """Generates a PNG map for M-line task report. Args: serial_number: The serial number of the target robot. report_id: The ID of the task report. Returns: A dictionary containing the map generation result. """ return await mcp.generate_task_report_png(serial_number=serial_number, report_id=report_id)
- API endpoint configuration used by the GausiumAPIClient in the handler to call the correct path and method.'generate_task_report_png': APIEndpoint( name="generate_task_report_png", path="robots/{serial_number}/taskReports/{report_id}/map", method=HTTPMethod.GET, version=APIVersion.V1_ALPHA1, description="M线任务报告地图生成" ),