Skip to main content
Glama

list_sessions

Retrieve active terminal sessions for serial port communication, enabling monitoring and management of connected devices through the UART server.

Instructions

列出所有活动的终端会话

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `list_sessions` function implements the core tool logic. It retrieves the terminal manager and returns a dictionary containing the list of active sessions and their count.
    def list_sessions() -> dict[str, Any]: """列出所有活动会话 Returns: 会话列表 """ manager = get_terminal_manager() sessions = manager.list_sessions() return {"sessions": sessions, "count": len(sessions)}
  • The `LIST_SESSIONS_TOOL` dictionary defines the tool's name, description, and input schema (no required parameters).
    LIST_SESSIONS_TOOL: dict[str, Any] = { "name": "list_sessions", "description": "列出所有活动的终端会话", "inputSchema": { "type": "object", "properties": {}, "required": [], }, }
  • Registration of the `list_sessions` tool in the `handle_list_tools` function, providing it to the MCP server.
    types.Tool( name=LIST_SESSIONS_TOOL["name"], description=LIST_SESSIONS_TOOL["description"], inputSchema=LIST_SESSIONS_TOOL["inputSchema"], ),
  • Dispatch logic in `handle_call_tool` that invokes the `list_sessions` handler when the tool is called.
    elif name == "list_sessions": result = list_sessions()

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