Skip to content

Tools and arguments ​

This page covers common calls and tool families. The current source defines the complete schema. JSON below represents tool argument objects, not commands the user must type manually.

Open
View on GitHub

Workspace files ​

ToolRequired argumentsNotes
list_directorypath. is the root
read_filepathText file up to 1 MB
read_file_linespathOptional start_line, line_count; files up to 16 MB
write_filepathCreate/replace with exactly one of content, content_lines
edit_filepathExact text or line-range edit after reading context
append_filepathAppend using the same content rules
create_folderpathCreate inside workspace
rename_movefrom, toMove/rename inside workspace
delete_file_or_folderpathDelete a file or empty directory
search_filesquery, pathName, extension or path-fragment search
get_file_infopathMetadata

Use workspace-relative paths. content_lines is an array of strings, not a serialized array. ensure_trailing_newline controls the final newline. Distinguish replacement from editing existing files.

json
{"path":"hello.txt","content_lines":["Hello, Lyra Code!"],"ensure_trailing_newline":true}

Exact editing uses old_content/new_content or matching _lines arrays. The default expects one match; use expected_replacements explicitly when needed. Range mode uses inclusive, one-based start_line and end_line; do not mix locator modes.

json
{"path":"hello.txt","old_content":"Hello, Lyra Code!","new_content":"Verified.","expected_replacements":1}

global_* shared-storage tools have separate scope, paths and permissions. Other apps' private data and restricted directories remain inaccessible.

Commands ​

ToolEnvironment and arguments
proot_commandRequired linux_id; command through command or command_lines; optional workDir, timeout_seconds, background
run_commandExternal Termux; same command/options without linux_id
ssh_execConfigured SSH machine; obtain a real ID from list_ssh_servers first
execute_shell_commandRequires actual Shizuku Shell capability
execute_root_commandRequires configured and working Root execution

Replace the placeholder with an enabled Linux ID:

json
{
  "linux_id": "REPLACE_WITH_ENABLED_LINUX_ID",
  "command_lines": ["pwd", "printf 'ready\\n'"],
  "workDir": "/root",
  "timeout_seconds": 60,
  "background": false
}

Foreground timeout defaults to 60 seconds and is capped at 600. Use background=true for persistent services, then inspect the output file and health. Working-directory paths belong to the selected environment; Android, PRoot and Termux-private paths are not interchangeable.

Other families ​

CapabilityCommon entriesRule
Web/downloadweb_search, read_web_page, download_fileVerify original sources, targets and optional hashes
TODO/schedulingset_todo_list, update_todo_item, manage_scheduled_tasksTODOs do not schedule execution
History/memoryHistory search/read, read_memories, save_memoryRead relevant scope; obtain IDs before updates
Skillslist_skill_files, read_skill_fileCheck applicability, then read entry/references
Remote servicesSSH, email, WebDAV, transfers, MCPObtain real configuration IDs and verify destinations
Local services/datamanage_mini_server, read_mini_server_logs, export_backup, import_backupCheck live state, backup contents and restore mode
Devicedevice_get_capabilities and session toolsRequire the intended device session and capabilities

Results ​

Ordinary built-in tools generally use lyra_tool_output_v2: inspect ok, error, content and file_changes. Nested content may contain command output or another structured result; continue to exit codes, stderr or actual service health. Scoped/device tools can use their own result formats.

Rejected approval, disabled tools, invalid paths and bad arguments mean unfinished work. Address the cause before continuing and do not report these operations as completed.

Lyra Code. All rights reserved.