Skip to main content
Glama
FosterG4

Code Reference Optimizer MCP Server

by FosterG4

get_config

Retrieve specific or all configuration settings for the Code Reference Optimizer MCP Server, optimizing code analysis, imports, and caching across multiple programming languages.

Instructions

Get current configuration settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sectionNoSpecific configuration section to retrieve (optional)

Implementation Reference

  • The primary handler function for the 'get_config' MCP tool. It processes the input arguments, retrieves the configuration (full or section-specific) from ConfigManager, formats it as JSON, and returns it in the MCP content format. Includes error handling and logging.
    private async handleGetConfig(args: any) {
      const { section } = args;
      
      try {
        this.logger.debug(`get_config: section=${section ?? 'all'}`);
        const config = this.configManager.getConfig();
        const result = section ? config[section as keyof typeof config] : config;
        
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(result, null, 2),
          }],
        };
      } catch (error) {
        this.logger.error(`get_config failed: ${error instanceof Error ? error.message : String(error)}`);
        throw new McpError(ErrorCode.InternalError, `Failed to get configuration: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • src/index.ts:237-238 (registration)
    Tool dispatch registration in the CallToolRequestSchema handler switch statement. Routes 'get_config' tool calls to the handleGetConfig method.
    case 'get_config':
      return await this.handleGetConfig(args);
  • Tool registration and input schema definition returned by ListToolsRequestSchema. Specifies the tool name, description, and input schema allowing optional 'section' parameter.
    {
      name: 'get_config',
      description: 'Retrieve current configuration settings for the Code Reference Optimizer. Access global settings or specific configuration sections including cache behavior, extraction parameters, import analysis rules, diff analysis options, performance tuning, language-specific settings, logging configuration, and security policies.',
      inputSchema: {
        type: 'object',
        properties: {
          section: {
            type: 'string',
            description: 'Specific configuration section to retrieve. Options: cache (caching behavior), extraction (code analysis settings), imports (import optimization rules), diff (difference analysis), performance (resource limits), languages (language-specific settings), logging (debug output), security (access controls).',
            enum: ['cache', 'extraction', 'imports', 'diff', 'performance', 'languages', 'logging', 'security'],
          },
        },
      },
    },
  • Core helper method in ConfigManager that returns a copy of the current configuration object. Called directly by the tool handler to fetch config data.
    getConfig(): CodeReferenceOptimizerConfig {
      return { ...this.config }; // Return a copy to prevent mutations
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Get' implies a read operation, the description doesn't specify whether this requires special permissions, what format the configuration returns in, whether it's cached or real-time data, or any rate limits. For a configuration tool with zero annotation coverage, this is insufficient.

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

Conciseness4/5

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

The description is extremely concise at just four words, which is efficient for a simple retrieval tool. However, it could benefit from slightly more context to help distinguish it from sibling tools. The single sentence is front-loaded with the core purpose.

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

Completeness2/5

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

For a configuration retrieval tool with no annotations and no output schema, the description is too minimal. It doesn't explain what 'current configuration settings' means in practice, what format they're returned in, or how this differs from the 'get_cached_context' sibling tool. Given the complexity of configuration systems and the lack of structured output documentation, more descriptive context is needed.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already fully documents the single optional parameter with its enum values. The description doesn't add any parameter semantics beyond what's in the schema - it doesn't explain what happens when no section is specified, or provide context about the different configuration sections. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose3/5

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

The description states the tool's purpose as 'Get current configuration settings', which is a clear verb+resource combination. However, it doesn't distinguish this from sibling tools like 'get_cached_context' or 'update_config', leaving ambiguity about what specifically makes this tool different from other configuration-related tools.

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. With sibling tools like 'update_config' and 'reset_config' available, there's no indication of when retrieval versus modification is appropriate, nor any mention of prerequisites or typical use cases for configuration access.

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

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/FosterG4/mcpsaver'

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