Skip to main content
Glama
g0t4

macOS Defaults MCP Server

by g0t4

list-domains

Discover available macOS domains to view and modify system preferences and application settings using the defaults system.

Instructions

List all available macOS domains, same as defaults domains

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `list_domains` function implements the core logic of the 'list-domains' tool. It executes the `defaults domains` subprocess command, parses the comma-separated output into a list of stripped domain names, and returns it formatted as TextContent.
    def list_domains() -> list[types.TextContent]: # get array of domains:
        # run command `defaults domains`
        result = subprocess.run(["defaults", "domains"], capture_output=True)
        domains = result.stdout.decode("utf-8").split(",")
        domains = [domain.strip() for domain in domains]
        return [types.TextContent(type="text", text=f"Domains: {domains}")]
  • The 'list-domains' tool is registered within the `handle_list_tools` function, specifying its name, description, and input schema.
    types.Tool(
        name="list-domains",
        description="List all available macOS domains, same as `defaults domains`",
        inputSchema= {
            "type": "object",
            "properties": {},
        }, # TODO filter domains?
    ),
  • Input schema for the 'list-domains' tool, defining an empty object with no properties since the tool requires no arguments.
    inputSchema= {
        "type": "object",
        "properties": {},
    }, # TODO filter domains?
  • Dispatch logic in the `handle_call_tool` function that routes calls to 'list-domains' to the `list_domains` implementation.
    if name == "list-domains":
        return list_domains()
Behavior2/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. It only states what the tool does ('List all available macOS domains') without mentioning output format, potential errors, or system dependencies. The 'same as `defaults domains`' hint adds minimal context but doesn't adequately describe behavior for an AI agent.

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 just one sentence that directly states the tool's function. Every word earns its place, and there's no unnecessary elaboration or repetition.

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 has no annotations, no output schema, and zero parameters, the description is insufficiently complete. It doesn't explain what format the domain list returns, whether there are any constraints or dependencies, or how this integrates with the macOS defaults system context implied by the sibling tools.

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 zero parameters with 100% schema description coverage, so the schema already fully documents the input requirements. The description appropriately doesn't add parameter information beyond what's in the schema, maintaining focus on the tool's purpose.

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 verb ('List') and resource ('all available macOS domains'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'find' or explain how this differs from 'defaults-read' for domain-related operations.

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 mentions 'same as `defaults domains`' which is a technical reference but doesn't help an AI agent decide between this tool and siblings like 'defaults-read' or 'find' for domain-related tasks.

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