Skip to main content
Glama
panther-labs

Panther MCP Server

Official

get_role

Retrieve detailed security role information including permissions and settings by specifying a role ID within the Panther security monitoring platform.

Instructions

Get detailed information about a Panther role by ID

Returns complete role information including all permissions and settings.

Permissions:{'all_of': ['Read User Info']}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
role_idYesThe ID of the role to fetch

Implementation Reference

  • The handler function for the 'get_role' MCP tool. It retrieves detailed role information from the Panther API by role ID, handles 404 not found cases, and returns success/error responses.
    async def get_role(
        role_id: Annotated[
            str,
            Field(
                description="The ID of the role to fetch",
                examples=["Admin"],
            ),
        ],
    ) -> dict[str, Any]:
        """Get detailed information about a Panther role by ID
    
        Returns complete role information including all permissions and settings.
        """
        logger.info(f"Fetching role details for role ID: {role_id}")
    
        try:
            async with get_rest_client() as client:
                # Allow 404 as a valid response to handle not found case
                result, status = await client.get(
                    f"/roles/{role_id}", expected_codes=[200, 404]
                )
    
                if status == 404:
                    logger.warning(f"No role found with ID: {role_id}")
                    return {
                        "success": False,
                        "message": f"No role found with ID: {role_id}",
                    }
    
            logger.info(f"Successfully retrieved role details for role ID: {role_id}")
            return {"success": True, "role": result}
        except Exception as e:
            logger.error(f"Failed to get role details: {str(e)}")
            return {
                "success": False,
                "message": f"Failed to get role details: {str(e)}",
            }
  • Registers the 'get_role' tool with the MCP registry using the @mcp_tool decorator, specifying required permissions and read-only hint.
    @mcp_tool(
        annotations={
            "permissions": all_perms(Permission.USER_READ),
            "readOnlyHint": True,
        }
    )
  • Pydantic schema definition for the 'role_id' input parameter using Annotated and Field for description and examples.
    role_id: Annotated[
        str,
        Field(
            description="The ID of the role to fetch",
            examples=["Admin"],
        ),
    ],

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