From a claude.ai session, memory_search and memory_list returned only "8 result(s)" / "30 result(s)", with no ids, content, tags or scores, so the caller couldn't read or memory_get anything it found.
Root cause
ok() in apps/web/lib/mcp/tools.ts put only the summary string in content and the payload only in structuredContent. The tools declare no outputSchema, and claude.ai renders only the content text blocks. Claude Code reads structuredContent, which is why the bug never showed there.
Every tool uses ok(), so the problem was wider than reported:
memory.get showed only memory <id>
snippet.get dropped the body
snippet.list showed only a count
project.identify and memory.write looked fine only because their summaries include the id
Fix
The first text block is now <summary>\n<JSON payload>, which is what the MCP spec asks for when a tool returns structured results. structuredContent is unchanged. I used one block instead of two because some clients render only the first block.
Tests
Added 5 integration tests that check the first text block of memory.list, memory.search (including rrfScore), memory.get, snippet.list and snippet.get contains ids and content, not just a count. All 5 failed before the fix with the reported symptom, and the full suite (75 tests) passes after. Typecheck and lint are clean.
After deploy
From a claude.ai session:
memory_search {query: "OLS Digital", project: "ols-digital"} should return memory e9e10431-47f2-4f82-ab6c-d1d363d9de65
memory_list {project: "ols-digital"} should list the same memory
## Problem
From a claude.ai session, `memory_search` and `memory_list` returned only `"8 result(s)"` / `"30 result(s)"`, with no ids, content, tags or scores, so the caller couldn't read or `memory_get` anything it found.
## Root cause
`ok()` in `apps/web/lib/mcp/tools.ts` put only the summary string in `content` and the payload only in `structuredContent`. The tools declare no `outputSchema`, and claude.ai renders only the `content` text blocks. Claude Code reads `structuredContent`, which is why the bug never showed there.
Every tool uses `ok()`, so the problem was wider than reported:
- `memory.get` showed only `memory <id>`
- `snippet.get` dropped the body
- `snippet.list` showed only a count
- `project.identify` and `memory.write` looked fine only because their summaries include the id
## Fix
The first text block is now `<summary>\n<JSON payload>`, which is what the MCP spec asks for when a tool returns structured results. `structuredContent` is unchanged. I used one block instead of two because some clients render only the first block.
## Tests
Added 5 integration tests that check the first text block of `memory.list`, `memory.search` (including `rrfScore`), `memory.get`, `snippet.list` and `snippet.get` contains ids and content, not just a count. All 5 failed before the fix with the reported symptom, and the full suite (75 tests) passes after. Typecheck and lint are clean.
## After deploy
From a claude.ai session:
- `memory_search {query: "OLS Digital", project: "ols-digital"}` should return memory `e9e10431-47f2-4f82-ab6c-d1d363d9de65`
- `memory_list {project: "ols-digital"}` should list the same memory
🤖 Generated with [Claude Code](https://claude.com/claude-code)
ok() put only a summary string ("8 result(s)") in `content` and the
actual payload only in `structuredContent`. Tools declare no
outputSchema, and claude.ai renders only the text blocks, so
memory.search / memory.list returned counts with no ids — the caller
could not read or memory.get anything it found. The same helper backs
every tool, so memory.get, snippet.get (body dropped) and snippet.list
were equally affected; project.identify and memory.write only looked
fine because their summaries embed the id.
The first text block is now `<summary>\n<JSON payload>`, per the MCP
spec's guidance that structured results also be returned as serialized
JSON text. structuredContent is unchanged for clients that consume it.
One block rather than two because some clients render only the first.
Adds integration tests asserting that the first text block of
memory.list, memory.search, memory.get, snippet.list and snippet.get
carries ids/content, not just the count.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jknapp
merged commit 3d43c40609 into main2026-11-14 18:56:07 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
From a claude.ai session,
memory_searchandmemory_listreturned only"8 result(s)"/"30 result(s)", with no ids, content, tags or scores, so the caller couldn't read ormemory_getanything it found.Root cause
ok()inapps/web/lib/mcp/tools.tsput only the summary string incontentand the payload only instructuredContent. The tools declare nooutputSchema, and claude.ai renders only thecontenttext blocks. Claude Code readsstructuredContent, which is why the bug never showed there.Every tool uses
ok(), so the problem was wider than reported:memory.getshowed onlymemory <id>snippet.getdropped the bodysnippet.listshowed only a countproject.identifyandmemory.writelooked fine only because their summaries include the idFix
The first text block is now
<summary>\n<JSON payload>, which is what the MCP spec asks for when a tool returns structured results.structuredContentis unchanged. I used one block instead of two because some clients render only the first block.Tests
Added 5 integration tests that check the first text block of
memory.list,memory.search(includingrrfScore),memory.get,snippet.listandsnippet.getcontains ids and content, not just a count. All 5 failed before the fix with the reported symptom, and the full suite (75 tests) passes after. Typecheck and lint are clean.After deploy
From a claude.ai session:
memory_search {query: "OLS Digital", project: "ols-digital"}should return memorye9e10431-47f2-4f82-ab6c-d1d363d9de65memory_list {project: "ols-digital"}should list the same memory🤖 Generated with Claude Code
ok() put only a summary string ("8 result(s)") in `content` and the actual payload only in `structuredContent`. Tools declare no outputSchema, and claude.ai renders only the text blocks, so memory.search / memory.list returned counts with no ids — the caller could not read or memory.get anything it found. The same helper backs every tool, so memory.get, snippet.get (body dropped) and snippet.list were equally affected; project.identify and memory.write only looked fine because their summaries embed the id. The first text block is now `<summary>\n<JSON payload>`, per the MCP spec's guidance that structured results also be returned as serialized JSON text. structuredContent is unchanged for clients that consume it. One block rather than two because some clients render only the first. Adds integration tests asserting that the first text block of memory.list, memory.search, memory.get, snippet.list and snippet.get carries ids/content, not just the count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>