Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(mcp): add memory_get and memory_query tools#8

Open
barakplasma wants to merge 1 commit into
sqliteai:mainsqliteai/sqlite-memory:mainfrom
barakplasma:add-memory-get-query-toolsbarakplasma/sqlite-memory:add-memory-get-query-toolsCopy head branch name to clipboard
Open

feat(mcp): add memory_get and memory_query tools#8
barakplasma wants to merge 1 commit into
sqliteai:mainsqliteai/sqlite-memory:mainfrom
barakplasma:add-memory-get-query-toolsbarakplasma/sqlite-memory:add-memory-get-query-toolsCopy head branch name to clipboard

Conversation

@barakplasma

Copy link
Copy Markdown

Summary

  • memory_get(hash) — returns the full dbmem_content row for a content hash from search results: hash, path, context, value, created_at, last_accessed. Useful when memory_search snippets are too short.
  • memory_query(query) — executes an arbitrary SELECT against the memory database. Read-only enforcement via PRAGMA query_only = ON on a dedicated connection (SQLite engine-level, not string matching).

Test plan

  • TestGetReturnsFullContent — inserts a row, verifies all fields appear in JSON output
  • TestGetNotFound — verifies error returned for missing hash
  • TestQuerySelectWorks — verifies SELECT returns expected rows as JSON
  • TestQueryRejectsWrites — verifies INSERT fails under query_only
  • TestToolNames — updated to include both new tools
  • TestToolsListMapping — count check still passes (tools/list matches ToolNames)

All 11 tests pass: go test ./internal/memory/... ./internal/mcp/...

🤖 Generated with Claude Code

memory_get(hash) returns the full dbmem_content row (hash, path, context,
value, created_at, last_accessed) for a given content hash from search results.

memory_query(query) executes an arbitrary SELECT against the memory database.
Read-only safety is enforced at the SQLite engine level via PRAGMA query_only=ON
on a dedicated connection, rather than a string-prefix check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.