Skip to main content
Glama
panther-labs

Panther MCP Server

Official

get_role

Read-only

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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"],
        ),
    ],
Behavior4/5

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

Annotations declare readOnlyHint=true, which the description does not contradict. The description adds value by specifying the return content ('complete role information including all permissions and settings') and permission requirements ('Permissions: {"all_of": ["Read User Info"]}'), which are not covered by annotations. It provides useful behavioral context beyond the annotations.

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

Conciseness5/5

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

The description is front-loaded with the core purpose, followed by return details and permissions. Every sentence adds value without redundancy, and it is appropriately sized for a simple tool with one parameter and clear annotations. No wasted words or unnecessary elaboration.

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 tool's low complexity (1 parameter, 100% schema coverage), presence of annotations (readOnlyHint), and an output schema, the description is complete. It covers purpose, return content, and permissions, which are sufficient for an AI agent to understand and invoke the tool correctly without needing to explain return values (handled by output schema).

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?

Schema description coverage is 100%, with the parameter 'role_id' fully documented in the schema. The description does not add any additional meaning or details about the parameter beyond what the schema provides, such as format constraints or examples. Baseline score of 3 is appropriate as the schema handles parameter documentation adequately.

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 clearly states the specific action ('Get detailed information') and resource ('Panther role by ID'), distinguishing it from sibling tools like 'list_roles' (which lists roles) and 'get_user' (which fetches user info). It precisely defines the tool's function without being vague or tautological.

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

Usage Guidelines4/5

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

The description implies usage when detailed role info is needed (vs. 'list_roles' for listing), but does not explicitly state when to use this tool over alternatives or any exclusions. It provides clear context but lacks explicit guidance on when-not scenarios or named alternatives.

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