Skip to main content
Glama
system_info_tool.py2.04 kB
import json import os from datetime import datetime from typing import Dict, Any from .base import BaseMCPTool class SystemInfoTool(BaseMCPTool): """Tool for getting system information""" @property def name(self) -> str: return "system_info" @property def description(self) -> str: return "Get system information including environment variables, current time, and process info" def get_parameters_schema(self) -> Dict[str, Any]: return { "type": "object", "properties": { "info_type": { "type": "string", "enum": ["environment", "time", "process", "all"], "description": "Type of system information to retrieve", "default": "all" }, "filter_env": { "type": "string", "description": "Filter environment variables by prefix (optional)" } }, "required": [] } async def execute(self, parameters: Dict[str, Any]) -> Dict[str, Any]: """Get system information""" info_type = parameters.get("info_type", "all") filter_env = parameters.get("filter_env") result = {} if info_type in ["environment", "all"]: env_vars = dict(os.environ) if filter_env: env_vars = {k: v for k, v in env_vars.items() if k.startswith(filter_env)} result["environment"] = env_vars if info_type in ["time", "all"]: result["time"] = { "utc": datetime.utcnow().isoformat(), "timestamp": datetime.utcnow().timestamp() } if info_type in ["process", "all"]: result["process"] = { "pid": os.getpid(), "cwd": os.getcwd(), "user": os.getenv("USER", "unknown") } return result

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/antpavlenko/mcp_dockerized'

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