set_config_value
Set a configuration key to a specified value to modify system settings.
Instructions
Set config
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | ||
| value | Yes |
Implementation Reference
- src/tools/terminal_tools.js:55-82 (handler)The actual implementation of set_config_value. Validates the key exists in config, updates the config object, saves to config.json file, and returns success/failure.
function setConfigValue(key, value) { try { if (!(key in config)) { return { success: false, message: `Unknown configuration key: ${key}` }; } config[key] = value; // Save to file fs.writeFileSync(configPath, JSON.stringify(config, null, 2)); logger.info(`Configuration updated: ${key} = ${JSON.stringify(value)}`); return { success: true, message: `Configuration updated: ${key}`, [key]: value }; } catch (error) { logger.error(`Error setting config value: ${error.message}`); return { success: false, message: error.message }; } } - src/mcp/server.js:96-96 (schema)Input schema registration for set_config_value tool: requires 'key' (string) and 'value' (any).
{ name:'set_config_value', description:'Set config', inputSchema:{ type:'object', properties:{ key:{type:'string'}, value:{} }, required:['key','value'] } }, - src/mcp/server.js:253-253 (registration)Handler dispatch: calls terminalTools.setConfigValue(args.key, args.value) when the tool name matches 'set_config_value'.
case 'set_config_value': data = terminalTools.setConfigValue(args.key, args.value); break; - Test example generator: provides sample arguments { key: 'commandTimeout', value: 8000 } for set_config_value.
case 'set_config_value': return { key:'commandTimeout', value: 8000 }; case 'execute_command': return { command: process.platform==='win32' ? 'echo hello' : 'echo hello', waitForCompletion: true, shell: process.platform==='win32'? undefined : '/bin/sh' }; case 'read_output': return { pid: 0 }; // replaced dynamically case 'force_terminate': return { pid: 0 }; // replaced dynamically - src/mcp/server.js:10-10 (registration)Imports terminalTools from '../tools/terminal_tools', which exports the setConfigValue function.
const terminalTools = require('../tools/terminal_tools');