get_permissions
Retrieve the current user's permissions to diagnose access issues or verify if a new API token is required. Part of Panther MCP Server for security monitoring and investigations.
Instructions
Get the current user's permissions. Use this to diagnose permission errors and determine if a new API token is needed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The main handler function for the 'get_permissions' MCP tool. It fetches the current user's permissions from the REST API, converts them using convert_permissions, and returns a success/failure dict.async def get_permissions() -> dict[str, Any]: """ Get the current user's permissions. Use this to diagnose permission errors and determine if a new API token is needed. """ logger.info("Getting permissions") try: async with get_rest_client() as client: result, _ = await client.get("/api-tokens/self") return { "success": True, "permissions": convert_permissions(result.get("permissions", [])), } except Exception as e: logger.error(f"Failed to fetch permissions: {str(e)}") return { "success": False, "message": f"Failed to fetch permissions: {str(e)}", }
- src/mcp_panther/panther_mcp_core/tools/permissions.py:11-15 (registration)Registers the 'get_permissions' tool with the MCP registry using the @mcp_tool decorator, specifying it as read-only.@mcp_tool( annotations={ "readOnlyHint": True, } )