Skip to main content
Glama

optimize_scan

Read-onlyIdempotent

Dump the memory corpus compactly to plan a curation pass: lists curation fields, relations, usage counts, dedup hints, and anchors for checking against live facts.

Instructions

Dump the memory corpus compactly so you can plan a curation pass.

Step 1 of the "optimize my memories" workflow: every memory's curation-relevant fields, the relation edges among them, usage counts, dedup and domain hints, and per-memory anchors (URLs, paths, identifiers) to check against live facts. Read it, then stage what you decided with optimize_stage.

Start with what the store already says is suspect: due: true on a memory means its own writer dated it for a recheck and the date has passed, and source_ref says what to check it against.

recalls and stats.never_recalled are NOT that. A low count means unproven, not useless -- a memory about a rare subject looks exactly like a memory nobody wants, and the rare subject is frequently the reason the store is there. Use the aggregate to judge the STORE and never a single row: do not propose archiving something because it is unread.

The listing is slim so a big store fits one response, and a page ends early at an internal size budget -- truncated means page onward with offset + count. relations_truncated means the page's first memory has more edges than fit: get_relations(uid) lists them all. stats.by_domain names the largest domains; stats.domains counts every one.

BEFORE PROPOSING ANY CHANGE, CHECK IT AGAINST LIVE FACTS, and record what you checked in each suggestion's verified. Destructive kinds are rejected without it: cross-check newer memories in the corpus, verify code anchors against the live repo, web-check world facts.

Input Schema

NameRequiredDescriptionDefault
fullNotrue keeps whole bodies instead of the slim listing.
typeNoone memory type, as search() takes it; empty is every type.
limitNothe most memories per page.
sinceNolimits the scan to what changed after this date, for recurring passes.
domainNoscans a path and everything nested under it; empty is the whole project.
offsetNowhere the page starts; after a `truncated` page, offset + count.
include_archivedNotrue lists archived memories as well.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changedv0.16.1
    • addedInput schema / properties / domain / description
      Added value: +"scans a path and everything nested under it; empty is the whole project."
    • removedInput schema / properties / domain / title
      Removed value: -"Domain"
    • addedInput schema / properties / full / description
      Added value: +"true keeps whole bodies instead of the slim listing."
    • removedInput schema / properties / full / title
      Removed value: -"Full"
    • addedInput schema / properties / include_archived / description
      Added value: +"true lists archived memories as well."
    • removedInput schema / properties / include_archived / title
      Removed value: -"Include Archived"
    • addedInput schema / properties / limit / description
      Added value: +"the most memories per page."
    • removedInput schema / properties / limit / title
      Removed value: -"Limit"
    • addedInput schema / properties / offset / description
      Added value: +"where the page starts; after a `truncated` page, offset + count."
    • removedInput schema / properties / offset / title
      Removed value: -"Offset"
    • addedInput schema / properties / since / description
      Added value: +"limits the scan to what changed after this date, for recurring passes."
    • removedInput schema / properties / since / title
      Removed value: -"Since"
    • addedInput schema / properties / type / description
      Added value: +"one memory type, as search() takes it; empty is every type."
    • removedInput schema / properties / type / title
      Removed value: -"Type"
    • removedInput schema / title
      Removed value: -"optimize_scanArguments"
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly/idempotent/non-destructive), and the description adds substantial operational detail beyond them: the listing is deliberately slim to fit one response, pages end early at an internal size budget, and the `truncated`/`relations_truncated` flags define exact recovery behavior. It also explains output semantics (due, source_ref, anchors) and warns that destructive changes are rejected without verification.

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 purpose and next-step routing are front-loaded in the first two sentences, and the paragraph blocks (suspect signals, output shape, verification rule) are logically ordered. It is longer than strictly needed for a 7-param scan and some guidance bleeds into downstream propose behavior, but every section carries usable information.

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?

With no output schema, the description carries the full burden and does so: it describes the return shape (slim listing, per-memory anchors, due, source_ref), the stats aggregates (by_domain, domains, never_recalled), and pagination/truncation recovery. Nothing an agent needs to call and interpret the scan is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so all seven parameters (full, type, limit, since, domain, offset, include_archived) are already documented in the schema. The description adds only incremental meaning for offset ('after a truncated page, offset + count'); it does not explain full, since, or domain behavior beyond what the schema states, so the baseline 3 applies.

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 (dump/scan) and resource (the memory corpus) and frames it as 'Step 1 of the optimize my memories workflow', which distinguishes it cleanly from siblings like search, list_recent, or list_by_domain. An agent can tell this is the bulk-scan entry point for curation 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?

Explicit workflow routing: 'Read it, then stage what you decided with optimize_stage' names the follow-up tool, and 'get_relations(uid) lists them all' names the alternative for truncated relations. It also gives explicit when-NOT guidance ('do not propose archiving something because it is unread') with the reasoning, so an agent won't misuse the recalls signal.

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