codeprism_mcp_server/tools/
core.rs

1//! Core navigation tools parameter types
2//!
3//! This module contains parameter type definitions for core navigation tools.
4//! The actual tool implementations are in the server module as methods.
5
6use serde::{Deserialize, Serialize};
7
8/// Repository statistics parameters (no parameters needed)
9#[derive(Debug, Serialize, Deserialize)]
10pub struct RepositoryStatsParams {}
11
12/// Symbol explanation parameters
13#[derive(Debug, Serialize, Deserialize)]
14pub struct ExplainSymbolParams {
15    /// Symbol identifier (node ID or symbol name)
16    pub symbol_id: String,
17    /// Include dependency information
18    #[serde(default)]
19    pub include_dependencies: bool,
20    /// Include usage/reference information  
21    #[serde(default)]
22    pub include_usages: bool,
23    /// Number of context lines around the symbol
24    #[serde(default = "default_context_lines")]
25    pub context_lines: usize,
26}
27
28/// Symbol search parameters
29#[derive(Debug, Serialize, Deserialize)]
30pub struct SearchSymbolsParams {
31    /// Search pattern (supports regex)
32    pub pattern: String,
33    /// Filter by symbol types
34    #[serde(default)]
35    pub symbol_types: Vec<String>,
36    /// Maximum number of results
37    #[serde(default = "default_limit")]
38    pub limit: usize,
39    /// Number of context lines
40    #[serde(default = "default_context_lines")]
41    pub context_lines: usize,
42}
43
44/// Trace path parameters
45#[derive(Debug, Serialize, Deserialize)]
46pub struct TracePathParams {
47    /// Source symbol identifier
48    pub source: String,
49    /// Target symbol identifier
50    pub target: String,
51    /// Maximum search depth
52    #[serde(default = "default_max_depth")]
53    pub max_depth: usize,
54}
55
56/// Find dependencies parameters
57#[derive(Debug, Serialize, Deserialize)]
58pub struct FindDependenciesParams {
59    /// Target to analyze (symbol ID or file path)
60    pub target: String,
61    /// Type of dependencies to find
62    #[serde(default = "default_dependency_type")]
63    pub dependency_type: String,
64}
65
66/// Find references parameters
67#[derive(Debug, Serialize, Deserialize)]
68pub struct FindReferencesParams {
69    /// Symbol identifier to find references for
70    pub symbol_id: String,
71    /// Include symbol definitions
72    #[serde(default = "default_true")]
73    pub include_definitions: bool,
74    /// Number of context lines
75    #[serde(default = "default_context_lines")]
76    pub context_lines: usize,
77}
78
79// Default value functions
80fn default_context_lines() -> usize {
81    4
82}
83
84fn default_limit() -> usize {
85    50
86}
87
88fn default_max_depth() -> usize {
89    10
90}
91
92fn default_dependency_type() -> String {
93    "direct".to_string()
94}
95
96fn default_true() -> bool {
97    true
98}