[ { "description": "List the files and folders in a folder (relative to the work folder unless absolute).", "name": "list_dir", "parameters": { "properties": { "path": { "description": "Folder to list; empty means the work folder.", "type": "string" } }, "required": [], "type": "object" } }, { "description": "In the person's own indexed document folders (their 設定 › 一般 › 文件索引), find the passages that answer a question, by meaning as well as words. Use it for 「我上個月那份報表在哪」, 「我寫過的語法筆記」 — questions about THEIR files, not about the computer. Returns the file path and the text of each match.", "name": "search_documents", "parameters": { "properties": { "limit": { "description": "How many passages (default 6).", "type": "integer" }, "query": { "description": "What to look for, in a sentence.", "type": "string" } }, "required": [ "query" ], "type": "object" } }, { "description": "Find text in files under a folder. Returns matching lines as path:line:text.", "name": "search", "parameters": { "properties": { "files_only": { "description": "Only list the files that match.", "type": "boolean" }, "path": { "description": "Folder or file to search; empty means the work folder.", "type": "string" }, "pattern": { "description": "Text to look for (regular expression when ripgrep is installed).", "type": "string" } }, "required": [ "pattern" ], "type": "object" } }, { "description": "Read a text file. Lines come back numbered.", "name": "read_file", "parameters": { "properties": { "limit": { "description": "How many lines to read.", "type": "integer" }, "offset": { "description": "First line to read (1-based).", "type": "integer" }, "path": { "type": "string" } }, "required": [ "path" ], "type": "object" } }, { "description": "Change a file. Replaces old_text (which must appear exactly once) with new_text. With empty old_text the file is created or overwritten with new_text.", "name": "edit_file", "parameters": { "properties": { "new_text": { "type": "string" }, "old_text": { "type": "string" }, "path": { "type": "string" } }, "required": [ "path", "new_text" ], "type": "object" } }, { "description": "Run a shell command in the work folder (bash or sh; on a Windows computer Git Bash when it is there, else PowerShell). Its input is closed, so nothing waits for typing: use a program's non-interactive form (flags like -y/--yes; coding agents' print mode, e.g. `claude -p \"…\"`, `pi-bolt -p \"…\"`, `codex exec \"…\"`, `gemini -p \"…\"`). If it runs longer than timeout_ms it keeps running in the background and you get a terminal id to check with read_terminal (pass the same computer to read_terminal/write_terminal). interactive=true runs it in a real terminal instead (互動終端機): for a program that needs one — its own full-screen interface, questions to answer, an editor; you see its screen and type with write_terminal.", "name": "shell", "parameters": { "properties": { "command": { "type": "string" }, "interactive": { "description": "Run in a real terminal you can see and type into (default false).", "type": "boolean" }, "timeout_ms": { "description": "How long to wait before moving it to the background (default 30000). Interactive: how long to wait for its first screen (at most 15000).", "type": "integer" } }, "required": [ "command" ], "type": "object" } }, { "description": "Look at a background command: its latest output, or a 互動終端機's screen. wait_ms waits (up to 120000) until it shows something new and goes quiet, or until the text in `until` appears, or it ends — instead of checking again and again.", "name": "read_terminal", "parameters": { "properties": { "id": { "type": "integer" }, "until": { "description": "Return as soon as this text is on the screen / in the output.", "type": "string" }, "wait_ms": { "type": "integer" } }, "required": [ "id" ], "type": "object" } }, { "description": "Type into a 互動終端機 (a command started with interactive=true): text (each new line presses Enter) and/or keys, then see its screen once it settles (wait_ms, default 4000, up to 120000). close=true sends Ctrl-D. A plain command's input is closed: it can't be typed into.", "name": "write_terminal", "parameters": { "properties": { "close": { "type": "boolean" }, "id": { "type": "integer" }, "input": { "description": "Text to type; a new line presses Enter.", "type": "string" }, "keys": { "description": "Keys to press after the text: enter, tab, shift-tab, esc, backspace, delete, space, up, down, left, right, home, end, pageup, pagedown, ctrl-c, ctrl-d (any ctrl-letter).", "items": { "type": "string" }, "type": "array" }, "stop": { "description": "true: end this background command (plain or interactive) and everything it started. Do this for the ones you no longer need.", "type": "boolean" }, "wait_ms": { "type": "integer" } }, "required": [ "id" ], "type": "object" } } ]