@@ -3,28 +3,28 @@ use serde::{Deserialize, Serialize};
33
44// Import domain models and pure functions from core crate
55use 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
2929NOTES:
3030 - JQL queries use Jira Query Language syntax
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 ! ( "\n To fetch the next page, run:\n mcptools atlassian jira list '{}' --limit {} --next-page {}" ,
152+ eprintln ! ( "\n To fetch the next page, run:\n mcptools atlassian jira search '{}' --limit {} --next-page {}" ,
153153 options. query, options. limit, next_token) ;
154154 }
155155 }
0 commit comments