Skip to main content
Glama
yawlhead91

MariaDB MCP Server

by yawlhead91

reload_config

Reload configuration settings in MariaDB MCP Server from environment variables and .env file to ensure updated parameters are applied.

Instructions

Reload configuration from environment variables and .env file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'reload_config' tool. It is registered via the @mcp.tool() decorator. The function closes the existing database connection pool, reloads the configuration from environment variables, updates the global db_connection instance with new parameters, and resets the pool to force reconnection on the next operation.
    async def reload_config() -> str: """Reload configuration from environment variables and .env file.""" try: # Close existing connection pool await db_connection.close() # Reload configuration config_manager.reload() # Update connection parameters db_connection.host = config_manager.get('host') db_connection.port = config_manager.get('port') db_connection.user = config_manager.get('user') db_connection.password = config_manager.get('password') db_connection.database = config_manager.get('database') db_connection.pool = None # Reset pool to force reconnection logger.info("Configuration reloaded successfully") return "Configuration reloaded successfully. New connection will be established on next database operation." except Exception as e: logger.error(f"Error reloading configuration: {e}") return f"Error reloading configuration: {str(e)}"

Other Tools

Related Tools

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/yawlhead91/mariadb-mcp'

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