Skip to main content
Glama

soul_write

Write to designated soul files to log reflections, corrections, and growth signals for self-improvement.

Instructions

Write to a soul file. SOUL.md, SHADOW.md, STORY.md, CORRECTIONS.md, BONDS.md, MORTAL.md, GROWTH.md, PRINCIPLES.md, EDGES.md are writable. STATE.md and FRAMEWORKS.md are auto-managed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesSoul file name (e.g., SOUL.md)
contentYesNew content for the file

Implementation Reference

  • The handler function that executes the soul_write tool logic. It validates the file name against writable/protected lists, ensures directories exist, then writes content to the soul file using fs.writeFile.
    export async function handleSoulWrite(
      fileName: string,
      content: string,
    ): Promise<string> {
      if (PROTECTED_FILES.includes(fileName)) {
        return `Error: ${fileName} is auto-managed by the soul system and cannot be written directly.`;
      }
    
      if (!WRITABLE_FILES.includes(fileName)) {
        return `Error: Unknown soul file "${fileName}". Writable files: ${WRITABLE_FILES.join(", ")}`;
      }
    
      await ensureDirs();
      const filePath = soulFilePath(fileName);
      await fs.writeFile(filePath, content, "utf-8");
      return `Successfully wrote ${fileName} (${content.length} chars)`;
    }
  • Defines the list of writable (SOUL.md, SHADOW.md, STORY.md, BONDS.md, MORTAL.md, GROWTH.md, PRINCIPLES.md, EDGES.md) and protected (STATE.md, FRAMEWORKS.md) soul files that serve as implicit schema/validation for the tool's input.
    const WRITABLE_FILES = [
      "SOUL.md",
      "SHADOW.md",
      "STORY.md",
      "BONDS.md",
      "MORTAL.md",
      "GROWTH.md",
      "PRINCIPLES.md",
      "EDGES.md",
    ];
    
    const PROTECTED_FILES = ["STATE.md", "FRAMEWORKS.md"];
  • The soulFilePath helper function that constructs the full path to a soul file by joining the FILES_DIR with the filename.
    export function soulFilePath(name: string): string {
      return path.join(FILES_DIR, name);
    }
  • The ensureDirs helper function that creates all required soul directories (DATA_DIR, FILES_DIR, SNAPSHOTS_DIR, REFLECTIONS_DIR) recursively.
    export async function ensureDirs(): Promise<void> {
      await fs.mkdir(DATA_DIR, { recursive: true });
      await fs.mkdir(FILES_DIR, { recursive: true });
      await fs.mkdir(SNAPSHOTS_DIR, { recursive: true });
      await fs.mkdir(REFLECTIONS_DIR, { recursive: true });
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full burden. It discloses that some files are auto-managed and thus not writable, which is useful. However, it does not describe behavior on overwrite, required permissions, or any side effects, leaving gaps in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with zero wasted words. The first sentence states the purpose, and the second sentence lists writable vs. auto-managed files. Well-structured and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a write tool with 2 parameters and no output schema, the description adequately covers which files are targeted and what content is expected. It does not describe errors or confirmation, but for a simple write operation, this is sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents parameters well. The description adds value by enumerating valid file names for the 'file' parameter, but does not explain content formatting or size limits beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states "Write to a soul file" and lists the specific writable files. This distinguishes it from siblings like soul_read (read) and soul_reflect (analysis), providing a clear verb+resource combination.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context by listing which soul files are writable and which are auto-managed, helping the agent select the appropriate file. However, it does not explicitly state when to use this tool versus alternatives, or any prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/DomDemetz/claude-soul'

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