Skip to main content
Glama
JackXuyi

Current operating environment

getBatteryInfo

Retrieve battery status and details for the current device, including charge level and power source, to monitor system power conditions.

Instructions

获取当前设备的电池信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'getBatteryInfo' tool. It calls si.battery() from the systeminformation library to fetch battery details and returns the JSON-stringified result.
    case "getBatteryInfo": {
      const batteryInfo = await si.battery();
      return {
        content: [{
          type: "text",
          text: JSON.stringify(batteryInfo, null, 2)
        }]
      };
  • src/index.ts:191-198 (registration)
    Registration of the 'getBatteryInfo' tool in the tools list, including name, description, and input schema (empty object). This is returned by the list tools handler.
      name: "getBatteryInfo",
      description: "获取当前设备的电池信息",
      inputSchema: {
        type: "object",
        properties: {},
        required: []
      }
    },
  • Input schema for 'getBatteryInfo' tool: an empty object with no required properties.
    inputSchema: {
      type: "object",
      properties: {},
      required: []
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It implies a read-only operation ('获取' means get) but doesn't disclose if it requires permissions, has side effects, rate limits, or error conditions. For a tool with zero annotation coverage, this leaves critical behavioral traits unspecified.

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 a single, efficient sentence in Chinese that directly states the tool's function without any fluff. It's front-loaded with the core purpose and wastes no words, making it ideal for quick comprehension by an AI agent.

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 simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. It states what data is retrieved but lacks details on return format, error handling, or system dependencies. For a basic read operation, it's passable but could be more informative about the output structure.

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 lack of inputs. The description doesn't need to add parameter details, and it correctly implies no inputs are required by not mentioning any. This meets the baseline 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 '获取当前设备的电池信息' (Get current device battery information) clearly states the verb '获取' (get) and resource '电池信息' (battery information), making the purpose unambiguous. It distinguishes from siblings like getCpuInfo or getMemoryInfo by specifying battery data. However, it doesn't explicitly mention what specific battery information is retrieved (e.g., level, status, health), keeping it from 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. It doesn't mention prerequisites, timing considerations, or compare it to other battery-related tools (none exist in siblings). The agent must infer usage from the name alone, which is insufficient for optimal tool selection.

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/JackXuyi/env-mcp'

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