---
name: android-bluetooth
description: Inspect Android Bluetooth state and perform bounded BLE client operations through GATT services and characteristics. Use for Bluetooth power, paired devices, BLE discovery, connection, inspection, read, write, and disconnect tasks.
---

# Android Bluetooth

Use `bluetooth` for Bluetooth state and BLE client tasks.

## Actions

- `status`: inspect adapter state and the single active BLE connection.
- `set_power`: request and verify the Bluetooth power state.
- `open_settings`: open Android Bluetooth settings.
- `paired_list`: list bonded Bluetooth devices.
- `ble_scan`: discover nearby BLE devices.
- `ble_connect`: connect one device and discover its GATT services.
- `ble_inspect`: list service UUIDs, characteristic UUIDs, and supported properties.
- `ble_read`: read one characteristic.
- `ble_write`: write one characteristic after user confirmation.
- `ble_disconnect`: close the active GATT connection.

## BLE Workflow

1. Check `status`; enable Bluetooth if needed.
2. Use `ble_scan`, or select a known device from `paired_list`.
3. Use `ble_connect` with the returned address.
4. Use `ble_inspect` before reading or writing.
5. Use only service and characteristic UUIDs returned by `ble_inspect`.
6. Disconnect when the task is complete.

Only one BLE GATT connection can be active. Disconnect it before connecting another device.

## Value Rules

- `ble_read` always returns `value_hex`. It also returns `value_utf8` only when the complete byte sequence is valid UTF-8.
- `ble_write` requires `encoding=hex|utf8`. Hex must contain complete byte pairs.
- Prefer `write_type=auto`. Select another write type only when the device documentation requires it.
- A write without response reports `device_acknowledged=false`; this means Android started the write but the device did not acknowledge it through GATT.

Never invent BLE command bytes, register values, or device protocol meanings. Write only when the user supplies the value or a trusted device protocol/profile skill defines it. Generic characteristic names or UUIDs are not enough evidence for a device command.

## Safety and Result Truth

- Every `ble_write` requires user confirmation before bytes are sent.
- A settings or pairing flow is not a successful connection. Success requires a verified active GATT connection.
- `connection_not_verified` means setup may have completed, but the device is not connected.
- Permission, cancellation, timeout, unsupported property, and GATT status failures are explicit results. Do not describe them as success.

## Scope

The generic tool does not provide Classic Bluetooth sockets, multiple simultaneous connections, background reconnect, notification subscriptions, descriptor operations, bonding control, or device-specific value decoding. Use Android settings for pairing and device management.


---
Source attribution: ModalityDance
Original project: https://github.com/ModalityDance/PalmClaw
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Gabriel Moreira

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: ModalityDance
Original project: https://github.com/ModalityDance/PalmClaw
Attribution basis: Upstream repository explicitly recorded in package mirror path

Fields of work: Development & Engineering
Roles: Backend Developer, Mobile Developer
Specialties: Mobile
Tools: Bluetooth
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 91fd2ed682568d27bb776252ec40500eca32a7a1d9cf231f77be33cc9e53fa9e
