Skip to main content
Glama

optimize_stage

Stage a batch of memory optimization suggestions for human review. Validates, skips invalid ones, and returns a run ID for dashboard approval.

Instructions

Stage a batch of curation suggestions for human review in the dashboard.

Step 2 of the "optimize my memories" workflow. Writes the suggestions to a new optimization run; they are NOT applied here -- the user reviews and applies/rejects each one in the admin dashboard's Optimization tab, where a backup is taken before the first apply and every applied change can be undone.

Each suggestion is an object: {"kind": ..., "target_uid": ..., "payload": {...}, "rationale": "why", "verified": "what live-facts check you did"}

Kinds and their payload: compact / reword {"new_content": str} retag {"tags": str} comma-separated redomain {"domain": str} set_confidence {"confidence": "unverified|confirmed|contradicted"} archive {"reason": str} soft/reversible; never hard-deletes link {"from_uid", "to_uid", "relation_type", "note"?} merge {"keep_uid", "drop_uid", "note"?} links supersedes + archives drop distill {"source_uids": [uid, ...], "new_type": "note|reasoning|anti_pattern", "new_content": str, "tags"?, "domain"?}

distill extracts the durable knowledge out of one or MORE source memories into a newly authored one: creates it, links it supersedes each source and archives the sources (all reversible). Use it to retire closed-ticket checkpoints without losing what they taught, or as an n-ary merge when the survivor needs synthesized content.

link/merge derive target_uid from the payload (from_uid / drop_uid) and distill creates its target -- omit target_uid for those kinds. Destructive suggestions (archive, set_confidence=contradicted, distill) require a non-empty verified describing the live-facts check that justifies them.

Invalid suggestions are skipped and reported in errors; the rest are staged. Returns {run_id, staged, errors}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNo
suggestionsYes
Behavior5/5

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

With no annotations, the description provides extensive behavioral details: suggestions are not applied here, backups are taken, changes are reversible, destructive suggestions require verification, invalid suggestions are reported. No contradictions.

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?

The description is well-structured with clear sections and bullet points, but is somewhat verbose. Given the complexity of the tool, the length is justified, but there is some redundancy (e.g., repeated explanation of reversibility).

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?

Despite no output schema, the description explains the return structure (run_id, staged, errors). It covers workflow context, suggestion kinds, error handling, and behavioral guarantees, making it highly complete for the tool's complexity.

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

Parameters5/5

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

The description adds immense semantic value beyond the minimal schema (array of objects with additionalProperties). It fully specifies the structure of suggestion objects, including kinds, payloads, required fields, and examples. The 'note' parameter is not described, but the suggestions parameter is richly documented.

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

Purpose5/5

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

The description clearly states the tool's purpose: 'Stage a batch of curation suggestions for human review in the dashboard.' It specifies it's step 2 of a workflow and distinguishes it from siblings like optimize_scan and optimize_status by explaining the staging role.

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

Usage Guidelines4/5

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

The description explains the tool's role as part of a workflow ('Step 2 of the optimize my memories workflow'), but does not explicitly list alternatives or when not to use it. The context of sibling tools and the detailed kind descriptions indirectly guide usage.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Filipe-Soares-de-Almeida/MemAI'

If you have feedback or need assistance with the MCP directory API, please join our Discord server