Skip to main content
Glama
MikeyBeez

MCP Contemplation

by MikeyBeez

clear_scratch

Remove temporary scratch notes to free up cognitive processing space and maintain organized background thinking.

Instructions

Clear temporary scratch notes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function clearScratch() in ContemplationManager class that implements the logic to clear temporary scratch files by recursively deleting daily directories and returns the count of files cleared.
    async clearScratch(): Promise<number> {
      const scratchPath = '/Users/bard/Code/contemplation-loop/tmp/contemplation';
      let count = 0;
    
      try {
        const days = fs.readdirSync(scratchPath);
        for (const day of days) {
          const dayPath = path.join(scratchPath, day);
          const files = fs.readdirSync(dayPath);
          count += files.length;
          fs.rmSync(dayPath, { recursive: true, force: true });
        }
      } catch (e) {
        // Directory might not exist
      }
    
      return count;
    }
  • src/index.ts:564-569 (registration)
    Registration and dispatching of the clear_scratch tool in the CallToolRequestSchema handler switch statement, which calls the clearScratch method and formats the response.
    case 'clear_scratch': {
      const count = await contemplation.clearScratch();
      return {
        content: [{ type: 'text', text: `Cleared ${count} scratch files` }],
      };
    }
  • Tool registration in ListToolsRequestSchema including the name, description, and empty inputSchema for clear_scratch (no parameters required).
    {
      name: 'clear_scratch',
      description: 'Clear temporary scratch notes',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },

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/MikeyBeez/mcp-contemplation'

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