Skip to main content
Glama

set_device_lock

Set a PIN, pattern, or password lock screen on an Android device. Required before using AndroidKeyStore-backed crypto; prevents "secure lock screen required" errors on fresh emulators.

Instructions

Set a secure lock screen (type: pin [default], pattern, or password). REQUIRED before AndroidKeyStore / Keystore-backed crypto flows, which fail with 'A secure lock screen is required' on a fresh emulator that has no lock. Follow with is_device_secure to confirm.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoLock type: pin (default), pattern, or password.
valueYesCredential to set, e.g. "1234".
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.
old_valueNoThe CURRENT credential, required only when a lock is already set and you want to change it (locksettings refuses to overwrite otherwise).
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Discloses failure mode for fresh emulators and the condition for old_value. Lacks explicit mention of side effects such as device lock screen change requiring credential for subsequent operations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two efficient sentences with no redundancy. Front-loaded with the action, then adds critical usage context. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and missing annotations, description covers purpose, prerequisite, and follow-up. However, it does not hint at return value or result of setting lock, slightly incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and schema already describes all parameters well. Description adds context about Keystore necessity but does not significantly augment parameter understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Set a secure lock screen' with specific lock types (pin, pattern, password) and explains its necessity for Keystore flows, distinguishing it from siblings like clear_device_lock and is_device_secure.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when it is required ('REQUIRED before AndroidKeyStore / Keystore-backed crypto flows') and recommends a follow-up action ('Follow with is_device_secure to confirm'). It does not contrast with alternatives like clear_device_lock, but the usage context is strong.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/iksnerd/adb-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server