GetTextAroundCursorTool

Reads the text surrounding the cursor via InputConnection.getTextBeforeCursor / getTextAfterCursor. Requires the droid-mcp IME to be active with an editor focused, else imeNotActiveError. Android does not mask password fields for the active IME — the keyboard can read whatever is in the field — so this tool enforces the guard itself: when the bound editor's EditorInfo.inputType is a password variation (text PASSWORD, VISIBLE_PASSWORD, WEB_PASSWORD, or number PASSWORD; see isPasswordInputType) it refuses with the short-form error password_field. Output: before and after strings (empty if the editor has no more text in that direction).

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard
open override val annotations: ToolAnnotations
Link copied to clipboard
open override val description: String
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val outputSchema: Map<String, Any>
Link copied to clipboard
open override val parameters: List<ToolParameter>

Functions

Link copied to clipboard
open suspend override fun execute(params: Map<String, Any>): ToolResult