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 }

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