get_config
Retrieve and display the complete configuration from config.json file to access system settings and parameters.
Instructions
Get the complete configuration from config.json file with formatted display
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/admin/admin_server.py:69-83 (handler)The FastMCP tool handler function for the 'get_config' tool. Loads configuration using load_config() and returns formatted JSON output.@app.tool( description="Get the complete configuration from config.json file with formatted display", tags={"admin", "config", "get", "view", "settings"} ) async def get_config() -> str: """Get the complete configuration from config.json file.""" try: config = load_config() config_str = json.dumps(config, indent=2, ensure_ascii=False) return f"📄 Current configuration:\n\n```json\n{config_str}\n```" except Exception as e: return _format_admin_error(e, "get configuration", "config.json loading")
- src/config/config.py:9-36 (helper)Core helper function load_config() used by the get_config tool to load configuration from config.json with fallbacks to config.default.json or minimal defaults.def load_config() -> Dict[str, Any]: """Load configuration from config.json with fallback to config.default.json.""" config_path = Path(__file__).parent.parent / "config.json" default_config_path = Path(__file__).parent.parent / "config.default.json" # Try to load config.json first try: with open(config_path, 'r', encoding='utf-8') as f: return json.load(f) except FileNotFoundError: # If config.json not found, try config.default.json try: print("⚠️ Configuration file config.json not found, using config.default.json") with open(default_config_path, 'r', encoding='utf-8') as f: return json.load(f) except FileNotFoundError: # Both files missing - return minimal default configuration print("⚠️ Both config.json and config.default.json not found, using minimal default configuration") return { "elasticsearch": {"host": "localhost", "port": 9200}, "security": {"allowed_base_directory": "/tmp/knowledge_base_secure"}, "server": {"name": "elasticsearch-mcp", "version": "0.1.0"} } def get_config() -> Dict[str, Any]: """Get the current configuration.""" return load_config()
- src/config/config.py:34-37 (helper)Thin wrapper get_config() helper that delegates to load_config(), imported but not directly used in the tool handler.def get_config() -> Dict[str, Any]: """Get the current configuration.""" return load_config()
- src/main_server.py:78-80 (registration)Mounting of the admin_server FastMCP app into the main server, making get_config (and prefixed admin_get_config) available.# Mount Administrative operations server with 'admin' prefix # This provides: admin_get_config, admin_update_config, admin_server_status, etc. app.mount(admin_server_app)