Skip to main content
Glama
ClickHouse Loom

ClickHouse Loom

Official

loom_memory_apply

Apply one change—delete, expire, lock, label, or demote—across many existing memories matched by keys, filter, or search. Previews affected rows by default before writing.

Instructions

WHAT: One change over many EXISTING memories, previewed first; it never creates one (save facts with loom_memory_set, one per fact). target names exactly one of keys | filter (tags_any/tags_all, memory_type, key_prefix, created_before/after, confidence_lte, source_trace) | search {query}; limit is required for filter/search; action is delete | expire | lock | label | demote with its block (expire {ttl_seconds|until, on_expire}, lock {mode}, label {tags, mode add|replace|remove}, demote {confidence_factor | confidence_delta}); reason is required. dry_run defaults to TRUE and lists every row it would touch (would_apply / refused); call again with dry_run=false to write. A locked row comes back as status 'refused', never an error. WHEN: anything that names a set rather than one key — 'forget everything about the Q3 migration', 'these are getting stale, lower their confidence', 'tag every runbook as ops', 'lock everything I saved about the incident', 'expire the meeting notes in 30 days'. WHEN NOT: One key is loom_memory_delete, loom_memory_update or loom_memory_lock; every memory of an agent or user is memory.clear (via loom_op). Never skip the dry run when the user has not seen the list.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "target": "<target>",
      "action": "<action>",
      "reason": "<reason>"
    },
    "name": "loom_memory_apply"
  }
}

Input Schema

NameRequiredDescriptionDefault
lockNo
labelNo
limitNo
actionYes
demoteNo
expireNo
reasonYes
run_idNo
targetYes
dry_runNo
namespaceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.5/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false, destructiveHint=false, idempotentHint=false; the description adds substantial context beyond that — dry_run defaults to TRUE and returns would_apply/refused rows, a locked row returns status 'refused' rather than an error, and repeat-with-dry_run=false is the write path. That is genuine disclosure. However, with a delete/expire action present while destructiveHint=false, the description never reconciles reversibility or confirm that expiring is undoable, leaving a gap on the safety profile.

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

Conciseness5/5

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

Rigid WHAT / WHEN / WHEN NOT structure front-loads the operation and the preview rule, and each clause carries distinct information (defaults, refusal semantics, sibling routing) rather than restating the name. Long sentences are justified by 11 parameters and five action variants.

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

Completeness5/5

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

For an 11-parameter batch mutation with no output schema, the definition supplies the default behavior, the returned preview shape (would_apply / refused), the refusal-as-status rule, action-specific blocks, and the mandatory reason — everything an agent needs to call it correctly.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must carry the load, and it largely does: it defines target as exactly one of keys | filter | search, enumerates the filter predicates, notes limit is required for filter/search, lists the five actions with their blocks, and states reason is required. It stops short of documenting formats for expire.until, lock.until, or search.min_score, which stay unexplained outside the schema enums.

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

Purpose5/5

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

Opens with a precise verb+resource+scope ('One change over many EXISTING memories, previewed first') and explicitly bounds it negatively ('it never creates one'), routing creation to loom_memory_set. An agent can distinguish bulk-apply from the single-key siblings without opening the schema.

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

Usage Guidelines5/5

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

The WHEN block gives concrete natural-language triggers ('forget everything about the Q3 migration', 'tag every runbook as ops'), and WHEN NOT names specific alternatives (loom_memory_delete/update/lock for one key, memory.clear for all memories) plus a hard rule: never skip the dry run when the user has not seen the list.

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