docs: decision record for tool result payloads and excerpts

Adds docs/tool-result-payloads.md covering PRs #27-#29: why every tool
result repeats its payload as JSON text (claude.ai ignores
structuredContent; client detection and structured-only were rejected),
why memory_list / memory_search return excerpts (named to avoid the
snippet.* tools), and why excerpts weight rare query terms rather than
using ts_headline (tested; it picked the same wrong passage).

Links it from the README design notes, adds two troubleshooting entries,
and marks the "same 9 fields as list/search" claims in the earlier
decision record and in memory.get's comment as superseded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Opus 5.5 committed 2026-11-14 11:24:14 -08:00
1 parent 3da0c77849
commit c4f5231be9
4 files changed
+174 -3

No files matched your search

+4 -2
View File
@@ -534,8 +534,10 @@ const memoryGet: ToolDef = {
// lexeme index, which outgrows `content` itself on large memories) —
// both are Postgres retrieval internals that no MCP client can use,
// and together they were the majority of every response. Returning
// them also pushed large memories past the tool-output cap. This is
// the same 9-field shape memory.list and memory.search return.
// them also pushed large memories past the tool-output cap. These are
// the same 9 fields memory.list / memory.search return, except those
// add `contentLength` and, unless `full: true`, swap `content` for an
// `excerpt` + `truncated`.
const row = await db
.select({
id: memories.id,