@@ -40,13 +40,21 @@ async def recent_activity(
4040) -> str :
4141 """Get recent activity for a specific project or across all projects.
4242
43- This tool works in two modes based on the project parameter:
44-
45- **Discovery Mode (project=None)**: Returns activity summary across all projects,
46- enabling project discovery and cross-project activity overview.
47-
48- **Project-Specific Mode (project provided)**: Returns detailed activity for a
49- specific project with filtering and graph traversal capabilities.
43+ Project Resolution:
44+ The server resolves projects in this order:
45+ 1. Single Project Mode - server constrained to one project, parameter ignored
46+ 2. Explicit project parameter - specify which project to query
47+ 3. Default project - server configured default if no project specified
48+
49+ Discovery Mode:
50+ When no specific project can be resolved, returns activity across all projects
51+ to help discover available projects and their recent activity.
52+
53+ Project Discovery (when project is unknown):
54+ 1. Call list_memory_projects() to see available projects
55+ 2. Or use this tool without project parameter to see cross-project activity
56+ 3. Ask the user which project to focus on
57+ 4. Remember their choice for the conversation
5058
5159 Args:
5260 type: Filter by content type(s). Can be a string or list of strings.
@@ -62,34 +70,30 @@ async def recent_activity(
6270 - Relative: "2 days ago", "last week", "yesterday"
6371 - Points in time: "2024-01-01", "January 1st"
6472 - Standard format: "7d", "24h"
65- project: Optional project name. If not provided, uses default_project (if default_project_mode=true)
66- or returns activity across all projects for discovery.
67- If unknown, use list_memory_projects() to discover available projects.
73+ project: Project name to query. Optional - server will resolve using the
74+ hierarchy above. If unknown, use list_memory_projects() to discover
75+ available projects.
6876 context: Optional FastMCP context for performance caching.
6977
7078 Returns:
71- - ProjectActivitySummary: When project=None (discovery mode)
72- - GraphContext: When project is specified (project-specific mode)
79+ Human-readable summary of recent activity. When no specific project is
80+ resolved, returns cross-project discovery information. When a specific
81+ project is resolved, returns detailed activity for that project.
7382
7483 Examples:
75- # Default project mode or discovery mode
84+ # Cross- project discovery mode
7685 recent_activity()
7786 recent_activity(timeframe="yesterday")
7887
79- # Project-specific mode - detailed activity for one project
80- recent_activity(type="entity", timeframe="yesterday")
81- recent_activity(type=["entity"], timeframe="yesterday")
82- recent_activity(type=["relation", "observation"], timeframe="today")
83- recent_activity(type="entity", depth=2, timeframe="2 weeks ago")
84-
85- # Explicit project specification
88+ # Project-specific activity
8689 recent_activity(project="work-docs", type="entity", timeframe="yesterday")
90+ recent_activity(project="research", type=["entity", "relation"], timeframe="today")
91+ recent_activity(project="notes", type="entity", depth=2, timeframe="2 weeks ago")
8792
8893 Raises:
8994 ToolError: If project doesn't exist or type parameter contains invalid values
9095
9196 Notes:
92- - Discovery mode enables project selection without session state
9397 - Higher depth values (>3) may impact performance with large result sets
9498 - For focused queries, consider using build_context with a specific URI
9599 - Max timeframe is 1 year in the past
0 commit comments