Skip to content

MCP graph tools: source_title parity with CLI graph JSON export #381

Description

@hurttlocker

#379 gave CLI graph JSON export nodes a source_title field with the shared citation-title fallback (search.CitationTitleForResult — section header first, then base filename). The MCP graph surface (internal/mcp/graph_tools.go) still exposes only the raw source string, so MCP consumers can't render the same human-readable titles.

Fix shape: add source_title,omitempty to the MCP graph fact/node structs and resolve it through the same CitationTitleForResult path — do not reimplement the fallback. Mind the N+1 noted in the sibling issue; a per-export memoization map works here too.

Verify: mirror the regression in cmd/cortex/graph_subject_test.go (memory with empty source_section → title falls back to base filename) as an MCP-level test in internal/mcp/graph_tools_test.go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions