Skip to main content
Glama

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
NameRequiredDescriptionDefault
data_typeNosoftware

Implementation Reference

  • 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
  • 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)
  • Helper dictionary mapping supported data_type aliases to the corresponding system_profiler data types.
    _ALLOWED_PROFILES = { "software": "SPSoftwareDataType", "hardware": "SPHardwareDataType", "network": "SPNetworkDataType", "power": "SPPowerDataType", }
  • Timeout constants used by the system_profile tool, with a longer timeout specifically for system_profiler.
    _COMMAND_TIMEOUT = 30 _SYSTEM_PROFILER_TIMEOUT = 120

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/Zhuoli/mcp101'

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