clear_history
Remove captured terminal command logs to manage storage and maintain privacy in the Terminal Reader MCP environment.
Instructions
Clear the captured terminal history log file.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:253-278 (registration)Registers the 'clear_history' MCP tool with title, description, empty input schema, and inline handler function.server.registerTool( 'clear_history', { title: 'Clear Terminal History', description: 'Clear the captured terminal history log file.', inputSchema: {}, }, async () => { try { writeFileSync(LOG_FILE, ''); return { content: [{ type: 'text', text: 'Terminal history cleared.', }], }; } catch (error) { return { content: [{ type: 'text', text: `Failed to clear history: ${error.message}`, }], }; } } );
- index.js:260-277 (handler)The handler function for the 'clear_history' tool. It clears the terminal history log file by overwriting it with an empty string and returns a success or error message in MCP format.async () => { try { writeFileSync(LOG_FILE, ''); return { content: [{ type: 'text', text: 'Terminal history cleared.', }], }; } catch (error) { return { content: [{ type: 'text', text: `Failed to clear history: ${error.message}`, }], }; } }
- index.js:255-258 (schema)Schema definition for the 'clear_history' tool, including title, description, and empty input schema (no parameters required).{ title: 'Clear Terminal History', description: 'Clear the captured terminal history log file.', inputSchema: {},