get_session_info
Retrieve detailed information about a specific serial port session by providing its session ID, such as /dev/ttyUSB0 or COM1, to monitor connection status and parameters.
Instructions
获取指定终端会话的详细信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | 会话ID(即串口路径),如 /dev/ttyUSB0 或 COM1 |
Implementation Reference
- src/uart_mcp/tools/terminal.py:103-114 (handler)The handler function that implements the core logic of the 'get_session_info' tool by calling the terminal manager's get_session_info method.def get_session_info(session_id: str) -> dict[str, Any]: """获取会话详细信息 Args: session_id: 会话ID(串口路径) Returns: 会话信息 """ manager = get_terminal_manager() return manager.get_session_info(session_id)
- The input schema definition for the 'get_session_info' tool used in MCP registration.GET_SESSION_INFO_TOOL: dict[str, Any] = { "name": "get_session_info", "description": "获取指定终端会话的详细信息", "inputSchema": { "type": "object", "properties": { "session_id": { "type": "string", "description": "会话ID(即串口路径),如 /dev/ttyUSB0 或 COM1", }, }, "required": ["session_id"], }, }
- src/uart_mcp/server.py:128-132 (registration)Registration of the 'get_session_info' tool in the MCP server's list_tools handler.types.Tool( name=GET_SESSION_INFO_TOOL["name"], description=GET_SESSION_INFO_TOOL["description"], inputSchema=GET_SESSION_INFO_TOOL["inputSchema"], ),
- src/uart_mcp/server.py:173-174 (registration)Dispatch to the 'get_session_info' handler in the MCP server's call_tool method.elif name == "get_session_info": result = get_session_info(**arguments)
- No, wrong. Wait, helper is the manager call, but to fix.CLEAR_BUFFER_TOOL: dict[str, Any] = { "name": "clear_buffer", "description": "清空指定终端会话的输出缓冲区", "inputSchema": { "type": "object", "properties": { "session_id": { "type": "string", "description": "会话ID(即串口路径),如 /dev/ttyUSB0 或 COM1", }, }, "required": ["session_id"], }, }