Skip to main content
Glama

soul_activate

Analyzes the user's first message to select and load the most relevant conversation frameworks.

Instructions

Select and load relevant frameworks for this conversation. Call after reading the user's first message to pick the most applicable frameworks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageYesThe user's first message or a summary of the conversation topic

Implementation Reference

  • Main handler function for soul_activate tool. Loads frameworks from FrameworkEngine, checks eligibility (active/questioning status). If ≤8 eligible, returns all. Otherwise calls LLM via buildActivationPrompt (Claude) to select 5-8 mental models and 0-2 processes. Falls back to confidence-based selection on error or empty result. Returns rendered framework list via renderSelectedFrameworks.
    export async function handleSoulActivate(
      firstMessage: string,
    ): Promise<string> {
      const config = await loadConfig();
      const engine = new FrameworkEngine();
      const store = await engine.initialize();
    
      const eligible = store.frameworks.filter(
        (f) => f.status === "active" || f.status === "questioning",
      );
    
      // If few enough frameworks, skip the LLM call and return all
      if (eligible.length <= 8) {
        return renderSelectedFrameworks(eligible, "general");
      }
    
      const prompt = buildActivationPrompt(store.frameworks, firstMessage);
      let responseText: string;
      try {
        responseText = await callClaude(prompt, config.reflection.quickModel);
      } catch (err) {
        // Fallback: return top 8 by confidence if LLM call fails
        const fallback = eligible
          .sort((a, b) => b.confidence - a.confidence)
          .slice(0, 8);
        return renderSelectedFrameworks(fallback, "general") +
          "\n\n*(Activation used confidence-based fallback — LLM selection unavailable)*";
      }
    
      const parsed = parseLlmJson(responseText);
      if (!parsed) {
        const fallback = eligible
          .sort((a, b) => b.confidence - a.confidence)
          .slice(0, 8);
        return renderSelectedFrameworks(fallback, "general") +
          "\n\n*(Activation used confidence-based fallback — could not parse LLM response)*";
      }
    
      const selectedIds = (parsed.selectedIds as string[]) ?? [];
      const selectedProcessIds = (parsed.selectedProcessIds as string[]) ?? [];
      const allSelectedIds = [...new Set([...selectedIds, ...selectedProcessIds])];
      const conversationType = (parsed.conversationType as string) ?? "general";
    
      const selected = store.frameworks.filter((f) => allSelectedIds.includes(f.id));
    
      // If LLM selected nothing useful, fall back to top by confidence
      if (selected.length === 0) {
        const fallback = eligible
          .sort((a, b) => b.confidence - a.confidence)
          .slice(0, 8);
        return renderSelectedFrameworks(fallback, conversationType);
      }
    
      return renderSelectedFrameworks(selected, conversationType);
    }
  • Builds the LLM prompt used for framework selection. Lists available mental models and cognitive processes with their evidence tiers, statuses, and descriptions. Instructs the LLM to select 5-8 mental models and 0-2 cognitive processes, and classify conversation type. Returns JSON with conversationType, selectedIds, selectedProcessIds, reasoning.
    function buildActivationPrompt(
      frameworks: Framework[],
      userMessage: string,
    ): string {
      const eligible = frameworks
        .filter((f) => f.status === "active" || f.status === "questioning")
        .sort((a, b) => b.confidence - a.confidence);
    
      const models = eligible.filter((f) => f.kind !== "process");
      const processes = eligible.filter((f) => f.kind === "process");
    
      const modelIndex = models
        .map((f) => {
          const tier = f.evidenceTier ?? "hypothesis";
          return `- ${f.id}: ${f.name} [${tier}] (${f.status}) — ${f.description.slice(0, 150)}`;
        })
        .join("\n");
    
      const processIndex = processes
        .map((f) => {
          const tier = f.evidenceTier ?? "hypothesis";
          const triggers = (f.triggers ?? []).slice(0, 3).join("; ");
          return `- ${f.id}: ${f.name} [${tier}] (${f.status}) — Triggers: ${triggers}`;
        })
        .join("\n");
    
      return [
        "You are selecting thinking frameworks for an upcoming conversation.",
        "",
        "## Available Mental Models (thinking vocabulary)",
        "",
        modelIndex || "  (none)",
        "",
        "## Available Cognitive Processes (actionable checklists)",
        "",
        processIndex || "  (none)",
        "",
        "## User's First Message",
        "",
        userMessage,
        "",
        "## Task",
        "",
        "Select 5-8 mental models most relevant as thinking vocabulary for this conversation.",
        "Also select 0-2 cognitive processes whose triggers match the conversation type.",
        "Only select processes when their triggers clearly apply — do not over-activate.",
        "",
        "Consider: the topic, type of task (building, debugging, explaining, reviewing, discussing),",
        "and which named concepts are most likely to be useful.",
        "",
        "Also classify the conversation type for future context-tagging.",
        "",
        "## JSON Output",
        "",
        "Respond with ONLY a valid JSON object:",
        "",
        "```json",
        JSON.stringify({
          conversationType: "building|debugging|explaining|reviewing|meta|general",
          selectedIds: ["framework-id-1", "framework-id-2"],
          selectedProcessIds: ["process-id-1"],
          reasoning: "brief explanation",
        }, null, 2),
        "```",
      ].join("\n");
    }
  • Renders selected frameworks as a formatted Markdown string grouped into 'Activated Frameworks' (mental models) and 'Active Cognitive Processes' (with triggers and steps). Used as the final output of handleSoulActivate.
    function renderSelectedFrameworks(
      frameworks: Framework[],
      conversationType: string,
    ): string {
      const models = frameworks.filter((f) => f.kind !== "process");
      const processes = frameworks.filter((f) => f.kind === "process");
    
      const lines: string[] = [];
      lines.push(`## Activated Frameworks (${conversationType})`);
      lines.push("");
      lines.push("Named concepts selected for this conversation. Apply as thinking vocabulary when relevant:");
      lines.push("");
    
      for (const fw of models) {
        const tier = fw.evidenceTier ?? "hypothesis";
        lines.push(`### ${fw.name} [${tier}]`);
        lines.push(fw.description);
        lines.push("");
      }
    
      if (processes.length > 0) {
        lines.push("## Active Cognitive Processes");
        lines.push("");
        lines.push("Procedures to follow when triggered. These are active checklists, not optional vocabulary.");
        lines.push("");
        for (const p of processes) {
          const tier = p.evidenceTier ?? "hypothesis";
          lines.push(`### ${p.name} [${tier}]`);
          lines.push(p.description);
          if (p.triggers && p.triggers.length > 0) {
            lines.push(`**Triggers**: ${p.triggers.join(" | ")}`);
          }
          if (p.steps && p.steps.length > 0) {
            for (const [i, step] of p.steps.entries()) {
              lines.push(`${i + 1}. ${step}`);
            }
          }
          lines.push("");
        }
      }
    
      return lines.join("\n");
    }
Behavior2/5

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

No annotations are provided, so the description must carry the burden. It says 'select and load' but does not disclose side effects, persistence, authentication needs, or idempotency. Behavioral traits are under-described.

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?

Two sentences with no wasted words. First sentence states the purpose, second gives usage timing. Highly concise 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?

Given the simple single-parameter design and no output schema, the description adequately covers when and what. Minor gaps on what 'loading' entails but overall sufficient.

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 coverage is 100% with a parameter description. The tool description adds little beyond reinforcing the usage context, meeting the baseline but not exceeding it.

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 the tool selects and loads relevant frameworks for the conversation, which is a specific verb+resource. It distinguishes from sibling tools like soul_framework or soul_context by implying it's an initialization step.

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 explicitly instructs to call after reading the user's first message, providing clear context. It does not mention when not to use or alternatives, but the guidance is sufficient.

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