Skip to main content
Glama

system_toggle_dark_mode

Switch macOS between light and dark appearance modes using AppleScript automation.

Instructions

[System control and information] Toggle system dark mode

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • AppleScript code that implements the core logic for toggling system dark mode, used as the handler for the 'system_toggle_dark_mode' tool.
    {
      name: "toggle_dark_mode",
      description: "Toggle system dark mode",
      script: `
            tell application "System Events"
              tell appearance preferences
                set dark mode to not dark mode
                return "Dark mode is now " & (dark mode as text)
              end tell
            end tell
          `,
    },
  • Registers all tools for listing, constructing names like 'system_toggle_dark_mode' from category and script names.
    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: {},
          },
        })),
      ),
    }));
  • Parses the tool name 'system_toggle_dark_mode' by splitting on '_' to identify the 'system' category and 'toggle_dark_mode' script.
    const [categoryName, ...scriptNameParts] =
      toolName.split("_");
    const scriptName = scriptNameParts.join("_"); // Rejoin in case script name has underscores
  • src/index.ts:25-25 (registration)
    Adds the 'system' category (containing toggle_dark_mode) to the server, making its tools available.
    server.addCategory(systemCategory);
  • src/index.ts:2-2 (registration)
    Imports the system category definition which includes the toggle_dark_mode script.
    import { systemCategory } from "./categories/system.js";
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 ('Toggle') but doesn't explain what 'dark mode' entails, whether it requires permissions, if it's reversible, or what the expected outcome is, leaving significant gaps.

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 ('Toggle system dark mode'), making it efficient and easy to parse without any wasted words.

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?

Given the tool's complexity (a system control action) and lack of annotations or output schema, the description is incomplete. It doesn't explain what 'dark mode' means, how the toggle works, or what to expect after invocation, leaving the agent with insufficient context.

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, and schema description coverage is 100%, so no parameter information is needed. The description appropriately doesn't discuss parameters, earning a baseline score of 4 for not adding unnecessary details.

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 action ('Toggle') and resource ('system dark mode'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'notifications_toggle_do_not_disturb' or 'system_volume' beyond the specific resource, so it's not a perfect 5.

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 any context for its application. It lacks explicit when/when-not statements or references to sibling tools, leaving usage unclear.

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