recommend_strategy
Analyze tasks to recommend optimal reasoning frameworks for AI agents, selecting from 40 distinct strategies based on task complexity and category.
Instructions
Analyze a task and recommend the optimal reasoning framework.
Returns the detected category, complexity_score, recommended framework, and alternative options.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | The task or question to analyze | |
| context | No | Additional context about the task |
Implementation Reference
- src/promptcore/main.py:62-85 (handler)Implementation of the recommend_strategy MCP tool in src/promptcore/main.py. It takes a task and context, uses the selector dependency to analyze them, and returns a dictionary with the recommended framework, complexity, and other analysis details.
@mcp.tool() def recommend_strategy( task: Annotated[str, "The task or question to analyze"], context: Annotated[str, "Additional context about the task"] = "", ) -> dict: """ Analyze a task and recommend the optimal reasoning framework. Returns the detected category, complexity_score, recommended framework, and alternative options. """ deps = get_dependencies() analysis = deps.selector.analyze(task, context) return { "category": analysis.category.value, "complexity": { "score": analysis.complexity_score, "level": analysis.complexity_level.value, }, "recommended_framework": analysis.recommended_framework, "reasoning": analysis.reasoning, "alternatives": analysis.alternative_frameworks, }