analyze_docs
Analyze documentation for tasks like gap identification, outline generation, or consistency checking. Supports custom document lists and outputs results in summary, detailed, or structured formats for efficient agent handoffs.
Instructions
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
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| docs | No | ||
| output_format | No | summary | |
| task | Yes |
Input Schema (JSON Schema)
{
"properties": {
"docs": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Docs"
},
"output_format": {
"default": "summary",
"title": "Output Format",
"type": "string"
},
"task": {
"title": "Task",
"type": "string"
}
},
"required": [
"task"
],
"title": "analyze_docsArguments",
"type": "object"
}
Implementation Reference
- src/main.py:433-488 (handler)The analyze_docs tool handler. Decorated with @mcp.tool() for registration. Validates task, gathers documents if needed, and returns a structured response prepared for agent handoff with suggested models.@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', }
- src/main.py:433-433 (registration)The @mcp.tool() decorator registers the analyze_docs function as an MCP tool.@mcp.tool()