Skip to main content
Glama
vuluu2k
by vuluu2k

initBrain

Initialize a structured personal brain repository by creating required folders and markdown files in a single commit for organizing tasks, notes, and goals.

Instructions

Initialize the brain repository structure. Creates all required folders and markdown files in a single commit. Only needs to be called once on a new/empty repo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The implementation of the `initBrain` method in the `Brain` class. It initializes the brain structure by creating default files if they don't already exist.
    async initBrain(): Promise<{ created: string[] }> {
      const log = getLogger();
    
      // Check if brain already exists by trying to read any section
      try {
        await this.sync.readSection("inbox");
        throw new Error(
          "Brain already initialized — inbox/capture.md exists. Use the other tools to manage your brain."
        );
      } catch (err) {
        if (!isNotFound(err)) throw err;
        // Not found = good, proceed with init
      }
    
      await this.sync.createFiles(
        BRAIN_TEMPLATES,
        "feat(ai): initialize brain structure"
      );
    
      const created = BRAIN_TEMPLATES.map((t) => t.section);
      log.info("initBrain", { created });
      return { created };
    }

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/vuluu2k/knowledge_mcp'

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