Skip to main content
Glama

reload_config

Reload configuration from config.json and reinitialize all components with updated settings to apply changes without restarting the server.

Instructions

Reload configuration from config.json file and reinitialize all components with updated settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'reload_config' MCP tool. It reloads the configuration from config.json, reinitializes the security module with the new allowed_base_directory, and reinitializes the Elasticsearch client. Returns a formatted success message with key configuration details or an appropriate error message.
    @app.tool( description="Reload configuration from config.json file and reinitialize all components with updated settings", tags={"admin", "config", "reload", "refresh", "reinitialize"} ) async def reload_config() -> str: """Reload configuration and reinitialize all system components with updated settings.""" try: # Reload configuration from file config = load_config() # Reinitialize security with updated allowed directory init_security(config["security"]["allowed_base_directory"]) # Reinitialize Elasticsearch with updated configuration init_elasticsearch(config) reset_es_client() # Format success message with key configuration details message = "āœ… Configuration reloaded successfully!\n\n" message += "šŸ”„ **Components Reinitialized:**\n" message += f" šŸ”’ Security: {get_allowed_base_dir()}\n" message += f" šŸ” Elasticsearch: {config['elasticsearch']['host']}:{config['elasticsearch']['port']}\n" # Show additional configuration summary if "server" in config: server_config = config["server"] message += f" šŸš€ Server: {server_config.get('name', 'AgentKnowledgeMCP')} v{server_config.get('version', '1.0.0')}\n" message += f"\nšŸ’” All system components now use the updated configuration from config.json" return message except KeyError as e: return f"āŒ Configuration Error: Missing required configuration key: {str(e)}\nšŸ’” Check config.json structure and ensure all required sections are present" except FileNotFoundError: return f"āŒ File Error: config.json not found\nšŸ’” Ensure config.json exists in the source directory" except json.JSONDecodeError as e: return f"āŒ JSON Error: Invalid JSON format in config.json\nšŸ” Details: {str(e)}\nšŸ’” Check JSON syntax and structure" except Exception as e: return _format_admin_error(e, "reload configuration", "component reinitialization")

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/itshare4u/AgentKnowledgeMCP'

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