Skip to main content
Glama
itshare4u

Agent Knowledge MCP

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
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

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

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

No annotations are provided, so the description carries the full burden. It mentions 'formatted display,' hinting at how the output is presented, but doesn't disclose critical behaviors like whether this is a read-only operation, potential errors (e.g., if config.json is missing), or performance aspects. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 key action ('Get the complete configuration') and adds useful detail ('from config.json file with formatted display'). There is no wasted verbiage, making it highly concise and well-structured for quick understanding.

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

Completeness4/5

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

Given the tool's simplicity (0 parameters, output schema exists), the description is reasonably complete. It specifies the source ('config.json file') and output format ('formatted display'), and the output schema will detail return values. However, for a tool with no annotations, it could better address behavioral aspects like error handling or read-only nature to enhance completeness.

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, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add parameter details beyond the schema, but with no parameters, this is acceptable. It implies the tool retrieves configuration without requiring inputs, which aligns with the empty schema.

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 action ('Get') and resource ('complete configuration from config.json file'), specifying it retrieves the entire configuration. It distinguishes from siblings like 'reload_config' or 'validate_config' by focusing on retrieval rather than modification or validation. However, it doesn't explicitly differentiate from 'update_config' or 'reset_config' beyond the verb choice.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, such as whether the config file must exist, or compare it to siblings like 'reload_config' (which might refresh config) or 'validate_config' (which checks validity). Usage is implied by the verb 'Get' but not explicitly stated.

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