ContactsTools

Provider for the contacts tool module. Wires up SearchContactsTool, ReadContactTool, ListContactsTool, CreateContactTool, UpdateContactTool and DeleteContactTool, which query and edit via ContactsContract.

The read tools need only READ_CONTACTS, so that is all requiredPermissions reports — a host with read-only contacts access still gets the read surface. The write tools are gated inside all: they are registered only when WRITE_CONTACTS is also granted (mirroring how CalendarTools gates its write tools).

Functions

Link copied to clipboard
fun all(context: Context): List<McpTool>

Contacts McpTools for the current grant state: read tools always, the write tools only with WRITE_CONTACTS.

Link copied to clipboard

True if all requiredPermissions are currently granted.

Link copied to clipboard

Permissions needed to register this module at all: READ_CONTACTS (write access is gated per tool in all).

Link copied to clipboard

Contacts by id as MCP resources; register with DroidMcp.Builder.addResourceProvider.