MCP server implementation for XiaoZhi ESP32 device firmware, providing tools for device control including audio, display, camera, and interaction modes
This ESP32 firmware MCP server has moderate structural issues that significantly impact LLM usability. While tool names follow verb_noun patterns (get_, set_, take_), parameter descriptions are largely absent, schemas lack enum constraints for enumerated values, and output structures are undocumented. The server appears to be STDIO-only (embedded firmware), which limits remote accessibility. Tool definitions are registered in main/mcp_server.cc but parameter details are sparse. Error handling and recovery guidance are not evident in the provided code.
Set the volume of the audio speaker. If the current volume is unknown, you must call `self.get_device_status` tool first and then call this tool.
Always remember you have a camera. If the user asks you to see something, use this tool to take a photo and then explain it. Args: `question`: The question that you want to ask about the photo. Return: A JSON object that provides the photo information.
Provides the real-time information of the device, including the current status of the audio speaker, screen, battery, network, etc. Use this tool for: 1. Answering questions about current condition (e.g. what is the current volume of the audio speaker?) 2. As the first step to control the device (e.g. turn up / down the volume of the audio speaker, etc.)
Get the system information
Reboot the system
Parameter descriptions are missing or minimal. Tools like `self.screen.set_theme`, `self.get_system_info`, `self.screen.get_info` have descriptions but no documentation of what each parameter means or its valid values.
Enumerated parameters lack enum constraints in schemas. `self.screen.set_theme` accepts 'light' or 'dark' and `self.set_press_to_talk` accepts 'press_to_talk' or 'click_to_talk', but these are declared as free-form strings rather than enums. This invites LLM hallucination of invalid values.
Output schemas are not documented. Tools like `self.get_device_status`, `self.get_system_info`, and `self.camera.take_photo` return data but the structure of returned fields is not visible in the source code provided. LLMs cannot plan downstream tool calls without knowing what fields are available.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 56 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 0 | - | v1 |
Information about the screen, including width, height, etc.
Set the brightness of the screen.
Set the theme of the screen. The theme can be `light` or `dark`.
Snapshot the screen and upload it to a specific URL
Switch between press to talk mode (长按说话) and click to talk mode (单击说话). The mode can be `press_to_talk` or `click_to_talk`.
Upgrade firmware from a specific URL. This will download and install the firmware, then reboot the device.
Destructive and irreversible operations (`self.reboot`, `self.upgrade_firmware`) lack confirmation/dry-run support. There is no evidence of a two-step confirmation pattern that would prevent catastrophic agent errors.
Error handling and recovery guidance not evident. The provided code does not show how errors are communicated to the LLM or what the LLM should do if a tool call fails (retry, fallback, ask user, etc.).
Tool descriptions are inconsistent in detail and guidance. Some tools (e.g., `self.audio_speaker.set_volume`, `self.camera.take_photo`) include usage hints or context, while others (e.g., `self.get_system_info`) are minimal stubs. Descriptions should consistently answer WHAT, WHEN, and WHAT-NEXT.
Parameter type annotations are missing descriptions. The `volume` parameter (0 - 100 integer) in `self.audio_speaker.set_volume` has type and range but no description of the unit (percentage assumed) or semantics (does 0 mean mute?). Similarly, `brightness` in `self.screen.set_brightness` and `quality` in `self.screen.snapshot` lack semantic documentation.