diff_graphs
Compare two graph snapshots by providing before and after session IDs to get a structured diff highlighting changes.
Instructions
Return a structured diff of the after graph relative to the before graph.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| before_session_id | Yes | ||
| after_session_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The core handler logic for the 'diff_graphs' tool. Retrieves engine handles for before/after session IDs and returns a structured diff including session metadata and engine diff results.
def diff_graphs(self, before_session_id: str, after_session_id: str) -> dict[str, Any]: before_handle = self._require_scanned_handle(before_session_id) after_handle = self._require_scanned_handle(after_session_id) return { "before_session": self._handle_to_dict(before_handle), "after_session": self._handle_to_dict(after_handle), "diff": after_handle.engine.diff_against(before_handle.engine), } - src/trailmark_mcp/mcp_app.py:51-54 (handler)MCP tool registration decorator for 'diff_graphs'. Defines the tool function that delegates to app_runtime.diff_graphs().
@mcp.tool() def diff_graphs(before_session_id: str, after_session_id: str) -> dict[str, Any]: """Return a structured diff of the after graph relative to the before graph.""" return app_runtime.diff_graphs(before_session_id=before_session_id, after_session_id=after_session_id) - ToolSpec definition for 'diff_graphs' with schema declarations for parameters 'before_session_id' and 'after_session_id' (both required strings) and category 'navigation'.
ToolSpec( name="diff_graphs", category="navigation", description="Return a structured diff of the after graph relative to the before graph.", parameters={ "before_session_id": _param("string", required=True), "after_session_id": _param("string", required=True), }, ),