Skip to content

Bug: Server Return Type #461

@MartelleV

Description

@MartelleV

The code-review-graph server is returning a prompt where messages[0] is a raw dict instead of a proper Message object (or plain string), which Claude Code's MCP client rejects.

I think the MCP server's prompt template for debug_issue is constructing messages like:

{"role": "user", "content": "..."}  # raw dict

Hence it returns:

McpError: MCP error 0: Error rendering prompt 'debug_issue': messages[0] must be Message or str, got dict. Use Message({'role': 'user', 'content': '## Rules for Token-Efficient Graph Usage\n1. ALWAYS call get_minimal_context first with a task description.\n2. Use detail_level="minimal" on all tool calls unless the minimal output is insufficient.\n3. Only escalate to detail_level="standard" or "verbose" for the specific entities that need deeper inspection.\n4. Never request more than 3 tool calls per turn unless absolutely necessary.\n5. Prefer targeted queries (query_graph with a specific symbol) over broad scans (list_communities with full members).\n6. When reviewing changes: detect_changes(detail_level="minimal") → only expand on high-risk items.\n\n## Debug Workflow\n1. Call get_minimal_context(task="debug: Error").\n2. Call semantic_search_nodes(query=<keywords from description>, detail_level="minimal", limit=5).\n3. For the top 1-2 results, call query_graph(pattern="callers_of", target=<name>, detail_level="minimal").\n4. If the issue involves execution flow: call get_flow(name=<relevant flow>) for the single most relevant flow.\n5. Only call get_review_context or get_impact_radius if you need to trace the blast radius of a specific change.'}) to wrap the value.

My prompt was to use /code-review-graph:debug_issue prompt with Claude Code v2.1.119 on macOS. All models of Claude (Sonnet, Opus, Haiku), regardless of effort, got this error. Code-review-graph is installed via pipx, v2.3.3.

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