Skip to content

feat(mcp): expose note external_id in list_directory and recent_activity output#1040

Open
jope-bm wants to merge 2 commits into
mainfrom
expose-note-ids-in-listing-output
Open

feat(mcp): expose note external_id in list_directory and recent_activity output#1040
jope-bm wants to merge 2 commits into
mainfrom
expose-note-ids-in-listing-output

Conversation

@jope-bm

@jope-bm jope-bm commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Dependency for basicmachines-co/basic-memory-cloud#1437 (flagged by its review): the hosted cloud MCP appends a web-app link template to list_directory and recent_activity results, telling agents to substitute each note's external_id — but neither tool rendered that id in its text output, so the template referenced a value the model couldn't see.

Change

  • list_directory file rows gain a trailing | id: <uuid> column.
  • recent_activity entity rows (single-project output) gain [id: <uuid>].

Both values already exist in the underlying API payloads (DirectoryNode.external_id, EntitySummary.external_id) — this only surfaces them in the rendered text. Directory rows and observation/relation rows are unchanged (no note to link). Discovery-mode output is deliberately untouched: it aggregates multiple projects, and the cloud side will suppress its single-project link template there.

Tests

Two new assertions locking the ids into the output format (every list_directory file row carries a UUID id; recent_activity entity rows carry one). Full suites for both tools pass (12 + 17); lint clean.

After merge, basic-memory-cloud bumps its pin and PR #1437's template footer becomes fillable end-to-end.

🤖 Generated with Claude Code

jope-bm and others added 2 commits July 5, 2026 13:25
…ity output

Web-app deep links are built from a note's external_id, and the hosted
cloud MCP appends a link template to these tools' results that agents
fill with that id on request. Neither tool rendered the id in its text
output, so the template referenced a value the model could not see
(basicmachines-co/basic-memory-cloud#1437 review).

list_directory file rows gain a trailing "| id: <uuid>" column;
recent_activity entity rows gain "[id: <uuid>]". Both values were
already present in the underlying API payloads (DirectoryNode,
EntitySummary) - this only surfaces them in the rendered text.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Joe P <joe@basicmemory.com>
The tools return str | list[dict] depending on output_format; the new
id-assertion tests called splitlines() without the isinstance narrowing
the sibling tests use, failing ty in CI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Joe P <joe@basicmemory.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant