@cachly-dev/mcp-server 0.10.153 → 0.10.155

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/tools.js CHANGED
@@ -1,4 +1,4 @@
1
- const e=[{name:"list_instances",description:"List all your cachly cache instances with their status and connection details. Read-only. Returns an array of instance objects \u2014 each with id, name, tier, status, region, RAM, and redis:// connection string. Returns an empty array if no instances exist. No pagination: all instances are returned in one call (typical accounts have < 20). Use this first to discover instance UUIDs required by get_instance, cache_get, cache_set, and all other cache tools. Use get_instance to retrieve full metadata for a single instance.",inputSchema:{type:"object",properties:{},required:[]}},{name:"create_instance",description:"Create a new managed Valkey/Redis cache instance on cachly.dev. Free tier provisions in ~30 seconds. Paid tiers return a Stripe checkout URL. Available tiers: free (25 MB), dev (200 MB, \u20AC19/mo), pro (900 MB, \u20AC49/mo), speed (900 MB Dragonfly + Semantic Cache, \u20AC79/mo), business (7 GB, \u20AC199/mo).",inputSchema:{type:"object",properties:{name:{type:"string",description:"Unique name for the instance (min 3 chars)"},tier:{type:"string",enum:["free","dev","pro","speed","business"],description:'Pricing tier. Start with "free" for testing.'}},required:["name","tier"]}},{name:"get_instance",description:"Get full metadata for a specific cache instance: name, tier, status (provisioning / running / paused), region, RAM limit, Redis connection string, created_at, and expiry. Read-only. Returns an error if the instance_id is not found or belongs to another account. Call list_instances first to discover valid UUIDs. Use get_connection_string instead if you only need the redis:// URL for your app config.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the instance (from list_instances)"}},required:[]}},{name:"get_connection_string",description:"Get the Redis/Valkey connection string (redis:// URL) for a running instance. Use this to configure your application or set environment variables.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the instance."}},required:[]}},{name:"delete_instance",description:"Permanently delete a cache instance. Deprovisions the Kubernetes workload and removes all data. This action is irreversible.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the instance to delete"},confirm:{type:"boolean",description:"Must be true to confirm deletion"}},required:["confirm"]}},{name:"cache_get",description:"Get a value from a running cache instance by key. Returns the stored value (string or deserialized JSON object) or null if the key does not exist or has expired. Read-only \u2014 no side effects. Use cache_mget when you need multiple keys in one round-trip. Use cache_exists to check existence without retrieving the value. Use semantic_search when you need fuzzy/vector search across stored values.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the instance."},key:{type:"string",description:"Cache key to retrieve"},org_id:{type:"string",description:"Optional org ID \u2014 if the direct key misses, falls back to the shared org namespace org:{org_id}:sem:{key}"}},required:["key"]}},{name:"cache_set",description:'Set a key-value pair in a running cache instance. Overwrites any existing value at the key \u2014 not idempotent for new data. Returns "OK" on success; returns an error if the instance_id is invalid or the instance is paused. Value can be a string or a JSON-serialized object. Optionally set a TTL in seconds (omit for no expiry). Use cache_mset instead for setting multiple keys in a single pipeline round-trip. Use cache_stream_set instead for caching LLM token streams (ordered string chunks).',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance (from list_instances)"},key:{type:"string",description:"Cache key"},value:{type:"string",description:"Value to store (string or JSON)"},ttl:{type:"number",description:"Time-to-live in seconds (optional, omit for no expiry)"},org_id:{type:"string",description:"Optional org ID \u2014 also writes the key to the shared org namespace org:{org_id}:sem:{key} with the same TTL"}},required:["key","value"]}},{name:"cache_delete",description:"Permanently delete one or more keys from a running cache instance (uses Redis DEL). This operation is destructive and irreversible \u2014 deleted keys cannot be recovered. Deleting a non-existent key is safe and returns 0 for that key (no error). Returns the count of keys that were actually deleted (existing keys only). Use this to explicitly remove stale entries; prefer cache_set with a short TTL for auto-expiring data. Do NOT use this to clear an entire instance \u2014 use the dashboard or delete_instance for that.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance to delete keys from (get from list_instances)"},keys:{type:"array",items:{type:"string"},description:"One or more cache keys to delete. Accepts exact keys only (no glob patterns \u2014 use cache_keys to list first)."}},required:["keys"]}},{name:"cache_exists",description:"Check whether one or more keys exist in a running cache instance (uses Redis EXISTS). Read-only \u2014 no side effects. Returns the count of keys that currently exist (integer 0 to N). If none of the keys exist, returns 0. If all exist, returns the total key count passed in. Duplicate keys in the input array are each counted separately (Redis behavior). Use this to check presence before a cache_get to avoid null handling, or to verify a cache warm-up completed. Use cache_get instead if you also need the value; use cache_ttl if you need expiry info.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance to check (get from list_instances)"},keys:{type:"array",items:{type:"string"},description:"Keys to check for existence. Accepts exact keys only (no glob patterns)."}},required:["keys"]}},{name:"cache_ttl",description:"Get the remaining time-to-live (TTL) of a key in seconds. Returns -1 if the key exists but has no expiry, -2 if the key does not exist. Read-only \u2014 no side effects. Use cache_set with a ttl parameter to set or update the expiry.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance (from list_instances)"},key:{type:"string",description:"Cache key to inspect"}},required:["key"]}},{name:"cache_keys",description:'List keys in a cache instance matching an optional glob pattern (e.g. "user:*", "session:*"). Uses SCAN to avoid blocking the server. Returns at most `count` keys.',inputSchema:{type:"object",properties:{instance_id:{type:"string"},pattern:{type:"string",description:"Glob pattern (default: *)"},count:{type:"number",description:"Max keys to return (default: 50, max: 500)"}},required:[]}},{name:"cache_stats",description:"Get real-time stats for a cache instance: memory usage, hit/miss rate, commands/sec, connected clients, keyspace info, and uptime. Read-only \u2014 no side effects. The instance_id identifies the target instance (obtain from list_instances). Use this for monitoring, capacity planning, or debugging performance issues \u2014 not for reading cached values (use cache_get for that). Use cache_exists or cache_ttl if you only need key-level information.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance (from list_instances)"}},required:[]}},{name:"semantic_search",description:'Find cached entries that are semantically similar to a natural-language query. Read-only \u2014 no side effects. Returns an array of objects, each with: key, value, similarity_score (0\u20131), and namespace. Returns an empty array if no entries meet the similarity threshold. Requires OPENAI_API_KEY (or compatible provider) and the Speed/Business tier with CACHLY_VECTOR_URL. Embeddings are computed server-side and never leave Germany (pgvector HNSW index). Example: "find all cached responses about password reset" or "what did we answer about pricing?". Use cache_get for exact key lookup; use smart_recall for brain lessons.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance (from list_instances)"},query:{type:"string",description:"Natural-language query to find similar cached content"},threshold:{type:"number",description:"Minimum cosine similarity 0\u20131 (default: 0.82). Lower = broader matches."},namespace:{type:"string",description:"Semantic namespace to search in (default: cachly:sem)"},top_k:{type:"number",description:"Maximum number of results to return (default: 5)"},use_hybrid:{type:"boolean",description:"Enable Hybrid BM25+Vector RRF fusion search. Passes `hybrid: true` and the query text to the pgvector API for higher precision on named entities. Default: false."},auto_namespace:{type:"boolean",description:"Auto-detect the namespace from the query text using text heuristics instead of using the `namespace` parameter. Returns results only from the matching domain (code/translation/summary/qa/creative)."}},required:["query"]}},{name:"detect_namespace",description:"Classify a prompt into one of 5 semantic namespaces using text heuristics. Overhead: <0.1 ms, no embedding required. Useful to understand which namespace cachly will use for a given prompt. Returns one of: cachly:sem:code, cachly:sem:translation, cachly:sem:summary, cachly:sem:qa, cachly:sem:creative.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"The text prompt to classify into a semantic namespace"}},required:["prompt"]}},{name:"cache_warmup",description:"Pre-warm the semantic cache with a list of prompt/value pairs. For each entry: computes an embedding, checks if a similar entry already exists (similarity \u2265 0.98), and writes new entries to Valkey + pgvector index. Use this to seed FAQ responses, product descriptions, or known-good LLM answers before the first real user traffic. Requires OPENAI_API_KEY.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},entries:{type:"array",description:"List of prompt/value pairs to pre-warm into the cache",items:{type:"object",properties:{prompt:{type:"string",description:"The query or question to cache"},value:{type:"string",description:"The answer or response to store for this prompt"},namespace:{type:"string",description:"Optional per-entry namespace override"}},required:["prompt","value"]}},namespace:{type:"string",description:"Default namespace for all entries (default: cachly:sem)"},ttl:{type:"number",description:"Time-to-live in seconds for warmed entries (omit for no expiry)"},auto_namespace:{type:"boolean",description:"Auto-detect the namespace per prompt using text heuristics. Overrides `namespace` when no per-entry namespace is set."}},required:["entries"]}},{name:"index_project",description:"Index local source files into the cachly semantic cache so AI assistants can use semantic_search to find relevant files instead of re-reading the whole codebase every time. Walks a directory recursively, reads each matching file, and stores a summary + path as a semantic cache entry (prompt = file path + content excerpt, value = relative path). Requires an embedding provider (OPENAI_API_KEY or CACHLY_EMBED_PROVIDER + key). Run once, then re-run after major refactors. TTL=86400 (24h) keeps entries fresh.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cachly instance"},dir:{type:"string",description:"Absolute path to the directory to index (e.g. /Users/you/myproject/src)"},extensions:{type:"array",items:{type:"string"},description:'File extensions to include (default: ["ts","js","go","py","java","rs","md","kt","swift"])'},max_files:{type:"number",description:"Maximum number of files to index (default: 100)"},ttl:{type:"number",description:"TTL in seconds for indexed entries (default: 86400 = 24 h)"},summary_chars:{type:"number",description:"Characters to use as summary per file (default: 1200)"},namespace:{type:"string",description:"Semantic namespace to store under (default: cachly:sem:code)"}},required:["dir"]}},{name:"cache_mset",description:"Set multiple key-value pairs in a single pipeline round-trip. Supports per-key TTL \u2013 unlike native MSET. Uses one TCP round-trip for N keys via Redis pipeline. Each item overwrites any existing value for that key. On partial failure the successfully pipelined keys are committed; a per-key error list is returned for any that failed. Returns a summary: { set: N, errors: [...] }. Use cache_set for a single key; use cache_stream_set for large streaming payloads.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},items:{type:"array",description:"Key-value pairs to set",items:{type:"object",properties:{key:{type:"string",description:"Cache key"},value:{description:"Value to store (JSON-serialised)"},ttl:{type:"number",description:"Per-key TTL in seconds (optional)"}},required:["key","value"]}}},required:["items"]}},{name:"cache_mget",description:"Retrieve multiple keys in one round-trip using native Redis MGET. Returns values in the same order as the keys array; missing keys are null.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},keys:{type:"array",items:{type:"string"},description:"List of keys to fetch"}},required:["keys"]}},{name:"cache_lock_acquire",description:"Acquire a distributed lock using Redis SET NX PX (Redlock-lite). Returns a fencing token on success. The lock auto-expires after ttl_ms to prevent deadlocks. Use cache_lock_release to free the lock early.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},key:{type:"string",description:"Lock resource identifier"},ttl_ms:{type:"number",description:"Safety TTL in milliseconds (e.g. 5000)"},retries:{type:"number",description:"Max acquire attempts (default: 3)"},retry_delay_ms:{type:"number",description:"Milliseconds between retries (default: 50)"}},required:["key","ttl_ms"]}},{name:"cache_lock_release",description:"Release a previously acquired distributed lock. Uses a Lua script for atomic release \u2013 only deletes the key if the fencing token matches.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},key:{type:"string",description:"Lock resource identifier (same as in cache_lock_acquire)"},token:{type:"string",description:"Fencing token returned by cache_lock_acquire"}},required:["key","token"]}},{name:"get_api_status",description:"Full diagnostic for your cachly Brain \u2014 call this FIRST whenever anything is not working. Returns: API reachability, JWT validity + expiry, your user ID, all Brain instances with live status (\u{1F7E2} running / \u{1F7E1} provisioning / \u{1F534} stopped), Redis ping on the active connection, and actionable fix steps for every issue found. Workflow: run get_api_status \u2192 read the issue it flags \u2192 fix it \u2192 retry your tool.",inputSchema:{type:"object",properties:{},required:[]}},{name:"remember_context",description:'Save context information to the cache so you can recall it later without re-computing. Perfect for caching: codebase overviews, file summaries, project structure, frequently-accessed data, or "thinking" results like dependency analysis. The AI assistant can use this to avoid re-reading the entire codebase every time. Overwrites any existing value stored under the same key. Returns { key, stored_at, ttl } confirming the saved context. Example: remember_context("project overview", "This is a Next.js app with...") then later: recall_context("project overview"). Use recall_context to retrieve; use list_remembered to see all stored keys.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},key:{type:"string",description:'Descriptive key like "project_overview", "auth_architecture", "file:src/index.ts"'},content:{type:"string",description:"The context/summary/analysis to remember"},category:{type:"string",enum:["overview","architecture","file_summary","dependency","thinking","custom"],description:"Category for organization (default: custom)"},ttl:{type:"number",description:"Time-to-live in seconds (default: 86400 = 24h, use 0 for no expiry)"}},required:["key","content"]}},{name:"recall_context",description:'Retrieve previously saved context from the cache. Returns the saved content or null if not found. Use this at the START of any task to check if you already have relevant context cached, before doing expensive operations like reading many files. Supports glob patterns: "file:*" matches all file summaries, "arch*" matches architecture-related keys.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},key:{type:"string",description:'The key to look up (supports glob pattern like "file:*")'}},required:["key"]}},{name:"list_remembered",description:"List all cached context entries for this project. Shows what knowledge the AI assistant has already cached, so you can decide whether to recall existing context or refresh it. Returns: key, category, size, TTL remaining, and a content preview.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},category:{type:"string",enum:["overview","architecture","file_summary","dependency","thinking","custom","all"],description:"Filter by category (default: all)"},limit:{type:"number",description:"Max entries to return (default: 50)"}},required:[]}},{name:"forget_context",description:'Delete one or more cached context entries. Use when context is stale or you want to force a fresh analysis. Supports glob patterns: "file:*" deletes all file summaries.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},keys:{type:"array",items:{type:"string"},description:"Keys to delete (supports glob)"}},required:["keys"]}},{name:"learn_from_attempts",description:'Store a lesson learned from a failed or successful attempt. instance_id may be omitted; the configured instance is used \u2014 never guess one.Call this AFTER completing any non-trivial task (deploy, debug, fix, architecture decision). The lesson will be recalled automatically in future sessions via recall_best_solution. Fields: topic (short slug like "deploy:web"), outcome ("success"|"failure"), what_worked (what solved it), what_failed (what did NOT work), context (extra details). Supports structured metadata: severity, file_paths (files involved), commands (working commands), tags. Deduplication: if a lesson for this topic already exists, it is updated with full audit trail \u2014 an UPDATE then REQUIRES the field `grund` (one line: WHY the previous version was wrong); without it the update is rejected. Contradiction detection: warns if new outcome conflicts with existing lesson outcome. Confidence: lesson starts at 1.0, decays after 5d (\u21920.7) and 10d (\u21920.5) without recall. Example: learn_from_attempts(topic="deploy:api", outcome="success", what_worked="nohup docker compose up -d --build", what_failed="docker compose up hangs on SSH timeout", severity="critical", commands=["nohup docker compose up -d --build"])',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},topic:{type:"string",description:'Short slug, e.g. "deploy:web", "debug:redis-tls", "fix:generate-series"'},outcome:{type:"string",enum:["success","failure","partial"],description:"Did it work?"},what_worked:{type:"string",description:"What solved the problem or what approach succeeded"},what_failed:{type:"string",description:"What did NOT work (optional but valuable)"},context:{type:"string",description:'The SYMPTOM in the words someone would search for, before they knew the fix ("deploy stuck, rollout not finishing"). Plus error messages and root cause. Optional but high-value: it is what closes the gap between the question and the answer.'},severity:{type:"string",enum:["critical","major","minor"],description:"Impact severity: critical (blocks work/deploy), major (significant slowdown), minor (nice to know). Default: major."},file_paths:{type:"array",items:{type:"string"},description:'Files involved in this lesson (e.g. ["infra/deploy.sh", ".env"])'},commands:{type:"array",items:{type:"string"},description:'Commands that worked or failed (e.g. ["rsync -avz ...", "docker compose up -d"])'},tags:{type:"array",items:{type:"string"},description:'Topic tags for filtering (e.g. ["bash", "deploy", "env"])'},depends_on:{type:"array",items:{type:"string"},description:'Prerequisites, e.g. ["node:>=20", "docker:running"]. A stale one flags dependent lessons for review.'},author:{type:"string",description:'Who is storing this lesson, e.g. "alice". Enables cross-author reuse tracking.'},grund:{type:"string",description:"One line: WHY the previous version was wrong, like a commit message. REQUIRED when the topic already exists; optional on first write."},ersetzt:{type:"string",description:'Topic slug of an OLDER lesson this one refutes. The old one is suppressed in smart_recall and shows a "superseded" banner.'},gilt_ab:{type:"string",description:"ISO date since when the FACT is true (vs. when written). Omit if unknown. A replacement sets gilt_bis on the old lesson (then shown as history). About the fact, NOT an age decay."},visibility:{type:"string",enum:["team","private","public"],description:'Who can see it: "team" (default) = all members, "private" = only via exact recall_best_solution, "public" = same as team for now.'},service:{type:"string",description:'Service or system this lesson concerns, e.g. "prometheus", "auth-service".'},service_kind:{type:"string",enum:["service","system"],description:'"service" (default) for an application, "system" for infrastructure like prometheus or redis.'},group:{type:"string",description:'Optional sub-team scope, e.g. "backend". Only that group and admins see it. Independent of visibility.'}},required:["topic","outcome","what_worked"]}},{name:"recall_best_solution",description:'Recall the best known solution for a topic from past lessons. Call this BEFORE attempting any task that might have been done before. Returns the most recent successful lesson for the topic, with confidence indicator. \u26A0\uFE0F badge = lesson is >5d old (verify before applying). \u{1F534} = >10d old (likely stale!). Recalling a lesson resets its confidence clock to 1.0 (marks as recently verified). A superseded lesson shows a banner naming its successor; if the successor was deleted, the banner says so and the lesson counts as the best remaining answer. Example: recall_best_solution(topic="deploy:web") \u2192 returns the working deploy command.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},topic:{type:"string",description:'Topic slug to look up, e.g. "deploy:web". Supports partial match.'},author:{type:"string",description:'Who is asking (optional). Required to read a group-scoped lesson: without it, group-scoped lessons answer like "not found". Team-wide lessons need no author.'}},required:["topic"]}},{name:"recall_feedback",description:'Tell the Brain whether a recalled lesson ACTUALLY SOLVED your problem. This is the one signal the Brain cannot infer: recall_count only means "it was shown". Call it right after a lesson helped you \u2014 or after you solved something the Brain should have found. IMPORTANT: rank=0 means the lesson was NOT in the answer at all. That is the most valuable feedback there is, because it says the ranking never surfaced it. Example: recall_feedback(query="why does the deploy abort", topic="ci:timeout-reports-cancelled", helped=true, rank=0)',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},query:{type:"string",description:"The question you asked, as you asked it. Not a summary \u2014 the ranking has to learn from the real wording."},topic:{type:"string",description:"Topic of the lesson this is about. May be a lesson that was NOT returned (then set rank=0)."},helped:{type:"boolean",description:'Did it solve your problem? true or false. There is deliberately no "not sure" \u2014 a guessed value is worse than none.'},rank:{type:"number",description:"Where it stood in the answer, 1-based. 0 = it was NOT in the answer at all (the most valuable case)."},note:{type:"string",description:"Optional: what was missing, or why it did not fit."},author:{type:"string",description:"Optional: your handle."}},required:["query","topic","helped","rank"]}},{name:"smart_recall",description:'Semantically search cached context using natural language. instance_id may be omitted; the configured instance is used \u2014 never guess one.Instead of exact key matching, finds context by meaning. Example: smart_recall("how does authentication work") \u2192 returns cached auth architecture summary. Falls back to remember_context keys if no semantic match is found.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},query:{type:"string",description:"Natural language query to find relevant cached context"},threshold:{type:"number",description:"Similarity threshold 0-1 (default: 0.78)"},author:{type:"string",description:"Who is recalling (optional). Counts cross-author reuse."},context_files:{type:"array",items:{type:"string"},description:'Files you are working on, e.g. ["src/auth/service.ts"]. Lessons learned around these files rank higher.'}},required:["query"]}},{name:"session_start",description:"Single-call session briefing. Call this at the START of every session INSTEAD of multiple separate smart_recall/recall_best_solution calls. Returns: last session summary, recent lessons sorted by recency, relevant lessons for your focus area, open failures (topics with only failure outcomes), brain health stats, team telepathy (what teammates learned this week), predictive pre-warnings (if your focus area has known failure patterns), and memory crystals (compressed wisdom from old sessions). Also saves a session start marker so session_end can compute duration.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},focus:{type:"string",description:'Keywords for what you plan to work on today (e.g. "deploy infra api"). Used to surface relevant lessons at the top.'},author:{type:"string",description:'Your name or handle (e.g. "alice"). Enables Team Telepathy \u2014 filters YOUR lessons vs TEAM lessons from past 7 days.'},provider:{type:"string",description:'Current AI provider (e.g. "claude-code", "copilot", "cursor", "windsurf"). Shown in the briefing header and saved so the next provider can see who was last active.'},workspace_path:{type:"string",description:"Absolute path to the project root. If no session_end was found (e.g. context limit hit), reads git log to reconstruct what happened since last session."}},required:[]}},{name:"session_start_summary",description:"Focused session briefing for large brains. Returns only the top-N most relevant lessons for the given focus topic, scored by relevance, recall count, severity, recency, and outcome. Ideal when session_start returns too many lessons to fit in context (1000+ lesson brains). Use session_start for the full briefing including handoffs, streak, roadmap, and team telepathy.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},focus:{type:"string",description:'The topic or task you are about to work on (e.g. "deploy infra", "api auth"). Used to score and rank lessons by relevance.'},top_n:{type:"number",description:"Number of lessons to return (default 10, max 25). Lessons are ranked by relevance to focus."},author:{type:"string",description:"Your name or handle (optional). Same as session_start \u2014 used for team lesson filtering."}},required:["focus"]}},{name:"session_end",description:'Save a session summary when you finish working. Records what was accomplished, files changed, and lesson count. The next session_start will show this summary as "Last session". Call this when ending a work session, before going idle, or before summarizing. Ambient Learning: if workspace_path is provided, reads git log since session start and auto-learns from commits.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},summary:{type:"string",description:"Brief summary of what was accomplished this session (2-3 sentences)"},files_changed:{type:"array",items:{type:"string"},description:"Key files changed this session (optional)"},lessons_learned:{type:"number",description:"Number of new lessons stored this session (optional)"},workspace_path:{type:"string",description:'Absolute path to the project root (e.g. "/Users/you/myproject"). Enables Ambient Learning \u2014 reads git log since session start and auto-learns from commit messages.'}},required:["summary"]}},{name:"session_handoff",description:'Save a detailed handoff for the NEXT chat window / session. Stores: current progress, TODO list (done + remaining), changed files with descriptions, instructions for the next assistant, and any incomplete work. The next session_start automatically includes this handoff so the new window knows EXACTLY what happened and what remains. Call this BEFORE closing a chat window, especially if work is incomplete. This prevents the "continue" problem where new windows lose context, skip tasks, or produce broken code.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},completed_tasks:{type:"array",items:{type:"string"},description:'Tasks that were fully completed (e.g. "Implemented brainSearch() in JS SDK")'},remaining_tasks:{type:"array",items:{type:"string"},description:"Tasks NOT yet done \u2014 the next window MUST pick these up"},files_changed:{type:"array",items:{type:"object",properties:{path:{type:"string",description:"File path relative to project root"},status:{type:"string",enum:["complete","partial","broken"],description:"State of this file"},description:{type:"string",description:"What was changed and what still needs work"}},required:["path","status"]},description:"Changed files with their current state \u2014 marks partial/broken files so next window knows to fix them"},instructions:{type:"string",description:"Free-form instructions for the next assistant. Be specific: what to do next, what to avoid, what broke."},context_summary:{type:"string",description:"Brief summary of what happened this session (architecture decisions, key findings, blockers)"},blocked_on:{type:"string",description:'If work is blocked, describe what is needed to unblock (e.g. "waiting for API deploy", "needs user input on design")'}},required:["completed_tasks","remaining_tasks"]}},{name:"session_ping",description:"Lightweight checkpoint \u2014 call this every ~5 tool calls or whenever you complete a significant step. Stores the current task + files touched so session_start on the NEXT provider can reconstruct what happened even if session_end was never called (e.g. Claude context limit hit, window crashed). This solves the provider-switching problem: Claude \u2192 Copilot \u2192 Cursor all see the same last checkpoint. Extremely fast \u2014 one Redis SET, no blocking operations.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},task:{type:"string",description:'What you are currently working on (e.g. "Implementing invite handler in handler/invite.go")'},files_touched:{type:"array",items:{type:"string"},description:"Files modified so far this session"},next_step:{type:"string",description:"What the NEXT step is after this checkpoint (helps next provider resume immediately)"},provider:{type:"string",description:'Current AI provider (e.g. "claude-code", "copilot", "cursor", "windsurf")'}},required:["task"]}},{name:"auto_learn_session",description:"Auto-learn from a list of session observations WITHOUT explicit learn_from_attempts calls. Pass what happened (commands run, errors seen, solutions found) and the brain classifies and stores lessons automatically. Use at session_end to capture everything you did, even if you forgot to call learn_from_attempts. Returns a summary of what was auto-stored.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},observations:{type:"array",description:"List of observations from this session",items:{type:"object",properties:{action:{type:"string",description:"What was tried (command, approach, code change)"},outcome:{type:"string",enum:["success","failure","partial"],description:"Result"},details:{type:"string",description:"Error message, output, or explanation"},topic:{type:"string",description:"Optional topic key (auto-generated if omitted)"},severity:{type:"string",enum:["critical","major","minor"],description:"Severity (default: minor)"}},required:["action","outcome"]}}},required:["observations"]}},{name:"brain_who_knows",description:'Find who in your team has the most expertise on a given topic. Queries the org-wide knowledge graph (built automatically from learn_from_attempts author fields) and returns a ranked list of contributors whose lessons match the query, ordered by lesson count and confidence. Use to find the right person to ask before starting a task, or to understand knowledge distribution. Example: brain_who_knows(topic="kubernetes deployment") \u2192 "\u{1F947} alice \u2014 5 lessons, 94% confidence".',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},topic:{type:"string",description:"Topic or question to find experts for"},limit:{type:"number",description:"Max number of experts to return (default: 10)"}},required:["topic"]}},{name:"brain_file_map",description:'Show what cachly knows about a list of files \u2014 experts + related lessons per file. Call this before starting work on unfamiliar files, or in sync_file_changes to see what knowledge exists. For each file path: shows who has previously touched it (from learn_from_attempts author+file_paths) and which lessons reference it. Example: brain_file_map(file_paths=["src/auth/jwt.ts"]) \u2192 "\u{1F947} alice (3\xD7 \xB7 today) \u2014 related: fix:jwt-expiry".',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},file_paths:{type:"array",items:{type:"string"},description:"File paths to look up (max 10)"}},required:["file_paths"]}},{name:"team_expertise_map",description:"Full team expertise overview \u2014 who knows what, at a glance. Returns a ranked table of all contributors with their lesson count, top domains, and last-active date. Use for onboarding (who to ask about X?), retrospectives, or to find knowledge gaps. Built automatically from learn_from_attempts(author=...) calls \u2014 no setup needed.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},top_n:{type:"number",description:"Max contributors to show (default: 20)"}},required:[]}},{name:"brain_collab_pairs",description:`Show the Person\u2194Person Collaboration Graph for your team (W5). Lists every pair of contributors who have worked together \u2014 either by touching the same files in learn_from_attempts or by recalling each other's lessons via smart_recall(requester=...). Each pair includes a "Frag @X und @Y" routing suggestion \u2014 ideal for onboarding and bus-factor analysis. Also flags solo contributors whose knowledge no teammate has yet recalled (bus-factor risk). Example: brain_collab_pairs() \u2192 "@alice \u2194 @bob \u2014 12 events \xB7 ask them together about auth/payments".`,inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},min_weight:{type:"number",description:"Minimum collaboration events to show a pair (default: 1)"}},required:[]}},{name:"brain_portability",description:"Bring your own model, keep your brain: the same memory in every AI editor. Returns your Brain ID plus ready-to-paste MCP config snippets for every compatible AI client: Claude Code, Cursor, Windsurf, GitHub Copilot (VS Code), Cline, Zed, Continue. All 7 clients connect to the same Brain \u2014 same lessons, crystals, predictions, and team data. Use autopilot to configure all detected editors in one command. Example: brain_portability() \u2192 config blocks for 7 clients + model-neutrality proof table.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."}},required:[]}},{name:"skill_gaps",description:"Show knowledge blind spots in your Brain \u2014 domains with unresolved failures, lessons with missing attribution, and areas where brain_who_knows cannot help. Run periodically to find where to focus knowledge capture effort. Returns a prioritized list: \u{1F534} critical (failures with no solutions) \u2192 \u{1F7E1} warn \u2192 \u{1F535} info. Pairs with brain_coverage for a full knowledge-health picture.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},min_failures:{type:"number",description:"Min failure count to flag a domain as a gap (default: 1)"}},required:[]}},{name:"brain_coverage",description:'Knowledge-coverage health score for your codebase \u2014 scored 0-100. Reports: total lessons, success ratio, attribution completeness, team engagement, and file coverage vs git ls-files. Run after brain_from_git or periodically to track knowledge-capture progress. Use skill_gaps to find what to fix. Example: brain_coverage() \u2192 "\u{1F7E2} Overall score: 78/100 \xB7 42 lessons \xB7 6 contributors \xB7 31% files covered".',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},repo_path:{type:"string",description:"Path to the git repository (default: current directory)"}},required:[]}},{name:"brain_metrics",description:`Report the three decisive Brain metrics: (1) time-to-first-recall (onboarding friction), (2) recall-lift vs. raw BM25 (the moat proof, from Cachly-Bench), and (3) team-knowledge-reuse \u2014 what % of proven recalls used a teammate's lesson. Use to track whether the Brain is delivering its core value. Pass author="handle" to smart_recall so cross-author reuse can be measured.`,inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."}},required:[]}},{name:"brain_changelog",description:`Generate a human-readable Markdown changelog of lessons learned in the last N days. Groups lessons by topic category, annotates with author, recall count and confidence. Ideal for weekly standups, sprint retros, or async team updates \u2014 share the output directly in Slack or a doc. Example: brain_changelog(instance_id="...", days=7) \u2192 grouped Markdown changelog of the week's learning.`,inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},days:{type:"number",description:"How many days back to include (default: 7)"},max_lessons:{type:"number",description:"Maximum number of lessons to include (default: 30)"},include_failures:{type:"boolean",description:"Include failure-outcome lessons (default: true)"}},required:[]}},{name:"brain_service_map",description:'Map everything the Brain knows about a running service or system: who operates it, which files run in it, every known failure, and every proven fix. Built from lessons tagged with `service="..."` in learn_from_attempts. Ideal for incident triage \u2014 when a service is misbehaving (e.g. a restarting pod), instantly surface who knows it and what has gone wrong with it before. Example: brain_service_map(service="prometheus") \u2192 operators, known OOM failures, and the fixes that worked.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},service:{type:"string",description:'Name of the service/system to map (e.g. "prometheus", "cachly-web", "auth-service"). Matches the `service` tag on stored lessons.'}},required:["service"]}},{name:"sync_file_changes",description:"Associate recent file changes with brain knowledge. Pass a list of changed file paths (from `git diff --stat`). Returns lessons relevant to those files, and records the file changes in session history. Call this after commits so the brain tracks what changed and why.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},changed_files:{type:"array",items:{type:"string"},description:"List of changed file paths"},git_diff_stat:{type:"string",description:"Output of `git diff --stat` (optional)"},commit_msg:{type:"string",description:"Commit message (optional)"}},required:["changed_files"]}},{name:"team_learn",description:'Store a lesson in a shared team brain so all team members benefit. Like learn_from_attempts, but REQUIRES an author name for attribution. Shows up in team_recall with "by <author>" so the team knows who learned it.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},author:{type:"string",description:"Your name or handle (required for team attribution)"},topic:{type:"string",description:'Topic in category:keyword format (e.g. "deploy:api")'},outcome:{type:"string",enum:["success","failure","partial"],description:"What happened"},what_worked:{type:"string",description:"What worked (the solution)"},what_failed:{type:"string",description:"What did NOT work (avoid this)"},severity:{type:"string",enum:["critical","major","minor"],description:"Impact level"},file_paths:{type:"array",items:{type:"string"},description:"Relevant file paths"},commands:{type:"array",items:{type:"string"},description:"Commands that worked"},tags:{type:"array",items:{type:"string"},description:"Tags for categorization"}},required:["author","topic","outcome","what_worked"]}},{name:"team_confirm",description:"Endorse (review-confirm) a team lesson so trusted, human-reviewed knowledge ranks above unreviewed auto-learned entries. A senior review weighs more than a peer review; distinct endorsements add a small boost. Confirmed lessons surface higher in smart_recall and team_recall and carry a \u{1F6E1}\uFE0F/\u2714\uFE0F badge. Use this in code review or knowledge reviews to bless the canonical solution for a topic.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},topic:{type:"string",description:'Topic slug of the lesson to confirm (e.g. "deploy:api")'},reviewer:{type:"string",description:"Your name or handle (the reviewer endorsing this lesson)"},level:{type:"string",enum:["senior","peer"],description:'Review weight \u2014 "senior" ranks higher than "peer" (default: peer)'},note:{type:"string",description:"Optional review note (kept in the lesson audit trail)"}},required:["topic","reviewer"]}},{name:"team_assign_role",description:'Assign a role (admin | reviewer | contributor | viewer) to a team member on a shared brain instance. Roles control what each person can do: admin can manage roles and delete lessons; reviewer can senior-review (\u{1F6E1}\uFE0F badge, stronger recall boost); contributor can store lessons and peer-review (\u2714\uFE0F badge); viewer is read-only. First call bootstraps governance (no auth required when no admins exist yet). After that, only an admin can assign or change roles. Example: team_assign_role(handle="alice", role="reviewer", assigned_by="bob") \u2014 bob must be an admin.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},handle:{type:"string",description:"Handle or name of the team member to assign a role to"},role:{type:"string",enum:["admin","reviewer","contributor","viewer"],description:"Role to assign. admin: manage roles + all actions. reviewer: senior-review (\u{1F6E1}\uFE0F). contributor: store + peer-review. viewer: read-only."},assigned_by:{type:"string",description:"Handle of the admin performing the assignment (required after governance bootstrap)"}},required:["handle","role"]}},{name:"team_whoami",description:"Show your own role and capabilities on a shared brain instance. Tells you what you can do (store, review, manage roles) and who to contact if you need a higher role. Run this after onboarding to confirm your role was set correctly.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},handle:{type:"string",description:"Your handle or name"}},required:["handle"]}},{name:"team_roster",description:"Show all team members and their assigned roles on a shared brain instance. Returns a table of handles, roles (\u{1F451} admin \xB7 \u{1F6E1}\uFE0F reviewer \xB7 \u270F\uFE0F contributor \xB7 \u{1F441}\uFE0F viewer), and capabilities. Use during onboarding to see who can do what, or to verify role assignments.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"}},required:[]}},{name:"team_audit",description:'View the governance audit log for a shared brain \u2014 an immutable trail of who changed roles and who confirmed which lessons, with timestamps. Essential for enterprise compliance and security reviews. Admin-only once governance is active (an admin has been assigned). Events are recorded automatically on team_assign_role and team_confirm \u2014 no setup. Example: team_audit(requester="alice") \u2192 "\u{1F451} role: bob set carol viewer \u2192 contributor \xB7 \u2705 confirm: dave confirmed auth:jwt-skew (senior)".',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},requester:{type:"string",description:"Your handle \u2014 must be an admin once governance is active"},limit:{type:"number",description:"Max events to show, newest first (default: 50, max: 200)"}},required:[]}},{name:"team_grant_scope",description:'Add or remove a team member to/from a named group (sub-team) on a shared brain. Group-scoped lessons (stored with group="...") only surface in smart_recall for members of that group (and admins). This is team-level visibility, orthogonal to lesson-level private. Admin-gated after the role model is bootstrapped. Example: team_grant_scope(handle="alice", group="security", assigned_by="bob") \u2014 bob must be admin.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},handle:{type:"string",description:"Handle of the team member to add/remove"},group:{type:"string",description:'Group/sub-team name (e.g. "backend", "security", "platform")'},action:{type:"string",enum:["add","remove"],description:"add (default) or remove the member from the group"},assigned_by:{type:"string",description:"Handle of the admin performing the change (required after governance bootstrap)"}},required:["handle","group"]}},{name:"team_scopes",description:"List team groups and their members, or the groups a specific person belongs to. Pass handle to see one person's scopes; omit it to see all groups on the instance. Use to audit who can see group-scoped lessons.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},handle:{type:"string",description:"Optional \u2014 show only this person's group memberships"}},required:[]}},{name:"team_recall",description:"Recall lessons from a shared team brain, showing who learned what. Works on any shared instance (all team members using the same instance_id). Shows author, recency, and severity for each lesson. Use this to onboard new team members or find who knows about a topic.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},topic:{type:"string",description:"Topic or keyword to filter lessons (optional)"},author:{type:"string",description:"Filter by author name (optional)"},limit:{type:"number",description:"Max lessons to return (default: 10)"}},required:[]}},{name:"team_synthesize",description:"Team Brain Synthesis \u2014 merge multiple contributors' lessons on the same topic into one canonical version. When 2+ developers store lessons for the same topic with different details, this proposes the best merged version. Shows: all contributions by author, what worked (consensus), what failed (union), canonical lesson to store. Use this when onboarding new team members or before documenting a process.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},topic:{type:"string",description:'Topic slug to synthesize (e.g. "deploy:api")'}},required:["topic"]}},{name:"memory_crystalize",description:"Compress the last 30-50 sessions and auto-learned lessons into a dense Memory Crystal. A crystal is a compact, structured summary of everything the brain learned \u2014 grouped by category (deploy, fix, debug, \u2026). Crystals survive session cleanup and appear in session_start once enough sessions have accumulated. Run this monthly or after a big milestone to preserve institutional knowledge. Returns a digest of what was crystallized.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},label:{type:"string",description:'Optional label for this crystal (e.g. "Q1 2026", "v2 launch"). Auto-generated from date if omitted.'}},required:[]}},{name:"team_crystallize",description:'Create a Team Crystal \u2014 the team-wide, causal counterpart to memory_crystalize. Where memory_crystalize compresses ONE brain by category, team_crystallize surfaces what a per-user memory structurally cannot: which fixes solved structurally SIMILAR problems across MULTIPLE people. A pattern only crystallizes when 2+ distinct authors independently converged on it \u2014 that cross-person signal is the moat against single-user "Dreaming"-style memory. Needs attributed lessons (learn_from_attempts(author=...) / team_learn). Surfaces in crystal_view. Example: team_crystallize() \u2192 "\u{1F9E9} pool \u2014 3 people converged (alice, bob, carol): bounded pool + timeout".',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},min_authors:{type:"number",description:"Min distinct authors that must converge for a pattern to crystallize (default: 2, min: 2)"},label:{type:"string",description:'Optional label (e.g. "Q1 2026"). Auto-generated from date if omitted.'}},required:[]}},{name:"roadmap_add",description:"Add a new item to the persistent project roadmap stored in the Brain. Items survive across sessions and editors \u2014 the roadmap is always up to date. Use for features, bugs, refactors, or any planned work. Call roadmap_list to see all open items, roadmap_next to get the next actionable item.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},title:{type:"string",description:"Short title of the task/feature (3\u201310 words)"},description:{type:"string",description:"What needs to be done, acceptance criteria, context"},priority:{type:"string",enum:["critical","high","medium","low"],description:"Priority level (default: medium)"},tags:{type:"array",items:{type:"string"},description:'Tags for filtering (e.g. ["api", "web", "sdk", "infra"])'},milestone:{type:"string",description:"Milestone/epic this belongs to (optional)"}},required:["title"]}},{name:"roadmap_update",description:"Update the status, priority, or details of a roadmap item. Use to move items through the lifecycle: planned \u2192 in-progress \u2192 done (or blocked/cancelled). Also use to add notes/findings while working on an item.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},id:{type:"string",description:"Item ID returned by roadmap_add or roadmap_list"},status:{type:"string",enum:["planned","in-progress","done","blocked","cancelled"],description:"New status for the item"},priority:{type:"string",enum:["critical","high","medium","low"],description:"Updated priority (optional)"},notes:{type:"string",description:"Progress notes, findings, or blockers (appended to existing notes)"},title:{type:"string",description:"Updated title (optional)"},description:{type:"string",description:"Updated description (optional)"}},required:["id"]}},{name:"roadmap_list",description:"List all roadmap items, optionally filtered by status, priority, tag, or milestone. Returns items sorted by priority then creation date. Called automatically by session_start to show open work.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},status:{type:"string",enum:["planned","in-progress","done","blocked","cancelled","open"],description:"Filter by status. Use 'open' to see planned+in-progress+blocked (default: open)"},tag:{type:"string",description:"Filter by tag (optional)"},milestone:{type:"string",description:"Filter by milestone (optional)"},priority:{type:"string",enum:["critical","high","medium","low"],description:"Filter by minimum priority (optional)"}},required:[]}},{name:"roadmap_next",description:"Get the single most important next actionable roadmap item. Returns the highest-priority in-progress item first, then planned items, sorted by priority. Call at session start to immediately know what to work on next.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},tag:{type:"string",description:"Filter by tag (optional)"}},required:[]}},{name:"brain_doctor",description:"Check the health of your AI Brain and get actionable recommendations. Reports: lesson count, context entries, last session age, open failures, quality score, effective IQ boost, stale index. Returns a prioritized list of issues with fix instructions.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},workspace_path:{type:"string",description:"Absolute path to workspace root \u2014 enables package.json analysis for openclaw cross-promo (optional)"}},required:[]}},{name:"brain_hygiene",description:"Autonomously sweep and maintain your Brain \u2014 flags stale lessons as provisional, archives long-dormant ones, and resolves contradictions where success clearly dominates failure. Safe to run on a schedule (weekly CI job) or on-demand before a big release. Lesson state lifecycle: active \u2192 provisional (confidence < threshold) \u2192 archived (stale + low-recall + old). Archived lessons are excluded from smart_recall but preserved for audit. dry_run=true (default false) shows what would change without writing anything.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},dry_run:{type:"boolean",description:"Report changes without applying them (default false)"},provisional_threshold:{type:"number",description:"Confidence below which a lesson is flagged provisional (default 0.5)"},archive_days:{type:"number",description:"Days after which a provisional low-recall lesson is archived (default 30)"}},required:[]}},{name:"global_learn",description:'Store a lesson that applies across ALL your projects (cross-project knowledge). Idempotent: if a lesson with the same topic already exists, it is updated in place \u2014 no duplicates are created. Returns a confirmation with the stored lesson key. No rate limits. Global lessons are stored with the prefix cachly:global:lesson: and recalled from any instance via global_recall. Use for tool preferences, personal workflows, platform quirks, and universal gotchas. Example: global_learn(topic="bash:macos-arrays", lesson="Arrays work differently on macOS bash 3.2"). Use learn_from_attempts for project-specific session lessons; use team_learn to share lessons with your team.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance (used for connection)"},topic:{type:"string",description:'Topic key in format "category:keyword"'},lesson:{type:"string",description:"The lesson content"},severity:{type:"string",enum:["critical","major","minor"],description:"Severity (default: minor)"},tags:{type:"array",items:{type:"string"},description:"Optional tags"}},required:["topic","lesson"]}},{name:"global_recall",description:"Read-only retrieval of cross-project lessons stored via global_learn. No side effects. Returns a list of matching global lesson objects, each with topic, lesson text, severity, and tags. If no topic is provided, returns all global lessons (up to 50). If topic is provided, returns all lessons whose topic key contains that string (partial match). Use this for lessons that apply universally across all projects (tool quirks, shell gotchas, platform behavior). Use recall_best_solution instead for project-specific lessons; use team_recall for org-scoped lessons.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance (used for connection)"},topic:{type:"string",description:"Topic or keyword filter (optional)"}},required:[]}},{name:"publish_lesson",description:"Publish a lesson to the Cachly Public Brain (anonymized community knowledge base). Published lessons can be imported by other developers via import_public_brain. PII is stripped automatically. Visible under the framework/category tag. Returns { lesson_id, topic, framework, published_at } confirming the publish. Irreversible \u2014 once published to the public brain, lessons cannot be deleted via the MCP interface. Use learn_from_attempts or global_learn for private lessons; use syndicate for anonymized global sharing without framework tagging.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},topic:{type:"string",description:"Topic key (used as public category)"},lesson:{type:"string",description:"Lesson to publish (PII will be stripped)"},framework:{type:"string",description:"Framework/platform tag (nextjs, fastapi, go, docker, etc.)"},severity:{type:"string",enum:["critical","major","minor"],description:"Severity"}},required:["topic","lesson"]}},{name:"import_public_brain",description:"Import community lessons from the Cachly Public Brain for a framework. Non-destructive: existing lessons with the same topic key are not overwritten. Returns the count of lessons imported and their topic slugs. Available frameworks: nextjs, fastapi, go, docker, kubernetes, react, typescript, python, rust, laravel, rails, spring. Use this to bootstrap a new brain with battle-tested community knowledge before your first session_start. Use publish_lesson to contribute your own lessons to the Public Brain; use learn_from_attempts for storing lessons from your own sessions.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance to import into"},framework:{type:"string",description:"Framework/platform to import lessons for"},limit:{type:"number",description:"Max lessons to import (default: 20)"}},required:["framework"]}},{name:"recall_at",description:'Brain Archaeology \u2014 see what a lesson looked like at a specific point in time. "What did we know about deployments 3 months ago?" Returns the history of a topic filtered to entries before the given date. Shows how the lesson evolved: failure \u2192 partial \u2192 success. Also useful to understand WHY old code decisions were made.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},topic:{type:"string",description:'Topic slug to look up, e.g. "deploy:api"'},date:{type:"string",description:'ISO date string (e.g. "2026-01-15") \u2014 returns entries stored BEFORE this date'}},required:["topic","date"]}},{name:"trace_dependency",description:'Causal Chain \u2014 find all lessons that depend on a given prerequisite. "What lessons are affected if node version changes?" When a dependency changes (new version, different provider, new OS), call this to see which lessons need review. Lessons store dependencies via the depends_on field in learn_from_attempts.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},dependency:{type:"string",description:'Dependency to trace (e.g. "node:>=20", "docker:running", "wireguard:active")'},mark_review:{type:"boolean",description:"If true, marks all dependent lessons as needs_review (default: false)"}},required:["dependency"]}},{name:"list_orgs",description:"List your Cachly organizations (team/org plans). Returns each org with plan, seat count, and member info. Org plans (Team \u20AC99, Business \u20AC299, Enterprise custom) are billed separately from cache tiers.",inputSchema:{type:"object",properties:{},required:[]}},{name:"create_org",description:"Create a new Cachly organization for team collaboration. After creation, invite team members with invite_member and upgrade the plan via the billing portal. Org plans: Team (\u20AC99/mo, 10 seats), Business (\u20AC299/mo, 50 seats), Enterprise (custom).",inputSchema:{type:"object",properties:{name:{type:"string",description:'Organization display name (e.g. "Acme Engineering")'},slug:{type:"string",description:'URL-safe slug (e.g. "acme-eng"). Auto-generated from name if omitted.'}},required:["name"]}},{name:"invite_member",description:"MUTATION \u2014 sends an invite email immediately and cannot be undone via MCP. Invite a team member to a Cachly organization by email. Requires the caller to be an admin or owner of the organization. Valid roles: admin (manage members + instances), member (read + cache ops). Default role: member. Returns an error if the email is already a member or has a pending invite.",inputSchema:{type:"object",properties:{org_id:{type:"string",description:"UUID of the organization"},email:{type:"string",description:"Email address to invite"},role:{type:"string",enum:["admin","member"],description:"Role for the invited member (default: member)"}},required:["org_id","email"]}},{name:"get_org_plan",description:"Get the current org plan, seat usage, and billing info for an organization. Shows: plan name, price, seats used/max, next billing date. To upgrade: use the billing portal URL returned by this tool.",inputSchema:{type:"object",properties:{org_id:{type:"string",description:"UUID of the organization"}},required:["org_id"]}},{name:"setup_ai_memory",description:`One-shot setup of the cachly 3-layer AI Memory system for a project.
1
+ const e=[{name:"list_instances",description:"List all your cachly cache instances with their status and connection details. Read-only. Returns an array of instance objects \u2014 each with id, name, tier, status, region, RAM, and redis:// connection string. Returns an empty array if no instances exist. No pagination: all instances are returned in one call (typical accounts have < 20). Use this first to discover instance UUIDs required by get_instance, cache_get, cache_set, and all other cache tools. Use get_instance to retrieve full metadata for a single instance.",inputSchema:{type:"object",properties:{},required:[]}},{name:"create_instance",description:"Create a new managed Valkey/Redis cache instance on cachly.dev. Free tier provisions in ~30 seconds. Paid tiers return a Stripe checkout URL. Available tiers: free (25 MB), dev (200 MB, \u20AC19/mo), pro (900 MB, \u20AC49/mo), speed (900 MB Dragonfly + Semantic Cache, \u20AC79/mo), business (7 GB, \u20AC199/mo).",inputSchema:{type:"object",properties:{name:{type:"string",description:"Unique name for the instance (min 3 chars)"},tier:{type:"string",enum:["free","dev","pro","speed","business"],description:'Pricing tier. Start with "free" for testing.'}},required:["name","tier"]}},{name:"get_instance",description:"Get full metadata for a specific cache instance: name, tier, status (provisioning / running / paused), region, RAM limit, Redis connection string, created_at, and expiry. Read-only. Returns an error if the instance_id is not found or belongs to another account. Call list_instances first to discover valid UUIDs. Use get_connection_string instead if you only need the redis:// URL for your app config.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the instance (from list_instances)"}},required:[]}},{name:"get_connection_string",description:"Get the Redis/Valkey connection string (redis:// URL) for a running instance. Use this to configure your application or set environment variables.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the instance."}},required:[]}},{name:"delete_instance",description:"Permanently delete a cache instance. Deprovisions the Kubernetes workload and removes all data. This action is irreversible.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the instance to delete"},confirm:{type:"boolean",description:"Must be true to confirm deletion"}},required:["confirm"]}},{name:"cache_get",description:"Get a value from a running cache instance by key. Returns the stored value (string or deserialized JSON object) or null if the key does not exist or has expired. Read-only \u2014 no side effects. Use cache_mget when you need multiple keys in one round-trip. Use cache_exists to check existence without retrieving the value. Use semantic_search when you need fuzzy/vector search across stored values.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the instance."},key:{type:"string",description:"Cache key to retrieve"},org_id:{type:"string",description:"Optional org ID \u2014 if the direct key misses, falls back to the shared org namespace org:{org_id}:sem:{key}"}},required:["key"]}},{name:"cache_set",description:'Set a key-value pair in a running cache instance. Overwrites any existing value at the key \u2014 not idempotent for new data. Returns "OK" on success; returns an error if the instance_id is invalid or the instance is paused. Value can be a string or a JSON-serialized object. Optionally set a TTL in seconds (omit for no expiry). Use cache_mset instead for setting multiple keys in a single pipeline round-trip. Use cache_stream_set instead for caching LLM token streams (ordered string chunks).',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance (from list_instances)"},key:{type:"string",description:"Cache key"},value:{type:"string",description:"Value to store (string or JSON)"},ttl:{type:"number",description:"Time-to-live in seconds (optional, omit for no expiry)"},org_id:{type:"string",description:"Optional org ID \u2014 also writes the key to the shared org namespace org:{org_id}:sem:{key} with the same TTL"}},required:["key","value"]}},{name:"cache_delete",description:"Permanently delete one or more keys from a running cache instance (uses Redis DEL). This operation is destructive and irreversible \u2014 deleted keys cannot be recovered. Deleting a non-existent key is safe and returns 0 for that key (no error). Returns the count of keys that were actually deleted (existing keys only). Use this to explicitly remove stale entries; prefer cache_set with a short TTL for auto-expiring data. Do NOT use this to clear an entire instance \u2014 use the dashboard or delete_instance for that.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance to delete keys from (get from list_instances)"},keys:{type:"array",items:{type:"string"},description:"One or more cache keys to delete. Accepts exact keys only (no glob patterns \u2014 use cache_keys to list first)."}},required:["keys"]}},{name:"cache_exists",description:"Check whether one or more keys exist in a running cache instance (uses Redis EXISTS). Read-only \u2014 no side effects. Returns the count of keys that currently exist (integer 0 to N). If none of the keys exist, returns 0. If all exist, returns the total key count passed in. Duplicate keys in the input array are each counted separately (Redis behavior). Use this to check presence before a cache_get to avoid null handling, or to verify a cache warm-up completed. Use cache_get instead if you also need the value; use cache_ttl if you need expiry info.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance to check (get from list_instances)"},keys:{type:"array",items:{type:"string"},description:"Keys to check for existence. Accepts exact keys only (no glob patterns)."}},required:["keys"]}},{name:"cache_ttl",description:"Get the remaining time-to-live (TTL) of a key in seconds. Returns -1 if the key exists but has no expiry, -2 if the key does not exist. Read-only \u2014 no side effects. Use cache_set with a ttl parameter to set or update the expiry.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance (from list_instances)"},key:{type:"string",description:"Cache key to inspect"}},required:["key"]}},{name:"cache_keys",description:'List keys in a cache instance matching an optional glob pattern (e.g. "user:*", "session:*"). Uses SCAN to avoid blocking the server. Returns at most `count` keys.',inputSchema:{type:"object",properties:{instance_id:{type:"string"},pattern:{type:"string",description:"Glob pattern (default: *)"},count:{type:"number",description:"Max keys to return (default: 50, max: 500)"}},required:[]}},{name:"cache_stats",description:"Get real-time stats for a cache instance: memory usage, hit/miss rate, commands/sec, connected clients, keyspace info, and uptime. Read-only \u2014 no side effects. The instance_id identifies the target instance (obtain from list_instances). Use this for monitoring, capacity planning, or debugging performance issues \u2014 not for reading cached values (use cache_get for that). Use cache_exists or cache_ttl if you only need key-level information.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance (from list_instances)"}},required:[]}},{name:"semantic_search",description:'Find cached entries that are semantically similar to a natural-language query. Read-only \u2014 no side effects. Returns an array of objects, each with: key, value, similarity_score (0\u20131), and namespace. Returns an empty array if no entries meet the similarity threshold. Requires OPENAI_API_KEY (or compatible provider) and the Speed/Business tier with CACHLY_VECTOR_URL. Embeddings are computed server-side and never leave Germany (pgvector HNSW index). Example: "find all cached responses about password reset" or "what did we answer about pricing?". Use cache_get for exact key lookup; use smart_recall for brain lessons.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance (from list_instances)"},query:{type:"string",description:"Natural-language query to find similar cached content"},threshold:{type:"number",description:"Minimum cosine similarity 0\u20131 (default: 0.82). Lower = broader matches."},namespace:{type:"string",description:"Semantic namespace to search in (default: cachly:sem)"},top_k:{type:"number",description:"Maximum number of results to return (default: 5)"},use_hybrid:{type:"boolean",description:"Enable Hybrid BM25+Vector RRF fusion search. Passes `hybrid: true` and the query text to the pgvector API for higher precision on named entities. Default: false."},auto_namespace:{type:"boolean",description:"Auto-detect the namespace from the query text using text heuristics instead of using the `namespace` parameter. Returns results only from the matching domain (code/translation/summary/qa/creative)."}},required:["query"]}},{name:"detect_namespace",description:"Classify a prompt into one of 5 semantic namespaces using text heuristics. Overhead: <0.1 ms, no embedding required. Useful to understand which namespace cachly will use for a given prompt. Returns one of: cachly:sem:code, cachly:sem:translation, cachly:sem:summary, cachly:sem:qa, cachly:sem:creative.",inputSchema:{type:"object",properties:{prompt:{type:"string",description:"The text prompt to classify into a semantic namespace"}},required:["prompt"]}},{name:"cache_warmup",description:"Pre-warm the semantic cache with a list of prompt/value pairs. For each entry: computes an embedding, checks if a similar entry already exists (similarity \u2265 0.98), and writes new entries to Valkey + pgvector index. Use this to seed FAQ responses, product descriptions, or known-good LLM answers before the first real user traffic. Requires OPENAI_API_KEY.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},entries:{type:"array",description:"List of prompt/value pairs to pre-warm into the cache",items:{type:"object",properties:{prompt:{type:"string",description:"The query or question to cache"},value:{type:"string",description:"The answer or response to store for this prompt"},namespace:{type:"string",description:"Optional per-entry namespace override"}},required:["prompt","value"]}},namespace:{type:"string",description:"Default namespace for all entries (default: cachly:sem)"},ttl:{type:"number",description:"Time-to-live in seconds for warmed entries (omit for no expiry)"},auto_namespace:{type:"boolean",description:"Auto-detect the namespace per prompt using text heuristics. Overrides `namespace` when no per-entry namespace is set."}},required:["entries"]}},{name:"index_project",description:"Index local source files into the cachly semantic cache so AI assistants can use semantic_search to find relevant files instead of re-reading the whole codebase every time. Walks a directory recursively, reads each matching file, and stores a summary + path as a semantic cache entry (prompt = file path + content excerpt, value = relative path). Requires an embedding provider (OPENAI_API_KEY or CACHLY_EMBED_PROVIDER + key). Run once, then re-run after major refactors. TTL=86400 (24h) keeps entries fresh.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cachly instance"},dir:{type:"string",description:"Absolute path to the directory to index (e.g. /Users/you/myproject/src)"},extensions:{type:"array",items:{type:"string"},description:'File extensions to include (default: ["ts","js","go","py","java","rs","md","kt","swift"])'},max_files:{type:"number",description:"Maximum number of files to index (default: 100)"},ttl:{type:"number",description:"TTL in seconds for indexed entries (default: 86400 = 24 h)"},summary_chars:{type:"number",description:"Characters to use as summary per file (default: 1200)"},namespace:{type:"string",description:"Semantic namespace to store under (default: cachly:sem:code)"}},required:["dir"]}},{name:"cache_mset",description:"Set multiple key-value pairs in a single pipeline round-trip. Supports per-key TTL \u2013 unlike native MSET. Uses one TCP round-trip for N keys via Redis pipeline. Each item overwrites any existing value for that key. On partial failure the successfully pipelined keys are committed; a per-key error list is returned for any that failed. Returns a summary: { set: N, errors: [...] }. Use cache_set for a single key; use cache_stream_set for large streaming payloads.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},items:{type:"array",description:"Key-value pairs to set",items:{type:"object",properties:{key:{type:"string",description:"Cache key"},value:{description:"Value to store (JSON-serialised)"},ttl:{type:"number",description:"Per-key TTL in seconds (optional)"}},required:["key","value"]}}},required:["items"]}},{name:"cache_mget",description:"Retrieve multiple keys in one round-trip using native Redis MGET. Returns values in the same order as the keys array; missing keys are null.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},keys:{type:"array",items:{type:"string"},description:"List of keys to fetch"}},required:["keys"]}},{name:"cache_lock_acquire",description:"Acquire a distributed lock using Redis SET NX PX (Redlock-lite). Returns a fencing token on success. The lock auto-expires after ttl_ms to prevent deadlocks. Use cache_lock_release to free the lock early.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},key:{type:"string",description:"Lock resource identifier"},ttl_ms:{type:"number",description:"Safety TTL in milliseconds (e.g. 5000)"},retries:{type:"number",description:"Max acquire attempts (default: 3)"},retry_delay_ms:{type:"number",description:"Milliseconds between retries (default: 50)"}},required:["key","ttl_ms"]}},{name:"cache_lock_release",description:"Release a previously acquired distributed lock. Uses a Lua script for atomic release \u2013 only deletes the key if the fencing token matches.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},key:{type:"string",description:"Lock resource identifier (same as in cache_lock_acquire)"},token:{type:"string",description:"Fencing token returned by cache_lock_acquire"}},required:["key","token"]}},{name:"get_api_status",description:"Full diagnostic for your cachly Brain \u2014 call this FIRST whenever anything is not working. Returns: API reachability, JWT validity + expiry, your user ID, all Brain instances with live status (\u{1F7E2} running / \u{1F7E1} provisioning / \u{1F534} stopped), Redis ping on the active connection, and actionable fix steps for every issue found. Workflow: run get_api_status \u2192 read the issue it flags \u2192 fix it \u2192 retry your tool.",inputSchema:{type:"object",properties:{},required:[]}},{name:"remember_context",description:'Save context information to the cache so you can recall it later without re-computing. Perfect for caching: codebase overviews, file summaries, project structure, frequently-accessed data, or "thinking" results like dependency analysis. The AI assistant can use this to avoid re-reading the entire codebase every time. Overwrites any existing value stored under the same key. Returns { key, stored_at, ttl } confirming the saved context. Example: remember_context("project overview", "This is a Next.js app with...") then later: recall_context("project overview"). Use recall_context to retrieve; use list_remembered to see all stored keys.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},key:{type:"string",description:'Descriptive key like "project_overview", "auth_architecture", "file:src/index.ts"'},content:{type:"string",description:"The context/summary/analysis to remember"},category:{type:"string",enum:["overview","architecture","file_summary","dependency","thinking","custom"],description:"Category for organization (default: custom)"},ttl:{type:"number",description:"Time-to-live in seconds (default: 86400 = 24h, use 0 for no expiry)"}},required:["key","content"]}},{name:"recall_context",description:'Retrieve previously saved context from the cache. Returns the saved content or null if not found. Use this at the START of any task to check if you already have relevant context cached, before doing expensive operations like reading many files. Supports glob patterns: "file:*" matches all file summaries, "arch*" matches architecture-related keys.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},key:{type:"string",description:'The key to look up (supports glob pattern like "file:*")'}},required:["key"]}},{name:"list_remembered",description:"List all cached context entries for this project. Shows what knowledge the AI assistant has already cached, so you can decide whether to recall existing context or refresh it. Returns: key, category, size, TTL remaining, and a content preview.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},category:{type:"string",enum:["overview","architecture","file_summary","dependency","thinking","custom","all"],description:"Filter by category (default: all)"},limit:{type:"number",description:"Max entries to return (default: 50)"}},required:[]}},{name:"forget_context",description:'Delete one or more cached context entries. Use when context is stale or you want to force a fresh analysis. Supports glob patterns: "file:*" deletes all file summaries.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},keys:{type:"array",items:{type:"string"},description:"Keys to delete (supports glob)"}},required:["keys"]}},{name:"learn_from_attempts",description:'Store a lesson AFTER any non-trivial task (deploy, debug, fix, decision); future sessions recall it. instance_id may be omitted; the configured instance is used \u2014 never guess one. If the topic already exists, the write is an UPDATE and REQUIRES `grund` (one line: WHY the previous version was wrong) \u2014 without it the update is rejected. A conflicting outcome triggers a contradiction warning. Example: learn_from_attempts(topic="deploy:api", outcome="success", what_worked="PORT 3095 SERVES WHISPER \u2014 nohup docker compose up -d", severity="critical")',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},topic:{type:"string",description:'Short slug, e.g. "deploy:web", "debug:redis-tls", "fix:generate-series"'},outcome:{type:"string",enum:["success","failure","partial"],description:"Did it work?"},what_worked:{type:"string",description:"What solved it. LEAD WITH THE DECISIVE FACT (the number, address, command) in the first 100 characters \u2014 briefings truncate there."},what_failed:{type:"string",description:"What did NOT work (optional but valuable)"},context:{type:"string",description:'The SYMPTOM in the words someone would search for, before they knew the fix ("deploy stuck, rollout not finishing"). Plus error messages and root cause. Optional but high-value: it is what closes the gap between the question and the answer.'},severity:{type:"string",enum:["critical","major","minor"],description:"Impact severity: critical (blocks work/deploy), major (significant slowdown), minor (nice to know). Default: major."},file_paths:{type:"array",items:{type:"string"},description:'Files involved in this lesson (e.g. ["infra/deploy.sh", ".env"])'},commands:{type:"array",items:{type:"string"},description:'Commands that worked or failed (e.g. ["rsync -avz ...", "docker compose up -d"])'},tags:{type:"array",items:{type:"string"},description:'Topic tags for filtering (e.g. ["bash", "deploy", "env"])'},depends_on:{type:"array",items:{type:"string"},description:'Prerequisites, e.g. ["node:>=20", "docker:running"]. A stale one flags dependent lessons for review.'},author:{type:"string",description:'Who is storing this lesson, e.g. "alice". Enables cross-author reuse tracking.'},grund:{type:"string",description:"One line: WHY the previous version was wrong, like a commit message. REQUIRED when the topic already exists; optional on first write."},ersetzt:{type:"string",description:'Topic slug of an OLDER lesson this one refutes. The old one is suppressed in smart_recall and shows a "superseded" banner.'},gilt_ab:{type:"string",description:"ISO date since when the FACT is true (vs. when written). Omit if unknown. A replacement sets gilt_bis on the old lesson (then shown as history). About the fact, NOT an age decay."},visibility:{type:"string",enum:["team","private","public"],description:'Who can see it: "team" (default) = all members, "private" = only via exact recall_best_solution, "public" = same as team for now.'},service:{type:"string",description:'Service or system this lesson concerns, e.g. "prometheus", "auth-service".'},service_kind:{type:"string",enum:["service","system"],description:'"service" (default) for an application, "system" for infrastructure like prometheus or redis.'},group:{type:"string",description:'Optional sub-team scope, e.g. "backend". Only that group and admins see it. Independent of visibility.'}},required:["topic","outcome","what_worked"]}},{name:"recall_best_solution",description:'Recall the best known solution for a topic from past lessons. Call this BEFORE attempting any task that might have been done before. Returns the most recent successful lesson for the topic, with confidence indicator. \u26A0\uFE0F badge = lesson is >5d old (verify before applying). \u{1F534} = >10d old (likely stale!). Recalling a lesson resets its confidence clock to 1.0 (marks as recently verified). A superseded lesson shows a banner naming its successor; if the successor was deleted, the banner says so and the lesson counts as the best remaining answer. Example: recall_best_solution(topic="deploy:web") \u2192 returns the working deploy command.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},topic:{type:"string",description:'Topic slug to look up, e.g. "deploy:web". Supports partial match.'},author:{type:"string",description:'Who is asking (optional). Required to read a group-scoped lesson: without it, group-scoped lessons answer like "not found". Team-wide lessons need no author.'}},required:["topic"]}},{name:"recall_feedback",description:'Tell the Brain whether a recalled lesson ACTUALLY SOLVED your problem. This is the one signal the Brain cannot infer: recall_count only means "it was shown". Call it right after a lesson helped you \u2014 or after you solved something the Brain should have found. IMPORTANT: rank=0 means the lesson was NOT in the answer at all. That is the most valuable feedback there is, because it says the ranking never surfaced it. Example: recall_feedback(query="why does the deploy abort", topic="ci:timeout-reports-cancelled", helped=true, rank=0)',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},query:{type:"string",description:"The question you asked, as you asked it. Not a summary \u2014 the ranking has to learn from the real wording."},topic:{type:"string",description:"Topic of the lesson this is about. May be a lesson that was NOT returned (then set rank=0)."},helped:{type:"boolean",description:'Did it solve your problem? true or false. There is deliberately no "not sure" \u2014 a guessed value is worse than none.'},rank:{type:"number",description:"Where it stood in the answer, 1-based. 0 = it was NOT in the answer at all (the most valuable case)."},note:{type:"string",description:"Optional: what was missing, or why it did not fit."},author:{type:"string",description:"Optional: your handle."}},required:["query","topic","helped","rank"]}},{name:"smart_recall",description:'Semantically search cached context using natural language. instance_id may be omitted; the configured instance is used \u2014 never guess one.Instead of exact key matching, finds context by meaning. Example: smart_recall("how does authentication work") \u2192 returns cached auth architecture summary. Falls back to remember_context keys if no semantic match is found.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},query:{type:"string",description:"Natural language query to find relevant cached context"},threshold:{type:"number",description:"Similarity threshold 0-1 (default: 0.78)"},author:{type:"string",description:"Who is recalling (optional). Counts cross-author reuse."},context_files:{type:"array",items:{type:"string"},description:'Files you are working on, e.g. ["src/auth/service.ts"]. Lessons learned around these files rank higher.'}},required:["query"]}},{name:"session_start",description:"Single-call session briefing. Call this at the START of every session INSTEAD of multiple separate smart_recall/recall_best_solution calls. Returns: last session summary, recent lessons sorted by recency, relevant lessons for your focus area, open failures (topics with only failure outcomes), brain health stats, team telepathy (what teammates learned this week), predictive pre-warnings (if your focus area has known failure patterns), and memory crystals (compressed wisdom from old sessions). Also saves a session start marker so session_end can compute duration.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},focus:{type:"string",description:'Keywords for what you plan to work on today (e.g. "deploy infra api"). Used to surface relevant lessons at the top.'},author:{type:"string",description:'Your name or handle (e.g. "alice"). Enables Team Telepathy \u2014 filters YOUR lessons vs TEAM lessons from past 7 days.'},provider:{type:"string",description:'Current AI provider (e.g. "claude-code", "copilot", "cursor", "windsurf"). Shown in the briefing header and saved so the next provider can see who was last active.'},workspace_path:{type:"string",description:"Absolute path to the project root. If no session_end was found (e.g. context limit hit), reads git log to reconstruct what happened since last session."}},required:[]}},{name:"session_start_summary",description:"Focused session briefing for large brains. Returns only the top-N most relevant lessons for the given focus topic, scored by relevance, recall count, severity, recency, and outcome. Ideal when session_start returns too many lessons to fit in context (1000+ lesson brains). Use session_start for the full briefing including handoffs, streak, roadmap, and team telepathy.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},focus:{type:"string",description:'The topic or task you are about to work on (e.g. "deploy infra", "api auth"). Used to score and rank lessons by relevance.'},top_n:{type:"number",description:"Number of lessons to return (default 10, max 25). Lessons are ranked by relevance to focus."},author:{type:"string",description:"Your name or handle (optional). Same as session_start \u2014 used for team lesson filtering."}},required:["focus"]}},{name:"session_end",description:'Save a session summary when you finish working. Records what was accomplished, files changed, and lesson count. The next session_start will show this summary as "Last session". Call this when ending a work session, before going idle, or before summarizing. Ambient Learning: if workspace_path is provided, reads git log since session start and auto-learns from commits.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},summary:{type:"string",description:"Brief summary of what was accomplished this session (2-3 sentences)"},files_changed:{type:"array",items:{type:"string"},description:"Key files changed this session (optional)"},lessons_learned:{type:"number",description:"Number of new lessons stored this session (optional)"},workspace_path:{type:"string",description:'Absolute path to the project root (e.g. "/Users/you/myproject"). Enables Ambient Learning \u2014 reads git log since session start and auto-learns from commit messages.'}},required:["summary"]}},{name:"session_handoff",description:'Save a detailed handoff for the NEXT chat window / session. Stores: current progress, TODO list (done + remaining), changed files with descriptions, instructions for the next assistant, and any incomplete work. The next session_start automatically includes this handoff so the new window knows EXACTLY what happened and what remains. Call this BEFORE closing a chat window, especially if work is incomplete. This prevents the "continue" problem where new windows lose context, skip tasks, or produce broken code.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},completed_tasks:{type:"array",items:{type:"string"},description:'Tasks that were fully completed (e.g. "Implemented brainSearch() in JS SDK")'},remaining_tasks:{type:"array",items:{type:"string"},description:"Tasks NOT yet done \u2014 the next window MUST pick these up"},files_changed:{type:"array",items:{type:"object",properties:{path:{type:"string",description:"File path relative to project root"},status:{type:"string",enum:["complete","partial","broken"],description:"State of this file"},description:{type:"string",description:"What was changed and what still needs work"}},required:["path","status"]},description:"Changed files with their current state \u2014 marks partial/broken files so next window knows to fix them"},instructions:{type:"string",description:"Free-form instructions for the next assistant. Be specific: what to do next, what to avoid, what broke."},context_summary:{type:"string",description:"Brief summary of what happened this session (architecture decisions, key findings, blockers)"},blocked_on:{type:"string",description:'If work is blocked, describe what is needed to unblock (e.g. "waiting for API deploy", "needs user input on design")'}},required:["completed_tasks","remaining_tasks"]}},{name:"session_ping",description:"Lightweight checkpoint \u2014 call this every ~5 tool calls or whenever you complete a significant step. Stores the current task + files touched so session_start on the NEXT provider can reconstruct what happened even if session_end was never called (e.g. Claude context limit hit, window crashed). This solves the provider-switching problem: Claude \u2192 Copilot \u2192 Cursor all see the same last checkpoint. Extremely fast \u2014 one Redis SET, no blocking operations.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},task:{type:"string",description:'What you are currently working on (e.g. "Implementing invite handler in handler/invite.go")'},files_touched:{type:"array",items:{type:"string"},description:"Files modified so far this session"},next_step:{type:"string",description:"What the NEXT step is after this checkpoint (helps next provider resume immediately)"},provider:{type:"string",description:'Current AI provider (e.g. "claude-code", "copilot", "cursor", "windsurf")'}},required:["task"]}},{name:"auto_learn_session",description:"Auto-learn from a list of session observations WITHOUT explicit learn_from_attempts calls. Pass what happened (commands run, errors seen, solutions found) and the brain classifies and stores lessons automatically. Use at session_end to capture everything you did, even if you forgot to call learn_from_attempts. Returns a summary of what was auto-stored.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},observations:{type:"array",description:"List of observations from this session",items:{type:"object",properties:{action:{type:"string",description:"What was tried (command, approach, code change)"},outcome:{type:"string",enum:["success","failure","partial"],description:"Result"},details:{type:"string",description:"Error message, output, or explanation"},topic:{type:"string",description:"Optional topic key (auto-generated if omitted)"},severity:{type:"string",enum:["critical","major","minor"],description:"Severity (default: minor)"}},required:["action","outcome"]}}},required:["observations"]}},{name:"brain_who_knows",description:'Find who in your team has the most expertise on a given topic. Queries the org-wide knowledge graph (built automatically from learn_from_attempts author fields) and returns a ranked list of contributors whose lessons match the query, ordered by lesson count and confidence. Use to find the right person to ask before starting a task, or to understand knowledge distribution. Example: brain_who_knows(topic="kubernetes deployment") \u2192 "\u{1F947} alice \u2014 5 lessons, 94% confidence".',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},topic:{type:"string",description:"Topic or question to find experts for"},limit:{type:"number",description:"Max number of experts to return (default: 10)"}},required:["topic"]}},{name:"brain_file_map",description:'Show what cachly knows about a list of files \u2014 experts + related lessons per file. Call this before starting work on unfamiliar files, or in sync_file_changes to see what knowledge exists. For each file path: shows who has previously touched it (from learn_from_attempts author+file_paths) and which lessons reference it. Example: brain_file_map(file_paths=["src/auth/jwt.ts"]) \u2192 "\u{1F947} alice (3\xD7 \xB7 today) \u2014 related: fix:jwt-expiry".',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},file_paths:{type:"array",items:{type:"string"},description:"File paths to look up (max 10)"}},required:["file_paths"]}},{name:"team_expertise_map",description:"Full team expertise overview \u2014 who knows what, at a glance. Returns a ranked table of all contributors with their lesson count, top domains, and last-active date. Use for onboarding (who to ask about X?), retrospectives, or to find knowledge gaps. Built automatically from learn_from_attempts(author=...) calls \u2014 no setup needed.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},top_n:{type:"number",description:"Max contributors to show (default: 20)"}},required:[]}},{name:"brain_collab_pairs",description:`Show the Person\u2194Person Collaboration Graph for your team (W5). Lists every pair of contributors who have worked together \u2014 either by touching the same files in learn_from_attempts or by recalling each other's lessons via smart_recall(requester=...). Each pair includes a "Frag @X und @Y" routing suggestion \u2014 ideal for onboarding and bus-factor analysis. Also flags solo contributors whose knowledge no teammate has yet recalled (bus-factor risk). Example: brain_collab_pairs() \u2192 "@alice \u2194 @bob \u2014 12 events \xB7 ask them together about auth/payments".`,inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},min_weight:{type:"number",description:"Minimum collaboration events to show a pair (default: 1)"}},required:[]}},{name:"brain_portability",description:"Bring your own model, keep your brain: the same memory in every AI editor. Returns your Brain ID plus ready-to-paste MCP config snippets for every compatible AI client: Claude Code, Cursor, Windsurf, GitHub Copilot (VS Code), Cline, Zed, Continue. All 7 clients connect to the same Brain \u2014 same lessons, crystals, predictions, and team data. Use autopilot to configure all detected editors in one command. Example: brain_portability() \u2192 config blocks for 7 clients + model-neutrality proof table.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."}},required:[]}},{name:"skill_gaps",description:"Show knowledge blind spots in your Brain \u2014 domains with unresolved failures, lessons with missing attribution, and areas where brain_who_knows cannot help. Run periodically to find where to focus knowledge capture effort. Returns a prioritized list: \u{1F534} critical (failures with no solutions) \u2192 \u{1F7E1} warn \u2192 \u{1F535} info. Pairs with brain_coverage for a full knowledge-health picture.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},min_failures:{type:"number",description:"Min failure count to flag a domain as a gap (default: 1)"}},required:[]}},{name:"brain_coverage",description:'Knowledge-coverage health score for your codebase \u2014 scored 0-100. Reports: total lessons, success ratio, attribution completeness, team engagement, and file coverage vs git ls-files. Run after brain_from_git or periodically to track knowledge-capture progress. Use skill_gaps to find what to fix. Example: brain_coverage() \u2192 "\u{1F7E2} Overall score: 78/100 \xB7 42 lessons \xB7 6 contributors \xB7 31% files covered".',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},repo_path:{type:"string",description:"Path to the git repository (default: current directory)"}},required:[]}},{name:"brain_metrics",description:`Report the three decisive Brain metrics: (1) time-to-first-recall (onboarding friction), (2) recall-lift vs. raw BM25 (the moat proof, from Cachly-Bench), and (3) team-knowledge-reuse \u2014 what % of proven recalls used a teammate's lesson. Use to track whether the Brain is delivering its core value. Pass author="handle" to smart_recall so cross-author reuse can be measured.`,inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."}},required:[]}},{name:"brain_changelog",description:`Generate a human-readable Markdown changelog of lessons learned in the last N days. Groups lessons by topic category, annotates with author, recall count and confidence. Ideal for weekly standups, sprint retros, or async team updates \u2014 share the output directly in Slack or a doc. Example: brain_changelog(instance_id="...", days=7) \u2192 grouped Markdown changelog of the week's learning.`,inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},days:{type:"number",description:"How many days back to include (default: 7)"},max_lessons:{type:"number",description:"Maximum number of lessons to include (default: 30)"},include_failures:{type:"boolean",description:"Include failure-outcome lessons (default: true)"}},required:[]}},{name:"brain_service_map",description:'Map everything the Brain knows about a running service or system: who operates it, which files run in it, every known failure, and every proven fix. Built from lessons tagged with `service="..."` in learn_from_attempts. Ideal for incident triage \u2014 when a service is misbehaving (e.g. a restarting pod), instantly surface who knows it and what has gone wrong with it before. Example: brain_service_map(service="prometheus") \u2192 operators, known OOM failures, and the fixes that worked.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},service:{type:"string",description:'Name of the service/system to map (e.g. "prometheus", "cachly-web", "auth-service"). Matches the `service` tag on stored lessons.'}},required:["service"]}},{name:"sync_file_changes",description:"Associate recent file changes with brain knowledge. Pass a list of changed file paths (from `git diff --stat`). Returns lessons relevant to those files, and records the file changes in session history. Call this after commits so the brain tracks what changed and why.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},changed_files:{type:"array",items:{type:"string"},description:"List of changed file paths"},git_diff_stat:{type:"string",description:"Output of `git diff --stat` (optional)"},commit_msg:{type:"string",description:"Commit message (optional)"}},required:["changed_files"]}},{name:"team_learn",description:'Store a lesson in a shared team brain so all team members benefit. Like learn_from_attempts, but REQUIRES an author name for attribution. Shows up in team_recall with "by <author>" so the team knows who learned it.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},author:{type:"string",description:"Your name or handle (required for team attribution)"},topic:{type:"string",description:'Topic in category:keyword format (e.g. "deploy:api")'},outcome:{type:"string",enum:["success","failure","partial"],description:"What happened"},what_worked:{type:"string",description:"What worked (the solution)"},what_failed:{type:"string",description:"What did NOT work (avoid this)"},severity:{type:"string",enum:["critical","major","minor"],description:"Impact level"},file_paths:{type:"array",items:{type:"string"},description:"Relevant file paths"},commands:{type:"array",items:{type:"string"},description:"Commands that worked"},tags:{type:"array",items:{type:"string"},description:"Tags for categorization"}},required:["author","topic","outcome","what_worked"]}},{name:"team_confirm",description:"Endorse (review-confirm) a team lesson so trusted, human-reviewed knowledge ranks above unreviewed auto-learned entries. A senior review weighs more than a peer review; distinct endorsements add a small boost. Confirmed lessons surface higher in smart_recall and team_recall and carry a \u{1F6E1}\uFE0F/\u2714\uFE0F badge. Use this in code review or knowledge reviews to bless the canonical solution for a topic.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},topic:{type:"string",description:'Topic slug of the lesson to confirm (e.g. "deploy:api")'},reviewer:{type:"string",description:"Your name or handle (the reviewer endorsing this lesson)"},level:{type:"string",enum:["senior","peer"],description:'Review weight \u2014 "senior" ranks higher than "peer" (default: peer)'},note:{type:"string",description:"Optional review note (kept in the lesson audit trail)"}},required:["topic","reviewer"]}},{name:"team_assign_role",description:'Assign a role (admin | reviewer | contributor | viewer) to a team member on a shared brain instance. Roles control what each person can do: admin can manage roles and delete lessons; reviewer can senior-review (\u{1F6E1}\uFE0F badge, stronger recall boost); contributor can store lessons and peer-review (\u2714\uFE0F badge); viewer is read-only. First call bootstraps governance (no auth required when no admins exist yet). After that, only an admin can assign or change roles. Example: team_assign_role(handle="alice", role="reviewer", assigned_by="bob") \u2014 bob must be an admin.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},handle:{type:"string",description:"Handle or name of the team member to assign a role to"},role:{type:"string",enum:["admin","reviewer","contributor","viewer"],description:"Role to assign. admin: manage roles + all actions. reviewer: senior-review (\u{1F6E1}\uFE0F). contributor: store + peer-review. viewer: read-only."},assigned_by:{type:"string",description:"Handle of the admin performing the assignment (required after governance bootstrap)"}},required:["handle","role"]}},{name:"team_whoami",description:"Show your own role and capabilities on a shared brain instance. Tells you what you can do (store, review, manage roles) and who to contact if you need a higher role. Run this after onboarding to confirm your role was set correctly.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},handle:{type:"string",description:"Your handle or name"}},required:["handle"]}},{name:"team_roster",description:"Show all team members and their assigned roles on a shared brain instance. Returns a table of handles, roles (\u{1F451} admin \xB7 \u{1F6E1}\uFE0F reviewer \xB7 \u270F\uFE0F contributor \xB7 \u{1F441}\uFE0F viewer), and capabilities. Use during onboarding to see who can do what, or to verify role assignments.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"}},required:[]}},{name:"team_audit",description:'View the governance audit log for a shared brain \u2014 an immutable trail of who changed roles and who confirmed which lessons, with timestamps. Essential for enterprise compliance and security reviews. Admin-only once governance is active (an admin has been assigned). Events are recorded automatically on team_assign_role and team_confirm \u2014 no setup. Example: team_audit(requester="alice") \u2192 "\u{1F451} role: bob set carol viewer \u2192 contributor \xB7 \u2705 confirm: dave confirmed auth:jwt-skew (senior)".',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},requester:{type:"string",description:"Your handle \u2014 must be an admin once governance is active"},limit:{type:"number",description:"Max events to show, newest first (default: 50, max: 200)"}},required:[]}},{name:"team_grant_scope",description:'Add or remove a team member to/from a named group (sub-team) on a shared brain. Group-scoped lessons (stored with group="...") only surface in smart_recall for members of that group (and admins). This is team-level visibility, orthogonal to lesson-level private. Admin-gated after the role model is bootstrapped. Example: team_grant_scope(handle="alice", group="security", assigned_by="bob") \u2014 bob must be admin.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},handle:{type:"string",description:"Handle of the team member to add/remove"},group:{type:"string",description:'Group/sub-team name (e.g. "backend", "security", "platform")'},action:{type:"string",enum:["add","remove"],description:"add (default) or remove the member from the group"},assigned_by:{type:"string",description:"Handle of the admin performing the change (required after governance bootstrap)"}},required:["handle","group"]}},{name:"team_scopes",description:"List team groups and their members, or the groups a specific person belongs to. Pass handle to see one person's scopes; omit it to see all groups on the instance. Use to audit who can see group-scoped lessons.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},handle:{type:"string",description:"Optional \u2014 show only this person's group memberships"}},required:[]}},{name:"team_recall",description:"Recall lessons from a shared team brain, showing who learned what. Works on any shared instance (all team members using the same instance_id). Shows author, recency, and severity for each lesson. Use this to onboard new team members or find who knows about a topic.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},topic:{type:"string",description:"Topic or keyword to filter lessons (optional)"},author:{type:"string",description:"Filter by author name (optional)"},limit:{type:"number",description:"Max lessons to return (default: 10)"}},required:[]}},{name:"team_synthesize",description:"Team Brain Synthesis \u2014 merge multiple contributors' lessons on the same topic into one canonical version. When 2+ developers store lessons for the same topic with different details, this proposes the best merged version. Shows: all contributions by author, what worked (consensus), what failed (union), canonical lesson to store. Use this when onboarding new team members or before documenting a process.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},topic:{type:"string",description:'Topic slug to synthesize (e.g. "deploy:api")'}},required:["topic"]}},{name:"memory_crystalize",description:"Compress the last 30-50 sessions and auto-learned lessons into a dense Memory Crystal. A crystal is a compact, structured summary of everything the brain learned \u2014 grouped by category (deploy, fix, debug, \u2026). Crystals survive session cleanup and appear in session_start once enough sessions have accumulated. Run this monthly or after a big milestone to preserve institutional knowledge. Returns a digest of what was crystallized.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},label:{type:"string",description:'Optional label for this crystal (e.g. "Q1 2026", "v2 launch"). Auto-generated from date if omitted.'}},required:[]}},{name:"team_crystallize",description:'Create a Team Crystal \u2014 the team-wide, causal counterpart to memory_crystalize. Where memory_crystalize compresses ONE brain by category, team_crystallize surfaces what a per-user memory structurally cannot: which fixes solved structurally SIMILAR problems across MULTIPLE people. A pattern only crystallizes when 2+ distinct authors independently converged on it \u2014 that cross-person signal is the moat against single-user "Dreaming"-style memory. Needs attributed lessons (learn_from_attempts(author=...) / team_learn). Surfaces in crystal_view. Example: team_crystallize() \u2192 "\u{1F9E9} pool \u2014 3 people converged (alice, bob, carol): bounded pool + timeout".',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the shared team brain instance"},min_authors:{type:"number",description:"Min distinct authors that must converge for a pattern to crystallize (default: 2, min: 2)"},label:{type:"string",description:'Optional label (e.g. "Q1 2026"). Auto-generated from date if omitted.'}},required:[]}},{name:"roadmap_add",description:"Add a new item to the persistent project roadmap stored in the Brain. Items survive across sessions and editors \u2014 the roadmap is always up to date. Use for features, bugs, refactors, or any planned work. Call roadmap_list to see all open items, roadmap_next to get the next actionable item.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},title:{type:"string",description:"Short title of the task/feature (3\u201310 words)"},description:{type:"string",description:"What needs to be done, acceptance criteria, context"},priority:{type:"string",enum:["critical","high","medium","low"],description:"Priority level (default: medium)"},tags:{type:"array",items:{type:"string"},description:'Tags for filtering (e.g. ["api", "web", "sdk", "infra"])'},milestone:{type:"string",description:"Milestone/epic this belongs to (optional)"}},required:["title"]}},{name:"roadmap_update",description:"Update the status, priority, or details of a roadmap item. Use to move items through the lifecycle: planned \u2192 in-progress \u2192 done (or blocked/cancelled). Also use to add notes/findings while working on an item.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},id:{type:"string",description:"Item ID returned by roadmap_add or roadmap_list"},status:{type:"string",enum:["planned","in-progress","done","blocked","cancelled"],description:"New status for the item"},priority:{type:"string",enum:["critical","high","medium","low"],description:"Updated priority (optional)"},notes:{type:"string",description:"Progress notes, findings, or blockers (appended to existing notes)"},title:{type:"string",description:"Updated title (optional)"},description:{type:"string",description:"Updated description (optional)"}},required:["id"]}},{name:"roadmap_list",description:"List all roadmap items, optionally filtered by status, priority, tag, or milestone. Returns items sorted by priority then creation date. Called automatically by session_start to show open work.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},status:{type:"string",enum:["planned","in-progress","done","blocked","cancelled","open"],description:"Filter by status. Use 'open' to see planned+in-progress+blocked (default: open)"},tag:{type:"string",description:"Filter by tag (optional)"},milestone:{type:"string",description:"Filter by milestone (optional)"},priority:{type:"string",enum:["critical","high","medium","low"],description:"Filter by minimum priority (optional)"}},required:[]}},{name:"roadmap_next",description:"Get the single most important next actionable roadmap item. Returns the highest-priority in-progress item first, then planned items, sorted by priority. Call at session start to immediately know what to work on next.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},tag:{type:"string",description:"Filter by tag (optional)"}},required:[]}},{name:"brain_doctor",description:"Check the health of your AI Brain and get actionable recommendations. Reports: lesson count, context entries, last session age, open failures, quality score, effective IQ boost, stale index. Returns a prioritized list of issues with fix instructions.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},workspace_path:{type:"string",description:"Absolute path to workspace root \u2014 enables package.json analysis for openclaw cross-promo (optional)"}},required:[]}},{name:"brain_hygiene",description:"Autonomously sweep and maintain your Brain \u2014 flags stale lessons as provisional, archives long-dormant ones, and resolves contradictions where success clearly dominates failure. Safe to run on a schedule (weekly CI job) or on-demand before a big release. Lesson state lifecycle: active \u2192 provisional (confidence < threshold) \u2192 archived (stale + low-recall + old). Archived lessons are excluded from smart_recall but preserved for audit. dry_run=true (default false) shows what would change without writing anything.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},dry_run:{type:"boolean",description:"Report changes without applying them (default false)"},provisional_threshold:{type:"number",description:"Confidence below which a lesson is flagged provisional (default 0.5)"},archive_days:{type:"number",description:"Days after which a provisional low-recall lesson is archived (default 30)"}},required:[]}},{name:"global_learn",description:'Store a lesson that applies across ALL your projects (cross-project knowledge). Idempotent: if a lesson with the same topic already exists, it is updated in place \u2014 no duplicates are created. Returns a confirmation with the stored lesson key. No rate limits. Global lessons are stored with the prefix cachly:global:lesson: and recalled from any instance via global_recall. Use for tool preferences, personal workflows, platform quirks, and universal gotchas. Example: global_learn(topic="bash:macos-arrays", lesson="Arrays work differently on macOS bash 3.2"). Use learn_from_attempts for project-specific session lessons; use team_learn to share lessons with your team.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance (used for connection)"},topic:{type:"string",description:'Topic key in format "category:keyword"'},lesson:{type:"string",description:"The lesson content"},severity:{type:"string",enum:["critical","major","minor"],description:"Severity (default: minor)"},tags:{type:"array",items:{type:"string"},description:"Optional tags"}},required:["topic","lesson"]}},{name:"global_recall",description:"Read-only retrieval of cross-project lessons stored via global_learn. No side effects. Returns a list of matching global lesson objects, each with topic, lesson text, severity, and tags. If no topic is provided, returns all global lessons (up to 50). If topic is provided, returns all lessons whose topic key contains that string (partial match). Use this for lessons that apply universally across all projects (tool quirks, shell gotchas, platform behavior). Use recall_best_solution instead for project-specific lessons; use team_recall for org-scoped lessons.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance (used for connection)"},topic:{type:"string",description:"Topic or keyword filter (optional)"}},required:[]}},{name:"publish_lesson",description:"Publish a lesson to the Cachly Public Brain (anonymized community knowledge base). Published lessons can be imported by other developers via import_public_brain. PII is stripped automatically. Visible under the framework/category tag. Returns { lesson_id, topic, framework, published_at } confirming the publish. Irreversible \u2014 once published to the public brain, lessons cannot be deleted via the MCP interface. Use learn_from_attempts or global_learn for private lessons; use syndicate for anonymized global sharing without framework tagging.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},topic:{type:"string",description:"Topic key (used as public category)"},lesson:{type:"string",description:"Lesson to publish (PII will be stripped)"},framework:{type:"string",description:"Framework/platform tag (nextjs, fastapi, go, docker, etc.)"},severity:{type:"string",enum:["critical","major","minor"],description:"Severity"}},required:["topic","lesson"]}},{name:"import_public_brain",description:"Import community lessons from the Cachly Public Brain for a framework. Non-destructive: existing lessons with the same topic key are not overwritten. Returns the count of lessons imported and their topic slugs. Available frameworks: nextjs, fastapi, go, docker, kubernetes, react, typescript, python, rust, laravel, rails, spring. Use this to bootstrap a new brain with battle-tested community knowledge before your first session_start. Use publish_lesson to contribute your own lessons to the Public Brain; use learn_from_attempts for storing lessons from your own sessions.",inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance to import into"},framework:{type:"string",description:"Framework/platform to import lessons for"},limit:{type:"number",description:"Max lessons to import (default: 20)"}},required:["framework"]}},{name:"recall_at",description:'Brain Archaeology \u2014 see what a lesson looked like at a specific point in time. "What did we know about deployments 3 months ago?" Returns the history of a topic filtered to entries before the given date. Shows how the lesson evolved: failure \u2192 partial \u2192 success. Also useful to understand WHY old code decisions were made.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},topic:{type:"string",description:'Topic slug to look up, e.g. "deploy:api"'},date:{type:"string",description:'ISO date string (e.g. "2026-01-15") \u2014 returns entries stored BEFORE this date'}},required:["topic","date"]}},{name:"trace_dependency",description:'Causal Chain \u2014 find all lessons that depend on a given prerequisite. "What lessons are affected if node version changes?" When a dependency changes (new version, different provider, new OS), call this to see which lessons need review. Lessons store dependencies via the depends_on field in learn_from_attempts.',inputSchema:{type:"object",properties:{instance_id:{type:"string",description:"UUID of the cache instance."},dependency:{type:"string",description:'Dependency to trace (e.g. "node:>=20", "docker:running", "wireguard:active")'},mark_review:{type:"boolean",description:"If true, marks all dependent lessons as needs_review (default: false)"}},required:["dependency"]}},{name:"list_orgs",description:"List your Cachly organizations (team/org plans). Returns each org with plan, seat count, and member info. Org plans (Team \u20AC99, Business \u20AC299, Enterprise custom) are billed separately from cache tiers.",inputSchema:{type:"object",properties:{},required:[]}},{name:"create_org",description:"Create a new Cachly organization for team collaboration. After creation, invite team members with invite_member and upgrade the plan via the billing portal. Org plans: Team (\u20AC99/mo, 10 seats), Business (\u20AC299/mo, 50 seats), Enterprise (custom).",inputSchema:{type:"object",properties:{name:{type:"string",description:'Organization display name (e.g. "Acme Engineering")'},slug:{type:"string",description:'URL-safe slug (e.g. "acme-eng"). Auto-generated from name if omitted.'}},required:["name"]}},{name:"invite_member",description:"MUTATION \u2014 sends an invite email immediately and cannot be undone via MCP. Invite a team member to a Cachly organization by email. Requires the caller to be an admin or owner of the organization. Valid roles: admin (manage members + instances), member (read + cache ops). Default role: member. Returns an error if the email is already a member or has a pending invite.",inputSchema:{type:"object",properties:{org_id:{type:"string",description:"UUID of the organization"},email:{type:"string",description:"Email address to invite"},role:{type:"string",enum:["admin","member"],description:"Role for the invited member (default: member)"}},required:["org_id","email"]}},{name:"get_org_plan",description:"Get the current org plan, seat usage, and billing info for an organization. Shows: plan name, price, seats used/max, next billing date. To upgrade: use the billing portal URL returned by this tool.",inputSchema:{type:"object",properties:{org_id:{type:"string",description:"UUID of the organization"}},required:["org_id"]}},{name:"setup_ai_memory",description:`One-shot setup of the cachly 3-layer AI Memory system for a project.
2
2
 
3
3
  Layer 1 \u2014 Storage: your cachly instance (Valkey, persistent across sessions)
4
4
  Layer 2 \u2014 Tools: learn_from_attempts + recall_best_solution + smart_recall (the memory API)
@@ -1,2 +1,2 @@
1
- const i=["session_start","session_end","smart_recall","recall_best_solution","learn_from_attempts","remember_context","recall_context","forget_context","list_remembered","causal_trace","brain_predict","semantic_search","brain_search","autopilot","brain_doctor","brain_from_git","index_project","team_recall","team_learn","cache_get","cache_set","roadmap_add","roadmap_list","roadmap_next","roadmap_update","session_handoff"],_=["session_start","session_end","smart_recall","recall_best_solution","learn_from_attempts","remember_context","causal_trace","brain_doctor"],u="cachly_tool";function m(e){return["Run any of cachly's specialist tools by name.","","The most-used tools are listed separately above. This one reaches the",`other ${e.length} without their schemas taking up room in every request.`,"","Unsure about a tool's arguments? Call it with describe:true first \u2014 that","returns its input schema instead of running it.","",`Available: ${e.join(", ")}`].join(`
2
- `)}function p(e){return{name:u,description:m(e),inputSchema:{type:"object",properties:{tool:{type:"string",description:'Name of the tool to run, e.g. "team_roster".'},arguments:{type:"object",description:"Arguments for that tool. Use describe:true if unsure."},describe:{type:"boolean",description:"Return the tool's input schema instead of running it."}},required:["tool"]}}}function h(e,n=process.env){const c=new Set(e.map(t=>t.name)),o=i.filter(t=>!c.has(t));if(n.CACHLY_ALLE_WERKZEUGE==="1")return{katalog:[...e],uebrige:[],unbekannteKernnamen:o};const l=n.CACHLY_PROFILE==="lean"?_:i,a=new Set(l),s=e.filter(t=>a.has(t.name)),r=e.filter(t=>!a.has(t.name)).map(t=>t.name);return r.length>0&&s.push(p(r)),{katalog:s,uebrige:r,unbekannteKernnamen:o}}export{i as KERNWERKZEUGE,_ as SCHLANK_WERKZEUGE,u as VERTEILER,h as sichtbareWerkzeuge,m as verteilerBeschreibung,p as verteilerWerkzeug};
1
+ const c=["session_start","session_end","smart_recall","recall_best_solution","learn_from_attempts","remember_context","recall_context","forget_context","list_remembered","causal_trace","brain_predict","semantic_search","brain_search","autopilot","brain_doctor","brain_from_git","index_project","team_recall","team_learn","cache_get","cache_set","roadmap_add","roadmap_list","roadmap_next","roadmap_update","session_handoff"],u=["session_start","session_end","smart_recall","recall_best_solution","learn_from_attempts","remember_context","causal_trace","brain_doctor"],m=["smart_recall","recall_best_solution","causal_trace"],p="cachly_tool";function h(t){return["Run any of cachly's specialist tools by name.","","The most-used tools are listed separately above. This one reaches the",`other ${t.length} without their schemas taking up room in every request.`,"","Unsure about a tool's arguments? Call it with describe:true first \u2014 that","returns its input schema instead of running it.","",`Available: ${t.join(", ")}`].join(`
2
+ `)}function d(t){return{name:p,description:h(t),inputSchema:{type:"object",properties:{tool:{type:"string",description:'Name of the tool to run, e.g. "team_roster".'},arguments:{type:"object",description:"Arguments for that tool. Use describe:true if unsure."},describe:{type:"boolean",description:"Return the tool's input schema instead of running it."}},required:["tool"]}}}function f(t,a=process.env){const l=new Set(t.map(e=>e.name)),n=c.filter(e=>!l.has(e));if(a.CACHLY_ALLE_WERKZEUGE==="1")return{katalog:[...t],uebrige:[],unbekannteKernnamen:n};if(a.CACHLY_PROFILE==="recall"){const e=new Set(m);return{katalog:t.filter(r=>e.has(r.name)),uebrige:t.filter(r=>!e.has(r.name)).map(r=>r.name),unbekannteKernnamen:n}}const _=a.CACHLY_PROFILE==="lean"?u:c,s=new Set(_),i=t.filter(e=>s.has(e.name)),o=t.filter(e=>!s.has(e.name)).map(e=>e.name);return o.length>0&&i.push(d(o)),{katalog:i,uebrige:o,unbekannteKernnamen:n}}export{c as KERNWERKZEUGE,m as RECALL_WERKZEUGE,u as SCHLANK_WERKZEUGE,p as VERTEILER,f as sichtbareWerkzeuge,h as verteilerBeschreibung,d as verteilerWerkzeug};
package/glama.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://glama.ai/mcp/schemas/server.json",
3
- "version": "0.10.153",
3
+ "version": "0.10.155",
4
4
  "maintainers": [
5
5
  "HeinrichNebula"
6
6
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cachly-dev/mcp-server",
3
- "version": "0.10.153",
3
+ "version": "0.10.155",
4
4
  "mcpName": "io.github.cachly-dev/mcp-server",
5
5
  "description": "Your AI forgets everything between sessions. cachly fixes that permanently: 123 MCP tools for Claude Code, Cursor, Copilot & Windsurf. Learns from every bug fix, commit and CI run. Arrives pre-briefed. Free tier forever, EU servers, GDPR.",
6
6
  "type": "module",
package/server.json CHANGED
@@ -6,13 +6,13 @@
6
6
  "url": "https://github.com/cachly-dev/cachly-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.10.153",
9
+ "version": "0.10.155",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "name": "@cachly-dev/mcp-server",
14
14
  "identifier": "@cachly-dev/mcp-server",
15
- "version": "0.10.153",
15
+ "version": "0.10.155",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  }