What happened?
The get_page MCP tool ignores the per-call source_id parameter. MCP clients with a default-source bearer (e.g. hermes-write configured with source_id=default) cannot get_page pages in non-default sources — they get page_not_found, even when the page exists in the DB and the bearer has federated_read access.
The query tool already supports per-call source_id (via --source-id flag, v0.34). get_page should mirror that behavior.
What did you expect?
get_page({slug: "X", source_id: "priv-foo"}) returns the page when source priv-foo is in the bearer's federated_read list, regardless of ctx.sourceId.
Steps to reproduce
- Create a page in a non-default source:
docker exec gbrain-postgres psql -U gbrain -d gbrain -c
"INSERT INTO pages (slug, source_id, body) VALUES ('test/page', 'priv-test', 'body');"
- Use a bearer with
source_id=default AND priv-test in federated_read.
- Call
get_page:
curl -X POST http://localhost:3131/mcp
-H "Authorization: Bearer "
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"get_page",
"arguments":{"slug":"test/page","source_id":"priv-test"}}}'
Returns: {"error":"page_not_found"} — even though the page exists.
query with same source_id works correctly — finds the page
Environment
- gbrain version: 0.35.0.0
- OS: macOS
- Bun version: 1.3.14
- Database: self-hosted Postgres (Docker, pgvector/pgvector:pg16)
gbrain doctor --json output
{
"schema_version": 2,
"status": "ok",
"health_score": 95,
"checks": [
{"name": "connection", "status": "ok", "message": "Connected, 2210 pages"},
{"name": "pgvector", "status": "ok", "message": "Extension installed"},
{"name": "rls", "status": "ok", "message": "RLS enabled on 42/42 public tables"},
{"name": "schema_version", "status": "ok", "message": "Version 66 (latest: 66)"},
{"name": "embedding_provider", "status": "ok", "message": "ollama:nomic-embed-text"},
{"name": "search_mode", "status": "ok", "message": "Mode: tokenmax"},
{"name": "reranker_health", "status": "ok", "message": "zeroentropyai:zerank-2 reachable"}
],
"note": "Output truncated — only fields relevant to MCP get_page bug. Full doctor output available on request."
}
What happened?
The
get_pageMCP tool ignores the per-callsource_idparameter. MCP clients with a default-source bearer (e.g.hermes-writeconfigured withsource_id=default) cannotget_pagepages in non-default sources — they getpage_not_found, even when the page exists in the DB and the bearer hasfederated_readaccess.The
querytool already supports per-callsource_id(via--source-idflag, v0.34).get_pageshould mirror that behavior.What did you expect?
get_page({slug: "X", source_id: "priv-foo"})returns the page when sourcepriv-foois in the bearer'sfederated_readlist, regardless ofctx.sourceId.Steps to reproduce
docker exec gbrain-postgres psql -U gbrain -d gbrain -c
"INSERT INTO pages (slug, source_id, body) VALUES ('test/page', 'priv-test', 'body');"
source_id=defaultANDpriv-testinfederated_read.get_page:curl -X POST http://localhost:3131/mcp
-H "Authorization: Bearer "
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"get_page",
"arguments":{"slug":"test/page","source_id":"priv-test"}}}'
Returns:
{"error":"page_not_found"}— even though the page exists.querywith samesource_idworks correctly — finds the pageEnvironment
gbrain doctor --jsonoutput{ "schema_version": 2, "status": "ok", "health_score": 95, "checks": [ {"name": "connection", "status": "ok", "message": "Connected, 2210 pages"}, {"name": "pgvector", "status": "ok", "message": "Extension installed"}, {"name": "rls", "status": "ok", "message": "RLS enabled on 42/42 public tables"}, {"name": "schema_version", "status": "ok", "message": "Version 66 (latest: 66)"}, {"name": "embedding_provider", "status": "ok", "message": "ollama:nomic-embed-text"}, {"name": "search_mode", "status": "ok", "message": "Mode: tokenmax"}, {"name": "reranker_health", "status": "ok", "message": "zeroentropyai:zerank-2 reachable"} ], "note": "Output truncated — only fields relevant to MCP get_page bug. Full doctor output available on request." }