Skip to main content
Glama
itshare4u

Agent Knowledge MCP

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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")
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool reloads and reinitializes components, implying a system-wide impact, but doesn't disclose critical details like whether this causes service interruption, requires specific permissions, has side effects on existing operations, or what 'reinitialize' entails.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action ('reload configuration') and provides essential context ('from config.json file', 'reinitialize all components with updated settings'). Every word earns its place with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a system reconfiguration tool with no annotations but with an output schema (which handles return values), the description is minimally adequate. It explains what the tool does but lacks important context about behavioral impact, safety considerations, and differentiation from sibling tools like 'reset_config'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the lack of inputs. The description appropriately doesn't add parameter information beyond what's already covered, maintaining a baseline score of 4 for zero-parameter tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('reload configuration', 'reinitialize all components') and identifies the resource ('config.json file'). It distinguishes from siblings like 'get_config' (read-only) and 'update_config' (modify config), but doesn't explicitly mention these distinctions in the text.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives like 'reset_config' or 'update_config'. The description implies usage after config file changes but doesn't specify prerequisites, timing considerations, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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