codeprism_mcp/tools/workflow/
mod.rs

1//! Workflow orchestration and guidance tools
2//!
3//! Provides intelligent workflow guidance, batch analysis execution,
4//! and systematic analysis orchestration for efficient code analysis.
5
6pub mod batch;
7pub mod guidance;
8pub mod optimization;
9
10use anyhow::Result;
11use serde_json::Value;
12
13use crate::tools::{CallToolResult, Tool};
14use crate::CodePrismMcpServer;
15
16/// Register all workflow orchestration tools
17pub fn register_workflow_tools() -> Vec<Tool> {
18    vec![
19        guidance::create_suggest_analysis_workflow_tool(),
20        batch::create_batch_analysis_tool(),
21        optimization::create_optimize_workflow_tool(),
22    ]
23}
24
25/// Route workflow tool calls to appropriate handlers
26pub async fn handle_workflow_tool(
27    tool_name: &str,
28    server: &CodePrismMcpServer,
29    arguments: Option<&Value>,
30) -> Result<CallToolResult> {
31    match tool_name {
32        "suggest_analysis_workflow" => guidance::suggest_analysis_workflow(server, arguments).await,
33        "batch_analysis" => batch::batch_analysis(server, arguments).await,
34        "optimize_workflow" => optimization::optimize_workflow(server, arguments).await,
35        _ => Err(anyhow::anyhow!("Unknown workflow tool: {}", tool_name)),
36    }
37}