Skip to main content
Glama

list_sessions

Retrieve all active serial port terminal sessions to monitor connections and manage communication with UART devices.

Instructions

列出所有活动的终端会话

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool handler wrapper: calls terminal manager's list_sessions and formats response with count.
    def list_sessions() -> dict[str, Any]: """列出所有活动会话 Returns: 会话列表 """ manager = get_terminal_manager() sessions = manager.list_sessions() return {"sessions": sessions, "count": len(sessions)}
  • Input schema definition for the list_sessions tool (no parameters required).
    LIST_SESSIONS_TOOL: dict[str, Any] = { "name": "list_sessions", "description": "列出所有活动的终端会话", "inputSchema": { "type": "object", "properties": {}, "required": [], }, }
  • Registration of list_sessions tool in MCP server's list_tools handler.
    types.Tool( name=LIST_SESSIONS_TOOL["name"], description=LIST_SESSIONS_TOOL["description"], inputSchema=LIST_SESSIONS_TOOL["inputSchema"], ),
  • Dispatch logic in handle_call_tool for invoking list_sessions.
    elif name == "list_sessions": result = list_sessions()
  • Core implementation in TerminalManager: lists all sessions with their info.
    def list_sessions(self) -> list[dict[str, Any]]: """列出所有终端会话 Returns: 会话信息列表 """ with self._lock: return [session.get_info().to_dict() for session in self._sessions.values()]

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