Skip to main content

codecov_rust_mcp/
tool_args.rs

1//! JSON-schema parameter structs for rmcp `Parameters<T>` tool handlers.
2
3use schemars::JsonSchema;
4use serde::Deserialize;
5
6/// Shared owner/repo/branch/sha selectors for Codecov repo tools.
7#[derive(Debug, Deserialize, JsonSchema)]
8pub struct RepoArgs {
9    /// GitHub owner or org (e.g. `Interchouette-ITC`).
10    pub owner: String,
11    /// Repository name (e.g. `rustashop`).
12    pub repo: String,
13    /// Branch head to query when `sha` is omitted.
14    #[serde(default)]
15    pub branch: Option<String>,
16    /// Commit SHA; when set, takes precedence over `branch` on the API.
17    #[serde(default)]
18    pub sha: Option<String>,
19}
20
21/// Arguments for `codecov_miss_files`.
22#[derive(Debug, Deserialize, JsonSchema)]
23pub struct MissFilesArgs {
24    /// GitHub owner or org.
25    pub owner: String,
26    /// Repository name.
27    pub repo: String,
28    /// Branch head to query when `sha` is omitted.
29    #[serde(default)]
30    pub branch: Option<String>,
31    /// Commit SHA.
32    #[serde(default)]
33    pub sha: Option<String>,
34    /// Max files to return (default 30). Use `0` for uncapped.
35    #[serde(default)]
36    pub limit: Option<u32>,
37}
38
39/// Arguments for `codecov_file_report`.
40#[derive(Debug, Deserialize, JsonSchema)]
41pub struct FileReportArgs {
42    /// GitHub owner or org.
43    pub owner: String,
44    /// Repository name.
45    pub repo: String,
46    /// Repository-relative file path.
47    pub path: String,
48    /// Branch head to query when `sha` is omitted.
49    #[serde(default)]
50    pub branch: Option<String>,
51    /// Commit SHA.
52    #[serde(default)]
53    pub sha: Option<String>,
54}