Skip to main content
Glama

memory_index

Returns a budgeted, one-line index of records so an agent can choose which to open without loading the full store. Lines are conclusions; falls back to opening sentence if none written.

Instructions

THE ALWAYS-LOADED INDEX: one line per record, budgeted, so the right one gets opened.

A store too big to hold in context is read through a small index, and the agent decides what to open from those lines alone. The line is therefore the only surface a future need can reach: a record whose line does not distinguish it is present, correct, and never retrieved.

MEASURED on a 316-note store, 120 questions written from the note bodies and shown to no line-writer, ranking all 316 candidates. recall@3 on full questions / on the three-to-eight words someone types into a search box: a hand-written title-and-hook 0.333 / 0.508; the title alone 0.300 / 0.450; title plus its highest-idf terms 0.350 / 0.533; a line saying what the record CONCLUDED 0.683 / 0.833; the full records, as a ceiling, 0.858 / 0.967.

So the line worth having is a sentence about the conclusion, and no extraction produces one -- term-stuffing is a null on both registers. Which is why the useful call is not this one alone: read needs_line, write those sentences yourself, and store them with set_index_line. Without them this returns the fallback -- the record's opening sentence, measured through this same call at 0.442 / 0.525 against 0.692 / 0.842 with written lines -- and limits says which you got.

budget_tokens shortens lines to fit and NEVER drops a record -- a record with no line cannot be found at all -- so a budget too small to hold one line each is reported as exceeded rather than silently met. The one exception is not the budget's: a record a standing Art. 21 objection withholds (record_objection) gets no line, and withheld_by_objection counts them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
budget_tokensNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.20.1

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly explains critical behaviors: the fallback mechanism (opening sentence) and its measured performance, the budget handling (shortens lines, never drops records, reports exceeded budgets), and the exception for records withheld by standing objections. It also discloses the empirical recall@k performance data, which is unusual and highly informative. No annotation contradiction exists.

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 lengthy but front-loaded with the core concept ('THE ALWAYS-LOADED INDEX: one line per record') and then layers detail. Every sentence serves a purpose—explaining the index's role, empirical justification, usage guidance, and behavioral nuances. It could be slightly trimmed, but the density of information justifies its length. It is well-structured with a clear progression from purpose to usage to edge cases.

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?

Given the tool's complexity—having a fallback, budget constraints, and objectional withholding—the description is remarkably complete. It explains the return format characteristics (lines, `limits`, `withheld_by_objection`), the interaction with sibling tools, and the empirical basis for line quality. There is no output schema, so the description's coverage of these aspects fills the gap. An agent could call this tool correctly without further research.

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?

The schema has 0% description coverage, so the description must compensate. It explains the sole parameter `budget_tokens` in detail: it shortens lines to fit, never drops records, and when the budget is too small, it is reported as exceeded rather than silently met. This adds significant meaning beyond the bare integer type, including the behavioral implications of the parameter value.

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 that this tool returns a memory index consisting of one-line summaries per record, and that it serves as the initial surface for deciding which record to open. It distinguishes itself from siblings like `set_index_line` and `needs_line` by explaining its role in the read path, and it explicitly mentions the fallback behavior and the `limits` field. The purpose is specific and actionable, with a clear verb ('read'), resource ('index'), and scope ('one line per record').

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 description provides explicit usage guidance: it tells the agent to read `needs_line` to identify records lacking written lines, write those lines, and store them via `set_index_line`. It also clarifies when NOT to use this tool alone—that it returns a fallback unless written lines exist—and points to alternative sibling tools. This is explicit 'when and when-not' guidance, going beyond mere context.

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

Deploy Server

Other Tools