fix: Add explicit type annotations to MCP tool parameters#394
fix: Add explicit type annotations to MCP tool parameters#394phernandez merged 2 commits intomainfrom
Conversation
Fixes #393 - Add TagType annotation to write_note.tags parameter - Replace StringOrInt type alias with inline union type in build_context.depth - Ensures MCP protocol compatibility with clients that require explicit types MCP clients like qwen code were skipping these tools due to missing or non-serializable type information in parameter schemas. All MCP tool parameters must have explicit, JSON-serializable type annotations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Paul Hernandez <phernandez@users.noreply.github.com>
|
Claude finished @phernandez's task —— View job PR Review Complete ✅I've reviewed this PR against the Basic Memory team checklist. Here's my analysis: Tasks
Review SummaryThis PR successfully addresses issue #393 by adding explicit type annotations to MCP tool parameters. The changes are minimal, focused, and follow the project's coding standards. ✅ Approved Changes1.
|
Pyright doesn't allow type alias variables in function signatures. Changed tags: TagType to tags: list[str] | str | None to match the pattern used in build_context.py. Fixes type checking errors across all platforms. Signed-off-by: phernandez <paul@basicmachines.co>
|
Claude finished @phernandez's task —— View job PR Review Complete ✅I've reviewed this PR against the Basic Memory team checklist. Here's my comprehensive analysis: SummaryThis PR addresses issue #393 by fixing MCP tool parameter type annotations that were causing tools to be skipped by MCP clients like Detailed ReviewCommit 1:
|
Description
Fixes #393
This PR adds explicit type annotations to MCP tool parameters that were causing tools to be skipped by MCP clients like
qwen code.Changes
TagTypeannotation towrite_note.tagsparameterStringOrInttype alias with inline union type inbuild_context.depthRoot Cause
MCP clients require all tool parameters to have explicit, JSON-serializable type annotations. The issues were:
write_note: Thetagsparameter had no type annotation (tags=None)build_context: Used Python 3.12+ type alias (type StringOrInt = str | int) which doesn't serialize to JSON schemaTesting
qwen codeCLIGenerated with Claude Code