Skip to main content
Glama
g0t4

macOS Defaults MCP Server

by g0t4

defaults-read

Read macOS system preferences and application settings using the defaults command to access configuration values for domains and keys.

Instructions

use the defaults read <domain> <key> command

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain to read from
keyNoKey to read from

Implementation Reference

  • The handler function that executes the 'defaults-read' tool logic by running the macOS 'defaults read' command with the provided domain and optional key, capturing and formatting the output.
    def defaults_read(arguments: dict | None) -> list[types.TextContent]:
        if arguments is None:
            return []
        domain = arguments["domain"]
        key = arguments.get("key")
    
        if key is None:
            result = subprocess.run(["defaults", "read", domain], capture_output=True)
            return [types.TextContent(type="text", text=result.stdout.decode("utf-8"))]
    
        result = subprocess.run(["defaults", "read", domain, key], capture_output=True)
        value = result.stdout.decode("utf-8").strip()
        return [types.TextContent(type="text", text=f"{key}: {value}")]
  • Registers the 'defaults-read' tool in the list_tools handler, specifying its name, description, and input schema (domain required, key optional).
    types.Tool(
        name="defaults-read",
        description = "use the `defaults read <domain> <key>` command",
        inputSchema = {
            "type": "object",
            "properties": {
                "domain": {
                    "type": "string",
                    "description": "Domain to read from",
                },
                "key": {
                    "type": "string",
                    "description": "Key to read from",
                },
            },
            "required": ["domain"],
        },
    ),
  • JSON schema for the 'defaults-read' tool inputs, defining properties for 'domain' (required) and 'key' (optional).
    inputSchema = {
        "type": "object",
        "properties": {
            "domain": {
                "type": "string",
                "description": "Domain to read from",
            },
            "key": {
                "type": "string",
                "description": "Key to read from",
            },
        },
        "required": ["domain"],
    },
  • Dispatch logic in the main call_tool handler that routes 'defaults-read' calls to the defaults_read function.
    elif name == "defaults-read":
        return defaults_read(arguments)
Behavior1/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but provides none. It doesn't indicate whether this is a read-only operation, whether it requires specific permissions, what happens if the domain/key doesn't exist, or what format the output takes. The description is purely syntactic with no behavioral information.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence showing command syntax. There's no wasted verbiage or unnecessary information. However, it's so minimal that it borders on under-specification rather than effective conciseness.

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

Completeness1/5

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

For a tool with no annotations and no output schema, the description is completely inadequate. It doesn't explain what the tool returns, what 'defaults' refers to, or provide any context about the operation. The description fails to compensate for the lack of structured metadata, leaving the agent with insufficient information to understand the tool's purpose and behavior.

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?

The schema has 100% description coverage with clear parameter documentation, so the baseline is 3. The description adds minimal value beyond the schema - it shows the command syntax order (domain then key) which isn't in the schema, but doesn't explain what domains or keys represent, provide examples, or clarify the optional nature of the key parameter.

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

Purpose2/5

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

The description 'use the `defaults read <domain> <key>` command' is tautological - it restates the tool name 'defaults-read' with command syntax but doesn't explain what the tool actually does. It doesn't specify what 'defaults' refers to (system defaults, application defaults, configuration defaults) or what resource is being read. The description fails to provide meaningful purpose beyond the name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/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 sibling tools like 'defaults-write', 'find', or 'list-domains', nor does it provide any context about appropriate use cases. There's no indication of when this tool should be selected over other options.

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