Skip to main content
Glama
rahulkr
by rahulkr

get_battery_stats

Retrieve detailed battery statistics from Android devices to monitor power consumption and health during development and testing workflows.

Instructions

Get detailed battery statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_serialNo

Implementation Reference

  • The main handler function for the 'get_battery_stats' tool. It executes 'adb shell dumpsys battery', parses the output into a dictionary of key-value pairs, and returns it. Registered via @mcp.tool() decorator.
    @mcp.tool()
    def get_battery_stats(device_serial: str | None = None) -> dict:
        """Get detailed battery statistics"""
        output = run_adb(["shell", "dumpsys", "battery"], device_serial)
        
        stats = {}
        for line in output.split('\n'):
            if ':' in line:
                key, value = line.split(':', 1)
                stats[key.strip()] = value.strip()
        
        return stats
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states it 'gets' statistics (implying read-only), but doesn't specify whether this requires special permissions, affects device state, has rate limits, or what format the statistics are returned in. The description is minimal and lacks important behavioral context.

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?

The description is extremely concise at just 4 words. It's front-loaded with the core purpose and contains no unnecessary verbiage. Every word earns its place.

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

Completeness2/5

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

For a device monitoring tool with no annotations, no output schema, and undocumented parameters, the description is insufficient. It doesn't explain what statistics are returned, their format, whether this works for all devices, or any limitations. The minimal description leaves too many questions unanswered.

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

Parameters2/5

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

With 0% schema description coverage for the single parameter (device_serial), the description provides no information about parameters. It doesn't mention the optional device_serial parameter at all, leaving the agent to guess when and how to use it.

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

Purpose3/5

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

The description 'Get detailed battery statistics' clearly states the verb ('Get') and resource ('battery statistics'), but it's vague about what constitutes 'detailed' statistics. It doesn't differentiate from potential sibling tools like get_cpu_info or get_memory_info beyond the battery focus.

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?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of prerequisites, timing considerations, or comparison to other device monitoring tools in the sibling list.

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/rahulkr/r_adb_mcp_server'

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