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
| Name | Required | Description | Default |
|---|---|---|---|
| section | No | Specific configuration section to retrieve (optional) |
Implementation Reference
- src/index.ts:377-395 (handler)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);
- src/index.ts:184-197 (schema)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'], }, }, }, },
- src/config/ConfigManager.ts:144-146 (helper)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 }