system_profile
Retrieve detailed system information from macOS, including software, hardware, and network configuration data through structured profiling.
Instructions
Return structured data from system_profiler for the requested data type.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data_type | No | software |
Implementation Reference
- macos_tools_mcp/tools.py:88-107 (handler)Core handler function that validates the data_type, runs the system_profiler command with appropriate timeout, parses the JSON output, and returns it as a dictionary.def system_profile(data_type: str = "software") -> dict: """Return structured JSON from ``system_profiler`` for a supported data type.""" normalized = data_type.strip().lower() profiler_type = _ALLOWED_PROFILES.get(normalized, data_type.strip()) if profiler_type not in _ALLOWED_PROFILES.values(): supported = ", ".join(sorted(_ALLOWED_PROFILES)) raise ToolError( f"Unsupported system_profiler data type {data_type!r}. Supported aliases: {supported}" ) raw_output = _run_command( ["system_profiler", profiler_type, "-json"], timeout=_SYSTEM_PROFILER_TIMEOUT, ) try: return json.loads(raw_output) except json.JSONDecodeError as exc: raise ToolError("Failed to parse system_profiler JSON output") from exc
- macos_tools_mcp/server.py:61-66 (registration)Registers the 'system_profile' tool with the FastMCP app, providing the tool name, description, and a thin wrapper that delegates execution to tools.system_profile.@app.tool( name="system_profile", description="Return structured data from `system_profiler` for the requested data type.", ) def system_profile(data_type: str = "software", _: Context | None = None) -> dict: return tools.system_profile(data_type)
- macos_tools_mcp/tools.py:15-20 (helper)Helper dictionary mapping supported data_type aliases to the corresponding system_profiler data types._ALLOWED_PROFILES = { "software": "SPSoftwareDataType", "hardware": "SPHardwareDataType", "network": "SPNetworkDataType", "power": "SPPowerDataType", }
- macos_tools_mcp/tools.py:12-13 (helper)Timeout constants used by the system_profile tool, with a longer timeout specifically for system_profiler._COMMAND_TIMEOUT = 30 _SYSTEM_PROFILER_TIMEOUT = 120