-
Notifications
You must be signed in to change notification settings - Fork 156
fix: resolve MCP prompt rendering errors #524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Change TimeFrame to str in prompt signatures to ensure FastMCP can properly generate JSON schemas (affects continue_conversation, search, and recent_activity prompts) - Fix recent_activity_prompt architecture: the prompt was calling recent_activity.fn() which returns a formatted string, but then checking isinstance(result, ProjectActivitySummary) which always failed. Now the prompt uses the tool's string output directly and adds helpful guidance for next steps. - Update PromptContext dataclass to use str instead of TimeFrame - Pass type parameter as string "entity" instead of enum to match the tool's expected input format - Update tests to match new prompt output format Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Claude finished @groksrc's task in 2m 12s —— View job PR Review: MCP Prompt Type Annotations FixI've completed a comprehensive review of this PR against the Basic Memory team checklist. Here's my detailed analysis: ✅ Code Quality & StandardsFollows Basic Memory coding conventions: ✅
Type Annotations: ✅
No commented-out code: ✅ ✅ Testing & DocumentationTest Coverage: ✅ EXCELLENT
Test Quality: ✅
Coverage Maintenance: ✅
Documentation: ✅
✅ Basic Memory ArchitectureMCP Prompt Design: ✅ SIGNIFICANT IMPROVEMENT
Atomic, Composable Operations: ✅
Type Parameter Handling: ✅
✅ Security & PerformanceNo Security Issues: ✅
Performance: ✅
✅ CompatibilityWindows Compatibility: ✅ N/A (no file path operations in changes) Console Output: ✅
📋 Review Checklist ResultsCode Quality & Standards
Testing & Documentation
Basic Memory Architecture
Security & Performance
Compatibility
🎯 SummaryThis is a high-quality fix that addresses two important issues:
Key Improvements:
Outstanding Item:
Recommendation: ✅ APPROVE - This PR is ready to merge pending the manual test validation. |
Summary
TimeFrametostrin prompt type annotations for FastMCP JSON schema compatibilityrecent_activity_promptarchitecture - it was checkingisinstance(result, ProjectActivitySummary)on a stringProblem
The
recent_activityMCP prompt was failing with "Error rendering prompt recent_activity" because:Type annotation issue:
TimeFrame = Annotated[str, BeforeValidator(...)]could cause issues with FastMCP's JSON schema generation for prompt parametersArchitecture bug: The prompt called
recent_activity.fn()which returns a formatted string, but then checkedisinstance(recent, ProjectActivitySummary)which was alwaysFalseSolution
timeframeparameters fromTimeFrametostrrecent_activity_promptto use the tool's string output directly and add helpful guidancePromptContextdataclass to usestrinstead ofTimeFrametype="entity"as string instead of enum[SearchItemType.ENTITY]Test plan
/basic-memory-cloud:recent_activity (MCP)in Claude Code🤖 Generated with Claude Code