Skip to main content
Glama

Grant permission

grant_permission
Idempotent

Grant a runtime permission to an Android app via adb to skip the in-app permission dialog and let automated tests drive straight to the feature.

Instructions

Grant a runtime permission to an app (pm grant), e.g. android.permission.CAMERA — skips the in-app permission dialog so you can drive straight to the feature.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "package": "<package>",
      "permission": "<permission>"
    },
    "name": "grant_permission"
  }
}

Input Schema

NameRequiredDescriptionDefault
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.
packageYesApplication package name.
permissionYesFull permission name, e.g. android.permission.CAMERA.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare idempotentHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds one genuinely useful behavioral fact: the operation changes app permission state silently, bypassing the in-app dialog. It omits prerequisites such as the permission needing to be declared in the manifest, the runtime-permission API level requirement, or whether the app must be restarted to observe the change.

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?

A single front-loaded sentence: verb+resource first, then mechanism, then the practical benefit. No filler and no repetition of schema content.

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

Completeness3/5

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

For a three-parameter mutation tool with no output schema, the description covers what it does and why but leaves out call-affecting prerequisites (manifest declaration, API level, whether the app must be installed/running) and the fact that the change is undone via revoke_permission. Adequate but with clear gaps.

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%, so package, permission and serial are already documented in the schema, including the same android.permission.CAMERA example. The description adds no meaning beyond that, which is the baseline 3 case.

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

Purpose4/5

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

The description gives a specific verb and resource ("Grant a runtime permission to an app") plus the concrete mechanism ("pm grant") and an example permission value. The grant/revoke distinction against the sibling revoke_permission is implicit in the verb but the sibling is never named, so this falls just short of full sibling differentiation.

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?

The clause "skips the in-app permission dialog so you can drive straight to the feature" tells the agent exactly why and when to reach for this tool instead of driving the permission UI with tap/tap_on_text. It stops short of explicit exclusions (e.g. non-runtime permissions, or when to prefer revoke_permission to undo the change).

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