Tool Reference
About 872 wordsAbout 3 min
The model in chat reads and writes the device through local tools, starts escalation chains, and manages kernel profiles and run logs. There are two classes: read-only calls run directly; execution tools change device state, and their descriptions tell the model to explain before calling.
The list is grouped by area. Names are the function names the model sees.
Device state
| Tool | Returns |
|---|---|
get_device_info | Model, OS version, kernel version, security patch, baseband, build number, SOTA, API level, CPU ABI, SELinux, app version |
get_root_status | rooted |
get_adb_status | The usb and wifi switches |
get_adb_status reports system switches only; it does not mean the shell is connected. Use adb_shell_exec for that.
ADB shell
| Tool | Parameters | Behavior |
|---|---|---|
adb_shell_exec | command (required), timeoutMs | Runs one command in the uid 2000 session and returns exit code, stdout, stderr, duration, and timeout flag |
adb_pairing_request | none | Renders a pairing panel in chat; suspends while disconnected |
timeoutMs ranges from 1000 to 120000 with a 30000 default. Each stream is capped at 8000 characters, keeping the tail and prefixing the number of dropped characters — failures usually appear in the last lines.
When the session is not connected, adb_shell_exec returns connected=false instead of failing, and the model calls adb_pairing_request. Pairing must be completed by the user tapping the button and entering the code in the notification.
Web and search
| Tool | Parameters | Notes |
|---|---|---|
open_in_browser | url | Opens the page in the system or in-app browser |
web_search | query, count, market | Bing search returning titles, URLs, and snippets |
fetch_web_page | url, maxChars | Downloads page source with status code and content type |
count ranges 1–20, default 8; market is zh-CN (default) or en-US. Search returns snippets, not full pages.
maxChars ranges 1000–60000, default 12000. The response includes statusCode, so a 403 or captcha page can be recognized rather than treated as content.
Escalation queries (read-only)
| Tool | Returns |
|---|---|
escalation_get_device_identity | Device model, vendor, and kernel identity |
escalation_list_payloads | The bundled payload catalog |
escalation_resolve_payload | The payload matched to this device |
escalation_list_root_managers | Installed managers providing libksud.so |
escalation_get_selected_root_manager | The currently selected manager |
Escalation actions
| Tool | Parameters | Behavior |
|---|---|---|
escalation_run_payload | none | Matches a payload and writes its launch command into the terminal |
escalation_run_payload_by_id | payloadId | Runs a specific payload |
escalation_handoff_root | packageName (optional) | Hands temporary root to a manager; defaults to the selected one |
escalation_select_root_manager | packageName | Preference only; no device state change |
GhostLock
| Tool | Parameters | Behavior |
|---|---|---|
ghost_lock_preflight | none | Checks ADB, shell uid, seccomp, release, profile match, route, native binary, ksud path, profile encoding |
ghost_lock_start | managerPackage, safeMode | Starts a run and returns a session id |
ghost_lock_status | sessionId (optional) | Latest snapshot of that run |
ghost_lock_cancel | sessionId | Stops local reading; device processes are not signalled |
DirtyFrag
| Tool | Behavior |
|---|---|
dirty_frag_is_armed | Whether this boot was already injected |
dirty_frag_get_run_defaults | Reads soft reboot, VR disarm, auto offset |
dirty_frag_save_run_defaults | Writes those defaults |
dirty_frag_get_expert_mode / dirty_frag_set_expert_mode | Read and toggle expert mode |
dirty_frag_get_boot_autostart / dirty_frag_set_boot_autostart | Read and toggle boot autostart |
dirty_frag_get_vr_progress | VR offset derivation progress |
dirty_frag_derive_vr_offset | Extracts the VR offset from an image or OTA |
dirty_frag_start | Starts a run and returns a session id |
dirty_frag_status | Run snapshot |
dirty_frag_cancel | Stops local reading |
GhostKey
| Tool | Parameters | Notes |
|---|---|---|
ghost_key_preflight | none | Checks ADB, shell identity, seccomp, payload binary, profile hit |
ghost_key_get_run_defaults | none | Reads "take over KernelSU" and "accept degraded offset" |
ghost_key_save_run_defaults | those fields | Writes them |
ghost_key_start | managerPackage and others | Starts a run and returns a session id |
ghost_key_status | sessionId | Stage progress and final state |
ghost_key_cancel | sessionId | Stops local reading |
GhostLock kernel profiles
The ghost_lock_* group covers the full editing flow:
| Area | Tools |
|---|---|
| Listing and reading | ghost_lock_list_imported_profiles, ghost_lock_list_builtin_releases, ghost_lock_read_imported_profile, ghost_lock_get_profile_config, ghost_lock_list_extracted_images |
| Parsing | ghost_lock_probe_profile, ghost_lock_get_probe_progress |
| Writing | ghost_lock_save_profile, ghost_lock_import_profile_text, ghost_lock_rename_imported_profile, ghost_lock_remove_imported_profile, ghost_lock_convert_imported_profile |
| Export | ghost_lock_export_imported_profile, ghost_lock_export_local_file, ghost_lock_render_profile, ghost_lock_export_profile |
| Active source | ghost_lock_get_active_source, ghost_lock_select_source |
| Field edits | ghost_lock_update_general_fields, ghost_lock_update_advanced_fields, ghost_lock_update_route, ghost_lock_update_fallback, ghost_lock_reset_profile |
| Edit sessions | ghost_lock_begin_edit_session, ghost_lock_get_edit_session, ghost_lock_reload_edit_session, ghost_lock_commit_edit_session, ghost_lock_save_edit_session_in_place, ghost_lock_save_edit_session_as_new, ghost_lock_export_edit_session, ghost_lock_end_edit_session |
| Direct writes | ghost_lock_save_modified_profile, ghost_lock_overwrite_profile |
GhostKey kernel profiles and OTA
| Tool | Notes |
|---|---|
kernel_profile_list_imported / kernel_profile_list_builtin | User and built-in lists |
kernel_profile_read_content / kernel_profile_read_editor | Raw document and editor fields |
kernel_profile_get_active_selection | Active user profile or built-in release |
kernel_profile_import_start / kernel_profile_import_status / kernel_profile_import_cancel | Asynchronous import from an image or OTA |
kernel_profile_save_editor / kernel_profile_save_editor_as | Overwrite or save as a new document |
kernel_profile_render_editor | Renders the editor draft |
kernel_profile_select_user_profile / kernel_profile_select_builtin_release | Set the active source |
kernel_profile_remove | Delete a user profile |
ota_list_catalog | Built-in OTA catalog (Pixel, realme) |
Run logs
| Tool | Notes |
|---|---|
run_log_list_runs | List all records |
run_log_read_body | Read one record's full output |
run_log_diagnose | Produce a diagnosis for that run |
run_log_export_all | Export all records as text |
run_log_delete | Delete one record |
run_log_clear_all | Delete every record |
run_log_delete and run_log_clear_all delete local files directly with no second confirmation; clearing keeps the record currently being written.
Confirmation and suspension
Three mechanisms are worth separating:
| Mechanism | Behavior |
|---|---|
| Session suspension | When a tool result carries awaitsUser: true, the UI renders the matching component and pauses local execution; the same turn resumes after the user finishes. Currently only adb_pairing_request reaches this path |
| Asking permission | Execution tool descriptions tell the model to explain before acting. This is a constraint on the model, not an extra UI dialog |
| UI confirmation | The dialog with risk notes lives on the manual escalation page and is triggered by buttons, not by chat |
open_in_browser does not suspend: it renders a web card in chat and the user decides whether to open it.