Skip to content

feat(mcp): grafted_context_fetch tool — extends devagentic-lane-h plugin (#71 PR2)#72

Merged
PowerCreek merged 1 commit into
mainfrom
issue-71-grafted-context-fetch
May 24, 2026
Merged

feat(mcp): grafted_context_fetch tool — extends devagentic-lane-h plugin (#71 PR2)#72
PowerCreek merged 1 commit into
mainfrom
issue-71-grafted-context-fetch

Conversation

@PowerCreek

Copy link
Copy Markdown

PR2 of 3 closing #71. Depends on TechDevGroup/devagentic#220 (graftedContextById query — merge that first).

Summary

  • Extends plugins/devagentic-lane-h/client.py with fetch_grafted_context(graft_id, user_id=None) — wraps the new graftedContextById GraphQL query. Pattern mirrors existing fetch_reasoning_graft exactly (same plugin, same transport, same fail-soft contract).
  • Registers grafted_context_fetch(graft_id, user_id?) MCP tool in mcp_serve.py::_register_lane_h_tools next to lane_h_fetch.
  • 33 MCP tools registered total (was 32, +1 for grafted_context_fetch).

Why this plugin

The Lane H read pattern (G4 / hermes-agent#58) and the lazy-load preamble pattern (#71) are structurally identical — both fetch single per-user docs by id. Putting them in the same plugin keeps the worker's mental model simple (one "fetch a graft" surface, two doc kinds underneath).

Test plan

  • 8 new tests in tests/plugins/devagentic-lane-h/test_grafted_context_fetch.py cover: empty graft_id guard, missing user_id guard, happy path, user_id arg override, null doc → actionable error, network error, GraphQL errors, non-dict response.
  • 12 sibling tests in test_client.py still pass — no regression to the existing list_reasoning_grafts / fetch_reasoning_graft.
  • create_mcp_server() smoke registers 33 tools; grafted_context_fetch + lane_h_fetch both present.

Next in series

Notes

  • user_id arg supports operator-side queries from a different profile (e.g. inspecting another vertical's grafts from your hermes session). Defaults to the active profile when omitted — the usual case.
  • Server-side query enforces per-user scoping; passing the wrong user_id returns null rather than the doc. No cross-vertical leakage path exists from this client.

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