Package-level declarations

Types

Link copied to clipboard
class BrowseFilesTool(context: Context) : McpTool

Lists the immediate contents of a directory, sandboxed to external storage via PathValidator (defaults to /sdcard). Directories sort first, then by name. Requires READ_EXTERNAL_STORAGE on API ≤32; uses File API access on API 33+. Output: path, entries (each {name, path, size_bytes, last_modified, is_directory}, size_bytes is null for directories) capped at the limit param, and count.

Link copied to clipboard
object FilesTools

Provider for the sandboxed file tools (BrowseFilesTool, ReadFileTool, SearchFilesTool). All paths are confined to external storage by PathValidator.

Link copied to clipboard
class ReadFileTool(context: Context) : McpTool

Reads a text file's content, sandboxed to external storage via PathValidator. Files with an unrecognized extension are scanned for null bytes in the first 8 KB and rejected as binary if any are found. Output is truncated to the max_lines param. Requires READ_EXTERNAL_STORAGE on API ≤32; uses File API access on API 33+. Output: path, content (newline-joined lines), lines_returned, truncated.

Link copied to clipboard
class SearchFilesTool(context: Context) : McpTool

Recursively searches for files and directories whose name contains a case-insensitive substring, sandboxed to external storage via PathValidator (defaults to /sdcard). Recursion is capped at depth 5; unreadable directories are skipped silently. Requires READ_EXTERNAL_STORAGE on API ≤32; uses File API access on API 33+. Output: query, search_path, results (each {name, path, size_bytes, last_modified, is_directory}) capped at the limit param, and count.