Skip to main content
Glama

Grant a runtime permission

grant_permission
DestructiveIdempotent

Grant a runtime permission to an Android app via ADB so it can access protected resources such as camera, location, or microphone.

Instructions

Grant a runtime permission to an app (pm grant <package> <permission>). Destructive: it changes the permissions the app holds; revoke_permission reverses it. Only changeable runtime permissions work; on stock Android these can be granted to non-debuggable apps too, though some restricted permissions still reject the shell.

Input Schema

NameRequiredDescriptionDefault
deviceNoDevice serial from list_devices; optional when exactly one device is connected.
packageYesPackage name, e.g. "com.example.app".
permissionYesPermission name, e.g. "android.permission.CAMERA".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, so the safety profile is covered. The description adds real value beyond that: what changes (the permissions the app holds), that revoke reverses it, and that restricted permissions still reject the shell even on stock Android.

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?

Three short sentences, front-loaded with the action and CLI form, then the destructive/reversal note, then the edge-case constraint. No filler.

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?

Covers the mutation, its inverse, and the main failure condition for a tool with no output schema. Return behavior is unspecified but not essential here; the description is otherwise complete for correct invocation.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds the `pm grant <package> <permission>` invocation, which maps the two required params to their CLI positions, plus the constraint that the permission must be a changeable runtime permission — meaningful semantics for the permission argument.

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?

States a specific verb+resource ('Grant a runtime permission to an app') and immediately names the reversing sibling, revoke_permission. An agent can distinguish it from the other adb tools without opening the schema.

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 names revoke_permission as the inverse operation and states the precondition that only changeable runtime permissions work. It doesn't spell out a when-not-to-use case (e.g., when to prefer shell), but the routing context is clear.

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