read_output
Reads a specified output stream from an execution, returning selected lines with slice-style ranges so you can inspect stdout, stderr, results, or tracebacks.
Instructions
读取一个 execution 的指定输出流。
选择与流
execution 的选择规则与 execution_status 相同。stream
只能为 combined、stdout、stderr、result 或
traceback。
行坐标
line_range 形如切片 start:stop:两端都是行号,都含在范围内,
端点都可以省略,省略即到边界,所以 : 就是整个流。:10 读前
10 行,-10: 读后 10 行,2:4 读第 2 到第 4 行,3:3 只读第 3 行。
负数按行号从尾部数,两端照样都含::-3 是到倒数第三行为止,不是去掉
末三行。所选范围的全部行一次返回,不必切成连续的小段。
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "read_output"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stream | No | 输出流;默认 ``combined``,其余值为 ``stdout``、``stderr``、 ``result`` 与 ``traceback``。 | combined |
| execution | No | 要读取的正整数执行编号。省略时使用当前记录,随后 使用最近记录。 | |
| max_chars | No | 每个返回行允许显示的最大字符数;必须为正数。超出 部分只在响应中裁切,不改变已保存文本或行坐标。 | |
| line_range | No | 行坐标 ``start:stop``,与切片同形;两端都含, ``:`` 是整条流。 |