personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(mcp): add 120-minute limit for transcript requests to prevent context overload

Add validation in _get_transcript_resource to reject requests exceeding 120 minutes, preventing agents from overloading context windows when fetching raw transcripts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

+12
+12
think/mcp_tools.py
··· 756 756 try: 757 757 # Parse the length as minutes and convert to end time 758 758 length_minutes = int(length) 759 + 760 + # Validate maximum length to prevent context overload 761 + if length_minutes > 120: 762 + error_content = f"# Error\n\nRequested {length_minutes} minutes exceeds the maximum of 120 minutes per call to minimize context overload. Please request a shorter time range." 763 + return TextResource( 764 + uri=f"journal://transcripts/{mode}/{day}/{time}/{length}", 765 + name=f"Transcripts Error ({mode}): {day} {time} ({length}min)", 766 + description=f"Error: Requested length exceeds maximum", 767 + mime_type="text/markdown", 768 + text=error_content, 769 + ) 770 + 759 771 from datetime import datetime, timedelta 760 772 761 773 # Parse start time