Skip to main content
Glama

read_output

Retrieve content from terminal output buffers in UART serial sessions, with options to clear after reading for continuous data monitoring.

Instructions

读取终端输出缓冲区的内容

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes会话ID(即串口路径),如 /dev/ttyUSB0 或 COM1
clearNo读取后是否清空缓冲区

Implementation Reference

  • The core handler function for the 'read_output' tool. It retrieves the terminal manager and calls its read_output method with the provided session_id and clear flag.
    def read_output( session_id: str, clear: bool = True, ) -> dict[str, Any]: """读取终端输出缓冲区内容 Args: session_id: 会话ID(串口路径) clear: 是否清空缓冲区 Returns: 输出内容 """ manager = get_terminal_manager() return manager.read_output(session_id=session_id, clear=clear)
  • The schema definition for the 'read_output' tool, including input schema with session_id (required) and optional clear parameter.
    READ_OUTPUT_TOOL: dict[str, Any] = { "name": "read_output", "description": "读取终端输出缓冲区的内容", "inputSchema": { "type": "object", "properties": { "session_id": { "type": "string", "description": "会话ID(即串口路径),如 /dev/ttyUSB0 或 COM1", }, "clear": { "type": "boolean", "description": "读取后是否清空缓冲区", "default": True, }, }, "required": ["session_id"], }, }
  • Registration of the 'read_output' tool in the MCP server's list_tools() handler.
    types.Tool( name=READ_OUTPUT_TOOL["name"], description=READ_OUTPUT_TOOL["description"], inputSchema=READ_OUTPUT_TOOL["inputSchema"], ),
  • Dispatch logic in the MCP server's call_tool() handler that invokes the read_output function.
    elif name == "read_output": result = read_output(**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