Skip to main content
Glama

memory_context_invalidate

Invalidates the stable memory prefix after role changes or bulk memory rewrites so the next context render rebuilds it from current data.

Instructions

手动失效稳定前缀:角色设定变更、记忆被批量改写后调用,下一次渲染必然重建。

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": {
      "sessionId": "<sessionId>"
    },
    "name": "memory_context_invalidate"
  }
}

Input Schema

NameRequiredDescriptionDefault
sessionIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose the key consequence: the next render is guaranteed to rebuild the prefix, implying a cache-miss cost. It is silent on idempotency, behavior when no prefix is cached, permission requirements, and whether other sessions are affected. Valuable but incomplete for an unannotated mutation tool.

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

Conciseness4/5

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

A single compact sentence with the action front-loaded, followed by trigger conditions and the resulting effect. It is dense and efficient with essentially no filler, though the terse, jargon-heavy phrasing slightly reduces first-read clarity.

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

Completeness4/5

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

For a simple one-parameter tool with no output schema, the description covers what it does, when to invoke it, and the downstream effect. The remaining gap is scope (per-session) and return/error behavior, which is minor at this complexity level but not fully resolved.

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

Parameters2/5

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

The single required parameter sessionId has 0% schema description coverage and is never mentioned in the description. Critically, the description does not state that invalidation is scoped to one session — an agent must infer scope from the parameter name alone. This is the main semantic gap in the definition.

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

Purpose4/5

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

The description gives a specific verb (手动失效 / manually invalidate) applied to a named internal resource (稳定前缀 / stable prefix), which is enough to distinguish it from render, compose, and append siblings. The term 'stable prefix' is internal jargon not defined anywhere, so an agent new to the system may not fully grasp what object is being invalidated.

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

Usage Guidelines4/5

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

It states concrete trigger conditions: after persona/role settings change, or after memories are batch-rewritten. That is clear when-to-use guidance. It does not say when NOT to call it (e.g. that ordinary appends also dirty the prefix) or contrast it with memory_context_compose, which may also trigger a rebuild.

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