Skip to main content
Glama
panther-labs

Panther MCP Server

Official

add_alert_comment

Destructive

Add Markdown-formatted comments to Panther security alerts to document investigations, provide context, and facilitate team collaboration on incident response.

Instructions

Add a comment to a Panther alert. Comments support Markdown formatting.

Returns: Dict containing: - success: Boolean indicating if the comment was added successfully - comment: Created comment information if successful - message: Error message if unsuccessful

Permissions:{'all_of': ['Manage Alerts']}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
alert_idYesThe ID of the alert to comment on
commentYesThe comment text to add

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler implementation for the 'add_alert_comment' MCP tool. This async function handles adding a comment to a Panther alert via the REST API /alert-comments endpoint. It includes input validation through Annotated types, error handling for 404/400 status codes, and returns a standardized success/error response. The @mcp_tool decorator also handles schema generation from Field descriptions and tool registration.
    @mcp_tool(
        annotations={
            "permissions": all_perms(Permission.ALERT_MODIFY),
            "destructiveHint": True,
        }
    )
    async def add_alert_comment(
        alert_id: Annotated[
            str,
            Field(min_length=1, description="The ID of the alert to comment on"),
        ],
        comment: Annotated[
            str,
            Field(min_length=1, description="The comment text to add"),
        ],
    ) -> dict[str, Any]:
        """Add a comment to a Panther alert. Comments support Markdown formatting.
    
        Returns:
            Dict containing:
            - success: Boolean indicating if the comment was added successfully
            - comment: Created comment information if successful
            - message: Error message if unsuccessful
        """
        logger.info(f"Adding comment to alert {alert_id}")
    
        try:
            # Prepare request body
            body = {
                "alertId": alert_id,
                "body": comment,
                "format": "PLAIN_TEXT",  # Default format
            }
    
            # Execute the REST API call
            async with get_rest_client() as client:
                comment_data, status = await client.post(
                    "/alert-comments", json_data=body, expected_codes=[200, 400, 404]
                )
    
            if status == 404:
                logger.error(f"Alert not found: {alert_id}")
                return {
                    "success": False,
                    "message": f"Alert not found: {alert_id}",
                }
    
            if status == 400:
                logger.error(f"Bad request when adding comment to alert {alert_id}")
                return {
                    "success": False,
                    "message": f"Bad request when adding comment to alert {alert_id}",
                }
    
            logger.info(f"Successfully added comment to alert {alert_id}")
    
            return {
                "success": True,
                "comment": comment_data,
            }
    
        except Exception as e:
            logger.error(f"Failed to add alert comment: {str(e)}")
            return {
                "success": False,
                "message": f"Failed to add alert comment: {str(e)}",
            }
  • The @mcp_tool decorator call that registers the add_alert_comment function in the MCP tool registry. Specifies required permissions (ALERT_MODIFY) and hints it as destructive.
    @mcp_tool(
        annotations={
            "permissions": all_perms(Permission.ALERT_MODIFY),
            "destructiveHint": True,
        }
    )
  • Input schema definition using Pydantic Annotated with Field validators and descriptions, which are used by the MCP framework to generate the tool's JSON schema for input validation.
        alert_id: Annotated[
            str,
            Field(min_length=1, description="The ID of the alert to comment on"),
        ],
        comment: Annotated[
            str,
            Field(min_length=1, description="The comment text to add"),
        ],
    ) -> dict[str, Any]:
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds valuable behavioral context beyond the destructiveHint annotation. It discloses that comments support Markdown formatting, specifies required permissions ('Manage Alerts'), and outlines the return structure (success boolean, comment info, error message). This compensates well for the annotation's limited information, though it doesn't mention rate limits or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, followed by formatting details, return values, and permissions. It's efficiently structured in three clear sections, though the return format listing could be slightly more concise. Overall, it's well-organized with minimal waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema (implied by the return format description), 100% parameter schema coverage, and annotations, the description is complete. It covers the tool's purpose, behavioral traits (formatting, permissions, returns), and usage context adequately for this mutation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the input schema already fully documents the two parameters (alert_id and comment). The description doesn't add any parameter-specific details beyond what's in the schema, so it meets the baseline of 3 without providing extra semantic value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the verb 'Add' and the resource 'comment to a Panther alert', clearly distinguishing it from sibling tools like list_alert_comments (which lists comments) and update_alert_assignee/status (which modify other alert properties). It specifies the action and target precisely.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing to comment on an alert, but doesn't explicitly state when to use this versus alternatives like list_alert_comments for viewing comments. It mentions Markdown formatting as a feature, which provides some context, but lacks explicit guidance on prerequisites or exclusions beyond the permissions note.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/panther-labs/mcp-panther'

If you have feedback or need assistance with the MCP directory API, please join our Discord server