Skip to content

MCP docs and suggested-questions tools fail in 2.3.2 #480

@Yacine-dev

Description

@Yacine-dev

Summary

In code-review-graph 2.3.2, two MCP convenience tools fail while the core graph commands and query tools work:

  1. get_docs_section_tool advertises sections such as usage, commands, and troubleshooting, but returns status: not_found for those exact names.
  2. get_suggested_questions_tool crashes with str object has no attribute resolve when a repo_root string is provided.

Environment

  • Package: code-review-graph
  • Version: 2.3.2
  • Python: /opt/anaconda3/bin/python / Python 3.12
  • Platform: macOS arm64
  • Install path: /opt/anaconda3/lib/python3.12/site-packages/code_review_graph

Reproduction

With a built graph:

code-review-graph build
code-review-graph status --repo /path/to/repo

MCP calls:

get_docs_section_tool(section_name="usage")
get_docs_section_tool(section_name="troubleshooting")
get_suggested_questions_tool(repo_root="/path/to/repo")

Observed responses:

{"status":"not_found","error":"Section 'usage' not found. Available: usage, review-delta, review-pr, commands, legal, watch, embeddings, languages, troubleshooting"}

Error calling tool 'get_suggested_questions_tool': 'str' object has no attribute 'resolve'

Root-cause evidence

For docs sections, code_review_graph/tools/docs.py searches for:

docs/LLM-OPTIMIZED-REFERENCE.md

but the installed wheel did not include that file in either expected location:

/opt/anaconda3/lib/python3.12/site-packages/docs/LLM-OPTIMIZED-REFERENCE.md
/opt/anaconda3/lib/python3.12/site-packages/code_review_graph/docs/LLM-OPTIMIZED-REFERENCE.md

For suggested questions, code_review_graph/tools/analysis_tools.py calls:

root = _validate_repo_root(repo_root)

where repo_root is a string. _validate_repo_root in tools/_common.py expects a Path and immediately calls:

resolved = path.resolve()

That produces the str object has no attribute resolve exception.

Expected behavior

  • get_docs_section_tool("usage") and other advertised sections should return the packaged section content, or the tool should not advertise unavailable sections.
  • get_suggested_questions_tool(repo_root="/path/to/repo") should validate/convert the string path and return suggested review questions.

Notes

Core graph operations were healthy in the same environment:

Files: 2613
Total nodes: 29469
Total edges: 322187
Embeddings: 26856 nodes embedded

So this appears isolated to the MCP convenience handlers / package data, not graph build or storage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions