Commit 9cbb7326 authored by MD. SHAHIDUL ISLAM's avatar MD. SHAHIDUL ISLAM

feat: Add explicit user confirmation warning to Jira tool docstrings and update README examples.

parent 6e579894
...@@ -153,7 +153,9 @@ def get_multiple_issues_details(issue_keys: List[str]) -> str: ...@@ -153,7 +153,9 @@ def get_multiple_issues_details(issue_keys: List[str]) -> str:
@mcp.tool() @mcp.tool()
def create_issue(summary: str, description: str, project_key: str = None, issue_type: str = "Task") -> str: def create_issue(summary: str, description: str, project_key: str = None, issue_type: str = "Task") -> str:
"""Creates a new Jira issue. If project_key is not provided, uses the active project.""" """Creates a new Jira issue. If project_key is not provided, uses the active project.
IMPORTANT: You must explicitly ask the user for confirmation before executing this tool.
"""
global ACTIVE_PROJECT global ACTIVE_PROJECT
jira = _get_jira() jira = _get_jira()
...@@ -189,6 +191,7 @@ def create_issue_advanced( ...@@ -189,6 +191,7 @@ def create_issue_advanced(
) -> str: ) -> str:
"""Creates a Jira issue with advanced fields matched to the web interface. """Creates a Jira issue with advanced fields matched to the web interface.
Use this when you need to specify assignee, labels, components, or estimations. Use this when you need to specify assignee, labels, components, or estimations.
IMPORTANT: You must explicitly ask the user for confirmation before executing this tool.
""" """
global ACTIVE_PROJECT global ACTIVE_PROJECT
jira = _get_jira() jira = _get_jira()
...@@ -233,7 +236,9 @@ def create_issue_advanced( ...@@ -233,7 +236,9 @@ def create_issue_advanced(
@mcp.tool() @mcp.tool()
def create_issue_with_subtasks(summary: str, description: str, subtasks: List[str], project_key: str = None, parent_issue_type: str = "Story") -> str: def create_issue_with_subtasks(summary: str, description: str, subtasks: List[str], project_key: str = None, parent_issue_type: str = "Story") -> str:
"""Creates a new Jira Issue (Story or Task) along with a list of Sub-tasks. If project_key is not provided, uses the active project.""" """Creates a new Jira Issue (Story or Task) along with a list of Sub-tasks. If project_key is not provided, uses the active project.
IMPORTANT: You must explicitly ask the user for confirmation before executing this tool.
"""
global ACTIVE_PROJECT global ACTIVE_PROJECT
jira = _get_jira() jira = _get_jira()
...@@ -272,6 +277,7 @@ def create_issue_with_subtasks(summary: str, description: str, subtasks: List[st ...@@ -272,6 +277,7 @@ def create_issue_with_subtasks(summary: str, description: str, subtasks: List[st
def create_bulk_issues(issues_data: List[dict], project_key: str = None) -> str: def create_bulk_issues(issues_data: List[dict], project_key: str = None) -> str:
"""Creates multiple Jira issues in one operation. """Creates multiple Jira issues in one operation.
issues_data must be a list of dictionaries with keys: 'summary', 'description', and optional 'issue_type' (defaults to 'Task'). issues_data must be a list of dictionaries with keys: 'summary', 'description', and optional 'issue_type' (defaults to 'Task').
IMPORTANT: You must explicitly ask the user for confirmation before executing this tool.
""" """
global ACTIVE_PROJECT global ACTIVE_PROJECT
jira = _get_jira() jira = _get_jira()
...@@ -316,7 +322,9 @@ def create_bulk_issues(issues_data: List[dict], project_key: str = None) -> str: ...@@ -316,7 +322,9 @@ def create_bulk_issues(issues_data: List[dict], project_key: str = None) -> str:
@mcp.tool() @mcp.tool()
def assign_issue_to_me(issue_key: str) -> str: def assign_issue_to_me(issue_key: str) -> str:
"""Assigns the specified issue to the authenticated user.""" """Assigns the specified issue to the authenticated user.
IMPORTANT: You must explicitly ask the user for confirmation before executing this tool.
"""
jira = _get_jira() jira = _get_jira()
try: try:
# Provide the username we authenticated with # Provide the username we authenticated with
...@@ -327,7 +335,9 @@ def assign_issue_to_me(issue_key: str) -> str: ...@@ -327,7 +335,9 @@ def assign_issue_to_me(issue_key: str) -> str:
@mcp.tool() @mcp.tool()
def transition_issue(issue_key: str, transition_name: str) -> str: def transition_issue(issue_key: str, transition_name: str) -> str:
"""Transitions an issue to a new status by name (e.g., 'Ready for QA').""" """Transitions an issue to a new status by name (e.g., 'Ready for QA').
IMPORTANT: You must explicitly ask the user for confirmation before executing this tool.
"""
jira = _get_jira() jira = _get_jira()
try: try:
# First, find available transitions # First, find available transitions
...@@ -391,7 +401,9 @@ def get_all_projects() -> str: ...@@ -391,7 +401,9 @@ def get_all_projects() -> str:
@mcp.tool() @mcp.tool()
def add_comment_to_issue(issue_key: str, comment: str) -> str: def add_comment_to_issue(issue_key: str, comment: str) -> str:
"""Adds a new comment to a Jira issue.""" """Adds a new comment to a Jira issue.
IMPORTANT: You must explicitly ask the user for confirmation before executing this tool.
"""
jira = _get_jira() jira = _get_jira()
try: try:
jira.add_comment(issue_key, comment) jira.add_comment(issue_key, comment)
...@@ -419,7 +431,9 @@ def get_issue_comments(issue_key: str) -> str: ...@@ -419,7 +431,9 @@ def get_issue_comments(issue_key: str) -> str:
@mcp.tool() @mcp.tool()
def log_work_on_issue(issue_key: str, time_spent: str) -> str: def log_work_on_issue(issue_key: str, time_spent: str) -> str:
"""Logs work (time spent) on a Jira issue. Format Example for time_spent: '2h 30m' or '1d'""" """Logs work (time spent) on a Jira issue. Format Example for time_spent: '2h 30m' or '1d'
IMPORTANT: You must explicitly ask the user for confirmation before executing this tool.
"""
jira = _get_jira() jira = _get_jira()
try: try:
jira.add_worklog(issue_key, timeSpent=time_spent) jira.add_worklog(issue_key, timeSpent=time_spent)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment