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: [] }

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