@mcp.tool()
def analyze_docs(
task: str, docs: Optional[List[str]] = None, output_format: str = 'summary'
) -> Dict[str, Any]:
"""
Analyze documentation for specific tasks (foundation for agent handoffs)
Args:
task: Analysis task (e.g., "find_gaps", "generate_outline", "check_consistency")
docs: Optional list of specific documents to analyze
output_format: Output format (summary, detailed, structured)
Returns:
Analysis results ready for agent handoff
"""
available_tasks = [
'find_gaps',
'generate_outline',
'check_consistency',
'extract_examples',
'identify_prerequisites',
'suggest_improvements',
]
if task not in available_tasks:
return {
'error': f'Unknown task. Available tasks: {", ".join(available_tasks)}',
'available_tasks': available_tasks,
}
# Gather documents to analyze
if not docs:
all_docs = list_docs()
docs = [doc['path'] for doc in all_docs]
# This is where different analysis agents would be invoked
# Structure the response for easy handoff to specialized agents
return {
'task': task,
'documents_analyzed': len(docs),
'output_format': output_format,
'results': {
'summary': f"Analysis task '{task}' ready for processing",
'documents': docs,
'next_steps': [
'Connect specialized agent for this task',
'Process documents according to task requirements',
'Return structured results',
],
},
'agent_handoff_ready': True,
'suggested_model': 'gpt-4'
if task in ['find_gaps', 'check_consistency']
else 'claude-3-5-sonnet',
}