get_session_info
Retrieve detailed information about a specific serial port terminal session by providing its session ID, such as /dev/ttyUSB0 or COM1.
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 main handler function for the 'get_session_info' tool. It retrieves the terminal manager and calls its get_session_info method with the provided session_id.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 schema definition for the 'get_session_info' tool, including name, description, and inputSchema used for 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/routing logic in the MCP server's call_tool handler that invokes the get_session_info function.elif name == "get_session_info": result = get_session_info(**arguments)