Skip to main content
Glama
g0t4

macOS Defaults MCP Server

by g0t4

defaults-write

Modify macOS system preferences and application settings by writing values to specific domains and keys using the defaults command.

Instructions

use the defaults write <domain> <key> <value> command

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain to write to
keyYesKey to write to
valueYesValue to write

Implementation Reference

  • The 'defaults_write' function implements the core logic of the 'defaults-write' tool by parsing arguments and executing subprocess.run(['defaults', 'write', domain, key, value]).
    def defaults_write(arguments: dict | None) -> list[types.TextContent]:
        if arguments is None:
            return []
        domain = arguments["domain"]
        key = arguments["key"]
        value = arguments["value"]
    
        # TODO do I need to notify client that resource changed? can't it just ask for it again?
        result = subprocess.run(["defaults", "write", domain, key, value], capture_output=True)
        return [types.TextContent(type="text", text=result.stdout.decode("utf-8"))]
  • Tool schema definition returned by list_tools(), specifying required string parameters: domain, key, value.
    types.Tool(
        name="defaults-write",
        description = "use the `defaults write <domain> <key> <value>` command",
        inputSchema = {
            "type": "object",
            "properties": {
                "domain": {
                    "type": "string",
                    "description": "Domain to write to",
                },
                "key": {
                    "type": "string",
                    "description": "Key to write to",
                },
                "value": {
                    "type": "string",
                    "description": "Value to write",
                },
            },
            "required": ["domain", "key", "value"],
        },
    ),
  • Registration of the tool handler within the @server.call_tool() dispatcher function.
    elif name == "defaults-write":
        return defaults_write(arguments)
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions 'write', implying a mutation operation, but doesn't disclose behavioral traits such as permissions required, whether changes are persistent or reversible, potential side effects, or error handling. The description lacks any context beyond the basic command, leaving critical behavioral aspects undocumented.

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—a single sentence that directly states the command. There is no wasted text, and it's front-loaded with the essential information. Every word earns its place, making it highly efficient in structure.

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 complexity of a write operation with no annotations and no output schema, the description is incomplete. It fails to explain what the tool does beyond the command, omits details on return values or errors, and doesn't provide necessary context for safe usage. For a mutation tool with zero annotation coverage, this minimal description is insufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for 'domain', 'key', and 'value'. The description adds no additional meaning beyond what the schema provides—it merely echoes the parameter names in the command syntax. Since the schema adequately documents parameters, the baseline score of 3 is appropriate, but the description doesn't enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool executes a specific command 'defaults write <domain> <key> <value>', which implies writing configuration settings. However, it's vague about what 'defaults' refers to (likely macOS defaults system) and doesn't distinguish from sibling tools like 'defaults-read' beyond the command name difference. It provides a verb+resource but lacks specificity about the resource's nature.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention when to choose 'defaults-write' over 'defaults-read' or other siblings, nor does it specify prerequisites or appropriate contexts for writing defaults. The description merely restates the command syntax without usage context.

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/g0t4/mcp-server-macos-defaults'

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