Skip to main content
Glama

System Sleep

system_sleep
Destructive

Put your Mac to sleep to conserve power and lock the screen.

Instructions

Put the Mac to sleep.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The tool handler for 'system_sleep'. It registers the tool with the MCP server, calls systemSleepScript() via runJxa, and returns the result { action: 'sleep', success: true }.
    server.registerTool(
      "system_sleep",
      {
        title: "System Sleep",
        description: "Put the Mac to sleep.",
        inputSchema: {},
        annotations: {
          readOnlyHint: false,
          destructiveHint: true,
          idempotentHint: false,
          openWorldHint: false,
        },
      },
      async () => {
        try {
          return ok(await runJxa<{ action: string; success: boolean }>(systemSleepScript()));
        } catch (e) {
          return errJxaFor("system sleep", e);
        }
      },
    );
  • Input schema for system_sleep: empty object (no inputs required).
    title: "System Sleep",
    description: "Put the Mac to sleep.",
    inputSchema: {},
  • Tool registered with name 'system_sleep' via server.registerTool().
    server.registerTool(
      "system_sleep",
  • The systemSleepScript() function returns a JXA script string that puts the Mac to sleep using System Events' sleep() command.
    export function systemSleepScript(): string {
      return `
        const se = Application('System Events');
        se.sleep();
        JSON.stringify({action: 'sleep', success: true});
      `;
    }
Behavior3/5

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

Annotations already indicate destructiveHint=true, so the agent knows this action is destructive. The description adds the specific action but nothing beyond what annotations imply. It doesn't contradict annotations.

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, concise sentence that immediately conveys the action. No unnecessary words.

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

Completeness5/5

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

Given the tool's simplicity (no parameters, no output schema) and annotations that cover safety, the description is complete. It adequately informs the agent of the tool's purpose.

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?

There are zero parameters, so the baseline is 4. The description does not need to add parameter meaning since none exist.

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 'Put the Mac to sleep' uses a specific verb and resource, clearly stating the tool's action. It distinguishes itself from sibling tools like 'prevent_sleep' by describing the opposite action.

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 does not mention when not to use it or any prerequisites, leaving the agent without contextual decision support.

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/heznpc/AirMCP'

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