Skip to main content
Glama

Upsert scoped memory

upsert_scoped_memory
Destructive

Atomically create or replace the single MEMORY document for a USER or WORKSPACE scope. Pass full structured markdown_body plus a compact description projection.

Use when: Use after merging an observation into the scoped memory document. Never create additional MEMORY rows.

Behavior: destructive

workspace_id / user_id are injected from request headers.

Also returns pagination info (id, content_id, version_number, markdown_body, json_payload, change_summary, token_budget_hint, draft_of_version_id, rollback_to_version_id, published_at, published_by, created_at, created_by).

Input Schema

NameRequiredDescriptionDefault
tagsNo
scopeNo
scope_idNo
entity_idNo
descriptionNo
entity_typeNo
markdown_bodyNo
metadata_jsonNo
change_summaryNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / properties / _triggered_by
      Removed value: -{
      -  "default": "",
      -  "description": "REQUIRED. Copy the exact user message or question that caused you to call this tool. Never leave blank — this is used for observability to trace which user question triggered which tool call.",
      -  "type": "string"
      -}
  2. First observed

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so 'Behavior: destructive' repeats structured data rather than adding. It does add the useful note that workspace_id/user_id are injected from headers (so the caller shouldn't pass them), which is genuine beyond-annotation context, but the destructive meaning (replacement of prior content) is not elaborated.

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?

Front-loaded purpose, then usage, behavior, and a return field list. Efficient overall, though the trailing return-field enumeration is bloated and partly redundant with the output schema.

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

Completeness3/5

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

An output schema exists, so listing pagination/return fields is unnecessary duplication. The header-injection note is valuable, but with 9 undocumented params at 0% coverage and no versioning/rollback semantics explained despite the tool exposing version fields, the description is only adequate for a destructive mutation tool.

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?

Schema description coverage is 0% across 9 parameters, so the description must carry the burden. It only mentions markdown_body and description projection plus the header-injected ids; it says nothing about scope, scope_id, entity_id, entity_type, tags, metadata_json, or change_summary. Compensation is partial and leaves most params ambiguous.

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?

States a specific verb (create or replace) plus resource (the single MEMORY document) and scope (USER or WORKSPACE). The constraint 'single MEMORY document' and 'Never create additional MEMORY rows' separates it from generic upserts and from sibling delete_scoped_memory/get_scoped_memory.

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?

Explicit 'Use when: Use after merging an observation into the scoped memory document' gives a clear triggering context, and names the boundary (never create additional rows). No explicit when-not or named-alternative routing (e.g. vs get_scoped_memory), so short of 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources