foundry_mcp/mcp/
tools.rs

1//! # MCP Tool Definitions
2//!
3//! This module defines all MCP tools that map directly to CLI commands.
4//! Each tool provides identical functionality to its corresponding CLI command
5//! with the same parameter validation and JSON response format.
6//!
7//! All tool definitions are now auto-generated using the #[derive(McpTool)] macro
8//! or manual trait implementations for special cases (unit structs).
9
10use rust_mcp_sdk::schema::Tool as McpTool;
11
12// Import the CLI args that have McpTool implementations
13use crate::cli::args::{
14    AnalyzeProjectArgs, CreateProjectArgs, CreateSpecArgs, DeleteSpecArgs, GetFoundryHelpArgs,
15    ListProjectsArgs, ListSpecsArgs, LoadProjectArgs, LoadSpecArgs, UpdateSpecArgs,
16    ValidateContentArgs,
17};
18use crate::mcp::traits::McpToolDefinition;
19
20/// Tool definitions for all 10 foundry commands
21pub struct FoundryTools;
22
23impl FoundryTools {
24    /// Get all available tools
25    pub fn all_tools() -> Vec<McpTool> {
26        vec![
27            CreateProjectArgs::tool_definition(),   // Generated by macro
28            AnalyzeProjectArgs::tool_definition(),  // Generated by macro
29            LoadProjectArgs::tool_definition(),     // Generated by macro
30            CreateSpecArgs::tool_definition(),      // Generated by macro
31            LoadSpecArgs::tool_definition(),        // Generated by macro
32            UpdateSpecArgs::tool_definition(),      // Generated by macro
33            DeleteSpecArgs::tool_definition(),      // Generated by macro
34            ListProjectsArgs::tool_definition(),    // Manual impl for unit struct
35            ListSpecsArgs::tool_definition(),       // Generated by macro
36            ValidateContentArgs::tool_definition(), // Generated by macro
37            GetFoundryHelpArgs::tool_definition(),  // Generated by macro
38        ]
39    }
40
41    // All tool definitions are now auto-generated by McpTool macro or trait implementations
42}