Skip to main content
Glama

get_status

Retrieve the current status and configuration of an open serial port, including active settings, to quickly diagnose connection issues.

Instructions

获取已打开串口的当前状态和配置信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portYes串口路径

Implementation Reference

  • The 'get_status' handler function - the MCP tool entry point. It delegates to SerialManager.get_status() and returns the result as a dict.
    def get_status(port: str) -> dict[str, Any]:
        """获取串口状态
    
        Args:
            port: 串口路径
    
        Returns:
            串口状态信息
        """
        manager = get_serial_manager()
        status = manager.get_status(port)
        return status.to_dict()
  • The GET_STATUS_TOOL schema definition - registers the tool's name, description, and input schema (requires 'port' string parameter).
    GET_STATUS_TOOL: dict[str, Any] = {
        "name": "get_status",
        "description": "获取已打开串口的当前状态和配置信息",
        "inputSchema": {
            "type": "object",
            "properties": {
                "port": {
                    "type": "string",
                    "description": "串口路径",
                },
            },
            "required": ["port"],
        },
    }
  • Tool registration in handle_list_tools - registers 'get_status' as an available MCP tool with its schema.
    types.Tool(
        name=GET_STATUS_TOOL["name"],
        description=GET_STATUS_TOOL["description"],
        inputSchema=GET_STATUS_TOOL["inputSchema"],
    ),
  • Tool dispatch in handle_call_tool - routes the 'get_status' tool name to the get_status() handler function.
    elif name == "get_status":
        result = get_status(**arguments)
  • SerialManager.get_status() - the underlying implementation that looks up the managed port and returns a PortStatus dataclass.
    def get_status(self, port: str) -> PortStatus:
        """获取串口状态
    
        Args:
            port: 串口路径
    
        Returns:
            串口状态
    
        Raises:
            PortClosedError: 串口未打开
        """
        with self._lock:
            if port not in self._ports:
                raise PortClosedError(port)
    
            managed = self._ports[port]
            return PortStatus(
                port=port,
                is_open=True,
                config=managed.config,
                connected=managed.is_connected,
                reconnecting=managed.reconnecting,
            )
Behavior3/5

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

No annotations provided, so the description bears full burden. It mentions 'status and configuration' but does not disclose behavioral traits like read-only nature, failure modes (e.g., if port not open), or idempotency. Adequate but minimal.

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

Conciseness5/5

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

Single sentence, no unnecessary words. The structure is efficient and front-loaded with the key action and resource.

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?

No output schema, so the description should hint at what the response contains. It does not. For a tool with one parameter, it is moderately complete but lacks details on the return value. Sibling context is diverse, so more guidance on output would help.

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?

Schema coverage is 100% (one parameter described as '串口路径'). The description adds that the port must be already open, which is not in the schema. This adds meaningful context beyond the parameter description.

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 indicates the action (获取, get) and the resource (已打开串口的当前状态和配置信息, current status and configuration of opened serial port). It distinguishes from sibling tools like list_ports, open_port, etc., which have distinct purposes.

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

Usage Guidelines3/5

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

The description implies the tool is for opened ports ('已打开串口'), but it does not explicitly state when to use this versus alternatives, nor does it mention prerequisites (e.g., port must be open). Usage guidance is only implied.

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/donnel666/uart-mcp'

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