claude-self-reflect 2.5.8 → 2.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mcp-server/pyproject.toml +1 -1
- package/mcp-server/src/server.py +40 -39
- package/package.json +1 -1
package/mcp-server/src/server.py
CHANGED
|
@@ -192,10 +192,13 @@ async def reflect_on_past(
|
|
|
192
192
|
|
|
193
193
|
# Determine project scope
|
|
194
194
|
target_project = project
|
|
195
|
+
|
|
196
|
+
# Always get the working directory for logging purposes
|
|
197
|
+
cwd = os.environ.get('MCP_CLIENT_CWD', os.getcwd())
|
|
198
|
+
|
|
195
199
|
if project is None:
|
|
196
200
|
# Use MCP_CLIENT_CWD environment variable set by run-mcp.sh
|
|
197
201
|
# This contains the actual working directory where Claude Code is running
|
|
198
|
-
cwd = os.environ.get('MCP_CLIENT_CWD', os.getcwd())
|
|
199
202
|
|
|
200
203
|
# Extract project name from path (e.g., /Users/.../projects/project-name)
|
|
201
204
|
path_parts = Path(cwd).parts
|
|
@@ -744,18 +747,17 @@ async def quick_search(
|
|
|
744
747
|
project: Optional[str] = Field(default=None, description="Search specific project only. If not provided, searches current project based on working directory. Use 'all' to search across all projects.")
|
|
745
748
|
) -> str:
|
|
746
749
|
"""Quick search that returns only the count and top result for fast overview."""
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
)
|
|
750
|
+
# MCP architectural limitation: MCP tools cannot call other MCP tools
|
|
751
|
+
return """<error>
|
|
752
|
+
MCP Architectural Limitation: This tool cannot directly call other MCP tools.
|
|
753
|
+
|
|
754
|
+
To perform a quick search, please:
|
|
755
|
+
1. Call reflect_on_past directly with limit=1 and brief=True
|
|
756
|
+
2. Or use the reflection-specialist agent for quick searches
|
|
757
|
+
|
|
758
|
+
This limitation exists because MCP tools can only be orchestrated by the client (Claude),
|
|
759
|
+
not by other tools within the MCP server.
|
|
760
|
+
</error>"""
|
|
759
761
|
|
|
760
762
|
# Parse and reformat for quick overview
|
|
761
763
|
import re
|
|
@@ -795,17 +797,20 @@ async def search_summary(
|
|
|
795
797
|
project: Optional[str] = Field(default=None, description="Search specific project only. If not provided, searches current project based on working directory. Use 'all' to search across all projects.")
|
|
796
798
|
) -> str:
|
|
797
799
|
"""Get aggregated insights from search results without individual result details."""
|
|
798
|
-
#
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
800
|
+
# MCP architectural limitation: MCP tools cannot call other MCP tools
|
|
801
|
+
# This is a fundamental constraint of the MCP protocol
|
|
802
|
+
return """<error>
|
|
803
|
+
MCP Architectural Limitation: This tool cannot directly call other MCP tools.
|
|
804
|
+
|
|
805
|
+
To get a search summary, please use the reflection-specialist agent instead:
|
|
806
|
+
1. Call the reflection-specialist agent
|
|
807
|
+
2. Ask it to provide a summary of search results for your query
|
|
808
|
+
|
|
809
|
+
Alternative: Call reflect_on_past directly and analyze the results yourself.
|
|
810
|
+
|
|
811
|
+
This limitation exists because MCP tools can only be orchestrated by the client (Claude),
|
|
812
|
+
not by other tools within the MCP server.
|
|
813
|
+
</error>"""
|
|
809
814
|
|
|
810
815
|
# Parse results for summary generation
|
|
811
816
|
import re
|
|
@@ -869,21 +874,17 @@ async def get_more_results(
|
|
|
869
874
|
project: Optional[str] = Field(default=None, description="Search specific project only")
|
|
870
875
|
) -> str:
|
|
871
876
|
"""Get additional search results after an initial search (pagination support)."""
|
|
872
|
-
#
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
response_format="xml",
|
|
884
|
-
brief=False,
|
|
885
|
-
include_raw=False
|
|
886
|
-
)
|
|
877
|
+
# MCP architectural limitation: MCP tools cannot call other MCP tools
|
|
878
|
+
return """<error>
|
|
879
|
+
MCP Architectural Limitation: This tool cannot directly call other MCP tools.
|
|
880
|
+
|
|
881
|
+
To get more search results, please:
|
|
882
|
+
1. Call reflect_on_past directly with a higher limit parameter
|
|
883
|
+
2. Or use the reflection-specialist agent to handle pagination
|
|
884
|
+
|
|
885
|
+
This limitation exists because MCP tools can only be orchestrated by the client (Claude),
|
|
886
|
+
not by other tools within the MCP server.
|
|
887
|
+
</error>"""
|
|
887
888
|
|
|
888
889
|
# Parse and extract only the additional results
|
|
889
890
|
import re
|