Skip to main content
Glama
cbxss
by cbxss

stop_app

Force stop an Android app by package name to terminate its process. Ideal for testing app behavior under forced termination or clearing app state during security analysis.

Instructions

Force stop an app by package name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageYesApp package name to stop
device_idNoDevice ID (optional)

Implementation Reference

  • The actual handler function for stop_app. It executes 'adb shell am force-stop <package>' via subprocess and returns a dict with package, stopped=True, and the command output.
    def stop_app(package: str, device_id: str | None = None) -> dict:
        """Force stop an app."""
        output = adb_shell(["am", "force-stop", package], device_id)
        return {"package": package, "stopped": True, "output": output}
  • The tool definition / input schema for stop_app. Defines name, description, and inputSchema requiring 'package' (string) with optional 'device_id' (string).
    Tool(
        name="stop_app",
        description="Force stop an app by package name",
        inputSchema={
            "type": "object",
            "properties": {
                "package": {"type": "string", "description": "App package name to stop"},
                "device_id": {"type": "string", "description": "Device ID (optional)"},
            },
            "required": ["package"],
        },
    ),
  • The dispatcher registration that routes the 'stop_app' tool name to the adb.stop_app() implementation function.
    elif name == "stop_app":
        return adb.stop_app(arguments["package"], arguments.get("device_id"))
  • Test for the stop_app helper/adb function. Verifies it calls 'adb shell am force-stop' with the package and returns stopped=True.
    def test_stop_app_calls_force_stop(self):
        with patch("objection_mcp.server._adb_shell") as mock:
            mock.return_value = ""
    
            from objection_mcp.server import stop_app
            result = stop_app("com.test.app")
    
            mock.assert_called_with(["am", "force-stop", "com.test.app"], None)
            assert result["stopped"] is True
Behavior2/5

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

With no annotations, the description only says 'force stop', implying abrupt termination without detailing side effects, permissions, or return behavior.

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?

Single sentence, no wasted words, efficiently conveys the core action.

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?

Minimally complete for a simple tool, but lacks information on success/failure response or potential outcomes (e.g., if app is not running).

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 coverage is 100%, so the schema already describes both parameters. The description adds only 'package name' context, offering no additional meaning 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 the action (Force stop) and resource (app) with the identifier (package name). It is distinct from sibling tools like launch_app or list_apps.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives. No prerequisites or context for appropriate usage is provided.

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/cbxss/frida-mcp'

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