Skip to main content
Glama
handsomejustin

Xiaomi smart home MCP server

get_ble_sensor

Retrieve real-time temperature, humidity, and device details from Xiaomi Bluetooth sensors using a device ID. Monitor environmental conditions for smart home automation.

Instructions

获取蓝牙传感器的最新温湿度数据和设备详情。

Args:
    did: BLE 设备ID,如 blt.3.xxxxx

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
didYes

Implementation Reference

  • The MCP tool handler for 'get_ble_sensor'. It accepts a BLE device ID (did) and sends a GET request to /ble/devices/{did} to retrieve the latest temperature/humidity data and device details.
    @mcp.tool()
    async def get_ble_sensor(did: str) -> dict:
        """获取蓝牙传感器的最新温湿度数据和设备详情。
    
        Args:
            did: BLE 设备ID,如 blt.3.xxxxx
        """
        return await _request("GET", f"/ble/devices/{quote(did)}")
  • The tool is registered via the @mcp.tool() decorator on line 164, which registers it as a FastMCP tool named 'get_ble_sensor'.
    @mcp.tool()
    async def get_ble_sensor(did: str) -> dict:
        """获取蓝牙传感器的最新温湿度数据和设备详情。
    
        Args:
            did: BLE 设备ID,如 blt.3.xxxxx
        """
        return await _request("GET", f"/ble/devices/{quote(did)}")
Behavior2/5

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

No annotations are provided, and the description does not disclose behavior beyond being a read operation. It does not mention side effects, authorization needs, or limitations, relying solely on the minimal 'get the latest data' phrasing.

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 short and includes an Args section, making it structured and easy to parse. It is concise with no redundant information, though it could benefit from a bit more detail without losing brevity.

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 simple nature of the tool (1 required parameter, no output schema), the description covers the basics. However, it lacks details on return format, error conditions, or what '设备详情' includes, leaving some ambiguity for the agent.

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

Parameters3/5

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

The input schema has one required parameter with 0% schema description coverage. The description adds an example format ('blt.3.xxxxx') for the 'did' parameter, which adds meaning beyond the schema. However, no further details like validation rules or acceptable values are given.

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

Purpose5/5

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

The description clearly states the tool retrieves the latest temperature, humidity, and device details for a BLE sensor. This distinguishes it from siblings like get_ble_readings (likely more general) and get_device (general device).

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?

No guidance on when to use this tool versus alternatives is provided. The description only states what it does without mentioning exclusions or alternative tools, leaving the agent without context for selection.

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/handsomejustin/mijia-control'

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