Skip to content

Commit ba2255e

Browse files
guzmonneclaude
andcommitted
refactor(atlassian/jira): standardize list to search terminology
Replace all 'list' naming with 'search' across Jira commands to provide consistent terminology reflecting the actual JQL search functionality. Changes: - Rename module: list.rs → search.rs - Rename struct: ListOptions → SearchOptions - Rename struct: ListOutput → SearchOutput - Rename function: list_issues_data() → search_issues_data() - Update CLI command: 'jira list' → 'jira search' - Update all help examples and documentation - Update MCP tool handler variable names The MCP tool name 'jira_search' was already correct and remains unchanged. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2b14a14 commit ba2255e

6 files changed

Lines changed: 43 additions & 43 deletions

File tree

crates/core/src/atlassian/jira.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ pub struct IssueOutput {
6767
pub assignee: Option<String>,
6868
}
6969

70-
/// Output structure for list command
70+
/// Output structure for search command
7171
#[derive(Debug, Serialize, PartialEq)]
72-
pub struct ListOutput {
72+
pub struct SearchOutput {
7373
pub issues: Vec<IssueOutput>,
7474
pub total: usize,
7575
#[serde(skip_serializing_if = "Option::is_none")]
@@ -350,8 +350,8 @@ fn render_adf_node(node: &serde_json::Value, depth: usize) -> Option<String> {
350350
/// * `search_response` - The raw response from Jira search API
351351
///
352352
/// # Returns
353-
/// * `ListOutput` - Cleaned and transformed search results
354-
pub fn transform_search_response(search_response: JiraSearchResponse) -> ListOutput {
353+
/// * `SearchOutput` - Cleaned and transformed search results
354+
pub fn transform_search_response(search_response: JiraSearchResponse) -> SearchOutput {
355355
let issues: Vec<IssueOutput> = search_response
356356
.issues
357357
.into_iter()
@@ -375,7 +375,7 @@ pub fn transform_search_response(search_response: JiraSearchResponse) -> ListOut
375375
// GET /rest/api/3/search/jql always returns 'total' field
376376
let total = search_response.total.map(|t| t as usize).unwrap_or(0);
377377

378-
ListOutput {
378+
SearchOutput {
379379
issues,
380380
total,
381381
next_page_token: search_response.next_page_token,

crates/mcptools/src/atlassian/jira/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pub mod get;
2-
pub mod list;
2+
pub mod search;
33

44
use crate::prelude::{println, *};
55

@@ -8,7 +8,7 @@ use crate::prelude::{println, *};
88
pub enum Commands {
99
/// Search Jira issues using JQL
1010
#[clap(name = "search")]
11-
Search(list::ListOptions),
11+
Search(search::SearchOptions),
1212

1313
/// Get detailed information about a Jira ticket
1414
#[clap(name = "get")]
@@ -22,11 +22,11 @@ pub async fn run(cmd: Commands, global: crate::Global) -> Result<()> {
2222
}
2323

2424
match cmd {
25-
Commands::Search(options) => list::handler(options).await,
25+
Commands::Search(options) => search::handler(options).await,
2626
Commands::Get(options) => get::handler(options).await,
2727
}
2828
}
2929

3030
// Re-export public data functions for external use (e.g., MCP)
3131
pub use get::get_ticket_data;
32-
pub use list::list_issues_data;
32+
pub use search::search_issues_data;

crates/mcptools/src/atlassian/jira/list.rs renamed to crates/mcptools/src/atlassian/jira/search.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@ use serde::{Deserialize, Serialize};
33

44
// Import domain models and pure functions from core crate
55
use mcptools_core::atlassian::jira::transform_search_response;
6-
pub use mcptools_core::atlassian::jira::{IssueOutput, JiraSearchResponse, ListOutput};
6+
pub use mcptools_core::atlassian::jira::{IssueOutput, JiraSearchResponse, SearchOutput};
77

8-
/// Options for listing Jira issues
8+
/// Options for searching Jira issues
99
#[derive(Debug, clap::Args, Serialize, Deserialize, Clone)]
1010
#[command(after_help = "EXAMPLES:
1111
# Get all tickets assigned to the current user:
12-
mcptools atlassian jira list \"assignee = currentUser()\"
12+
mcptools atlassian jira search \"assignee = currentUser()\"
1313
1414
# Get only active tickets (excluding Done/Closed):
15-
mcptools atlassian jira list \"assignee = currentUser() AND status NOT IN (Done, Closed)\"
15+
mcptools atlassian jira search \"assignee = currentUser() AND status NOT IN (Done, Closed)\"
1616
1717
# Get only completed tickets (Done/Closed):
18-
mcptools atlassian jira list \"assignee = currentUser() AND status IN (Done, Closed)\"
18+
mcptools atlassian jira search \"assignee = currentUser() AND status IN (Done, Closed)\"
1919
2020
# Find tickets by summary (search by name):
21-
mcptools atlassian jira list \"summary ~ \\\"bug fix\\\"\"
21+
mcptools atlassian jira search \"summary ~ \\\"bug fix\\\"\"
2222
2323
# Combine criteria: active tickets with specific text in summary:
24-
mcptools atlassian jira list \"assignee = currentUser() AND status NOT IN (Done, Closed) AND summary ~ \\\"api\\\"\"
24+
mcptools atlassian jira search \"assignee = currentUser() AND status NOT IN (Done, Closed) AND summary ~ \\\"api\\\"\"
2525
2626
# Fetch next page using pagination token:
27-
mcptools atlassian jira list \"assignee = currentUser()\" --limit 50 --next-page <token>
27+
mcptools atlassian jira search \"assignee = currentUser()\" --limit 50 --next-page <token>
2828
2929
NOTES:
3030
- JQL queries use Jira Query Language syntax
@@ -34,7 +34,7 @@ NOTES:
3434
- Results are limited to 10 per page by default; use --limit to change
3535
- Use --next-page with the token from the previous response to fetch additional pages
3636
- Pagination tokens expire after 7 days")]
37-
pub struct ListOptions {
37+
pub struct SearchOptions {
3838
/// JQL query (e.g., "project = PROJ AND status = Open")
3939
#[clap(env = "JIRA_QUERY")]
4040
pub query: String,
@@ -55,11 +55,11 @@ pub struct ListOptions {
5555
/// Public data function - used by both CLI and MCP
5656
/// Supports pagination with nextPageToken using GET /rest/api/3/search/jql
5757
/// Note: This endpoint uses token-based pagination, not offset-based
58-
pub async fn list_issues_data(
58+
pub async fn search_issues_data(
5959
query: String,
6060
limit: usize,
6161
next_page: Option<String>,
62-
) -> Result<ListOutput> {
62+
) -> Result<SearchOutput> {
6363
use crate::atlassian::{create_authenticated_client, AtlassianConfig};
6464

6565
let config = AtlassianConfig::from_env()?;
@@ -113,9 +113,9 @@ pub async fn list_issues_data(
113113
Ok(transform_search_response(search_response))
114114
}
115115

116-
/// Handle the list command
117-
pub async fn handler(options: ListOptions) -> Result<()> {
118-
let data = list_issues_data(options.query.clone(), options.limit, options.next_page).await?;
116+
/// Handle the search command
117+
pub async fn handler(options: SearchOptions) -> Result<()> {
118+
let data = search_issues_data(options.query.clone(), options.limit, options.next_page).await?;
119119

120120
if options.json {
121121
println!("{}", serde_json::to_string_pretty(&data)?);
@@ -149,7 +149,7 @@ pub async fn handler(options: ListOptions) -> Result<()> {
149149

150150
// Print pagination info
151151
if let Some(next_token) = &data.next_page_token {
152-
eprintln!("\nTo fetch the next page, run:\n mcptools atlassian jira list '{}' --limit {} --next-page {}",
152+
eprintln!("\nTo fetch the next page, run:\n mcptools atlassian jira search '{}' --limit {} --next-page {}",
153153
options.query, options.limit, next_token);
154154
}
155155
}

crates/mcptools/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub struct App {
2929
#[derive(Debug, Clone, clap::Args)]
3030
pub struct Global {
3131
/// Whether to display additional information.
32-
#[clap(long, env = "YAWNS_VERBOSE", global = true, default_value = "false")]
32+
#[clap(long, env = "MCPTOOLS_VERBOSE", global = true, default_value = "false")]
3333
verbose: bool,
3434

3535
/// Atlassian base URL (e.g., https://your-domain.atlassian.net)

crates/mcptools/src/mcp/tools/atlassian.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ pub async fn handle_jira_search(
99
global: &crate::Global,
1010
) -> Result<serde_json::Value, JsonRpcError> {
1111
#[derive(Deserialize)]
12-
struct JiraListArgs {
12+
struct JiraSearchArgs {
1313
query: String,
1414
limit: Option<usize>,
1515
#[serde(rename = "nextPageToken")]
1616
next_page_token: Option<String>,
1717
}
1818

19-
let args: JiraListArgs = serde_json::from_value(arguments.unwrap_or(serde_json::Value::Null))
19+
let args: JiraSearchArgs = serde_json::from_value(arguments.unwrap_or(serde_json::Value::Null))
2020
.map_err(|e| JsonRpcError {
21-
code: -32602,
22-
message: format!("Invalid arguments: {e}"),
23-
data: None,
24-
})?;
21+
code: -32602,
22+
message: format!("Invalid arguments: {e}"),
23+
data: None,
24+
})?;
2525

2626
if global.verbose {
2727
eprintln!(
@@ -35,7 +35,7 @@ pub async fn handle_jira_search(
3535
}
3636

3737
// Call the Jira module's data function
38-
let list_data = crate::atlassian::jira::list_issues_data(
38+
let search_data = crate::atlassian::jira::search_issues_data(
3939
args.query,
4040
args.limit.unwrap_or(10),
4141
args.next_page_token,
@@ -48,7 +48,7 @@ pub async fn handle_jira_search(
4848
})?;
4949

5050
// Convert to JSON and wrap in MCP result format
51-
let json_string = serde_json::to_string_pretty(&list_data).map_err(|e| JsonRpcError {
51+
let json_string = serde_json::to_string_pretty(&search_data).map_err(|e| JsonRpcError {
5252
code: -32603,
5353
message: format!("Serialization error: {e}"),
5454
data: None,

docs/ATLASSIAN_SETUP.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Then load it before running commands:
8787

8888
```bash
8989
source .env
90-
mcptools atlassian jira list "project = PROJ"
90+
mcptools atlassian jira search "project = PROJ"
9191
```
9292

9393
### Option D: Pass as Command-Line Arguments
@@ -97,15 +97,15 @@ mcptools \
9797
--atlassian-url "https://your-domain.atlassian.net" \
9898
--atlassian-email "your-email@company.com" \
9999
--atlassian-token "your-api-token-here" \
100-
atlassian jira list "project = PROJ"
100+
atlassian jira search "project = PROJ"
101101
```
102102

103103
## Step 4: Verify Configuration
104104

105105
Test your configuration with a simple Jira query:
106106

107107
```bash
108-
mcptools atlassian jira list "project IS NOT EMPTY" --limit 5
108+
mcptools atlassian jira search "project IS NOT EMPTY" --limit 5
109109
```
110110

111111
Expected output (if successful):
@@ -126,24 +126,24 @@ If you get an error like `ATLASSIAN_BASE_URL environment variable not set`, ensu
126126

127127
### Jira Commands
128128

129-
**List open issues in a project:**
129+
**Search for open issues in a project:**
130130
```bash
131-
mcptools atlassian jira list "project = PROJ AND status = Open"
131+
mcptools atlassian jira search "project = PROJ AND status = Open"
132132
```
133133

134-
**List issues assigned to you:**
134+
**Search for issues assigned to you:**
135135
```bash
136-
mcptools atlassian jira list "assignee = currentUser()"
136+
mcptools atlassian jira search "assignee = currentUser()"
137137
```
138138

139139
**Search with JQL and limit results:**
140140
```bash
141-
mcptools atlassian jira list "text ~ 'database' AND status = 'In Progress'" --limit 20
141+
mcptools atlassian jira search "text ~ 'database' AND status = 'In Progress'" --limit 20
142142
```
143143

144144
**Output as JSON:**
145145
```bash
146-
mcptools atlassian jira list "project = PROJ" --json | jq '.issues[] | {key, summary, status}'
146+
mcptools atlassian jira search "project = PROJ" --json | jq '.issues[] | {key, summary, status}'
147147
```
148148

149149
### Confluence Commands
@@ -167,7 +167,7 @@ mcptools atlassian confluence search "text ~ 'api'" --limit 5 --json
167167

168168
The Atlassian module is also available as MCP tools that Claude can use:
169169

170-
- **`jira_list`** - Search Jira issues using JQL
170+
- **`jira_search`** - Search Jira issues using JQL
171171
- **`confluence_search`** - Search Confluence pages using CQL
172172

173173
These tools are automatically available when using mcptools as an MCP server.

0 commit comments

Comments
 (0)