Skip to main content
Glama

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
NameRequiredDescriptionDefault
session_idYes会话ID(即串口路径),如 /dev/ttyUSB0 或 COM1

Implementation Reference

  • 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"],
        },
    }
  • 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"],
    ),
  • 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)

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