Skip to main content
Glama

system_get_battery_status

Retrieve current battery level and charging status from macOS devices to monitor power information and manage system resources.

Instructions

[System control and information] Get battery level and charging status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • AppleScript implementation that retrieves battery status using the 'pmset -g batt' shell command.
      name: "get_battery_status",
      description: "Get battery level and charging status",
      script: `
            try
              set powerSource to do shell script "pmset -g batt"
              return powerSource
            on error errMsg
              return "Failed to get battery status: " & errMsg
            end try
          `,
    },
  • Dynamically generates the tool list for MCP, constructing tool names as '{category.name}_{script.name}' (e.g., 'system_get_battery_status') from registered categories and scripts.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: this.categories.flatMap((category) =>
        category.scripts.map((script) => ({
          name: `${category.name}_${script.name}`, // Changed from dot to underscore
          description: `[${category.description}] ${script.description}`,
          inputSchema: script.schema || {
            type: "object",
            properties: {},
          },
        })),
      ),
    }));
  • src/index.ts:25-25 (registration)
    Registers the 'system' category (containing 'get_battery_status') with the MCP server.
    server.addCategory(systemCategory);
  • Generic tool execution handler that resolves the tool name to category/script, generates/runs the AppleScript, and returns the result.
    const result = await this.executeScript(scriptContent);
    
    this.log("info", "Tool execution completed successfully", { 
      tool: toolName,
      resultLength: result.length
    });
    
    return {
      content: [
        {
          type: "text",
          text: result,
        },
      ],
    };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Get') but doesn't clarify if this requires permissions, how frequently it can be called, what the return format looks like, or potential side effects. This leaves significant gaps for a system tool.

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 with a single sentence that front-loads the key information ('Get battery level and charging status'). There is no wasted text, and the bracketed prefix '[System control and information]' efficiently categorizes the tool without verbosity.

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?

Given the tool's low complexity (0 parameters, no output schema) and the description's clear purpose, it is minimally adequate. However, the lack of annotations and output schema means the description should ideally provide more behavioral context (e.g., return format, permissions), which is missing, keeping it at a baseline level.

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?

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the input requirements. The description doesn't need to add parameter details, and it appropriately avoids redundancy, earning a baseline score for zero-parameter tools.

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 clearly states the tool's purpose with specific verbs ('Get') and resources ('battery level and charging status'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'system_get_frontmost_app' or 'system_volume', which prevents a perfect score.

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 or in what context it should be invoked. It lacks any mention of prerequisites, timing considerations, or comparisons to other system tools, leaving usage entirely implicit.

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/joshrutkowski/applescript-mcp'

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