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()

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