Skip to main content
Glama
panther-labs

Panther MCP Server

Official

list_data_models

Read-only

Retrieve all data models from Panther to map log schema fields for Python rules, including custom field mappings and paginated metadata.

Instructions

List all data models from your Panther instance. Data models are used only in Panther's Python rules to map log type schema fields to a unified data model. They may also contain custom mappings for fields that are not part of the log type schema.

Returns paginated list of data models with metadata including mappings and log types.

Permissions:{'all_of': ['View Rules']}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoOptional cursor for pagination from a previous query
limitNoMaximum number of results to return (1-1000)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_data_models' tool. It defines the input schema using Annotated types with Pydantic Field, fetches data models from the Panther REST API with pagination support, filters the response, and returns structured results or error.
    @mcp_tool(
        annotations={
            "permissions": all_perms(Permission.RULE_READ),
            "readOnlyHint": True,
        }
    )
    async def list_data_models(
        cursor: Annotated[
            str | None,
            Field(description="Optional cursor for pagination from a previous query"),
        ] = None,
        limit: Annotated[
            int,
            Field(
                description="Maximum number of results to return (1-1000)",
                examples=[100, 25, 50],
                ge=1,
                le=1000,
            ),
        ] = 100,
    ) -> dict[str, Any]:
        """List all data models from your Panther instance. Data models are used only in Panther's Python rules to map log type schema fields to a unified data model. They may also contain custom mappings for fields that are not part of the log type schema.
    
        Returns paginated list of data models with metadata including mappings and log types.
        """
        logger.info(f"Fetching {limit} data models from Panther")
    
        try:
            # Prepare query parameters
            params = {"limit": limit}
            if cursor and cursor.lower() != "null":  # Only add cursor if it's not null
                params["cursor"] = cursor
                logger.info(f"Using cursor for pagination: {cursor}")
    
            async with get_rest_client() as client:
                result, _ = await client.get("/data-models", params=params)
    
            # Extract data models and pagination info
            data_models = result.get("results", [])
            next_cursor = result.get("next")
    
            # Keep only specific fields for each data model to limit the amount of data returned
            filtered_data_models_metadata = [
                {
                    "id": data_model["id"],
                    "description": data_model.get("description"),
                    "displayName": data_model.get("displayName"),
                    "enabled": data_model.get("enabled"),
                    "logTypes": data_model.get("logTypes"),
                    "mappings": data_model.get("mappings"),
                    "managed": data_model.get("managed"),
                    "createdAt": data_model.get("createdAt"),
                    "lastModified": data_model.get("lastModified"),
                }
                for data_model in data_models
            ]
    
            logger.info(
                f"Successfully retrieved {len(filtered_data_models_metadata)} data models"
            )
    
            return {
                "success": True,
                "data_models": filtered_data_models_metadata,
                "total_data_models": len(filtered_data_models_metadata),
                "has_next_page": bool(next_cursor),
                "next_cursor": next_cursor,
            }
        except Exception as e:
            logger.error(f"Failed to list data models: {str(e)}")
            return {"success": False, "message": f"Failed to list data models: {str(e)}"}
  • Location where all tools, including 'list_data_models', are registered with the FastMCP server instance by calling register_all_tools.
    register_all_tools(mcp)
  • Import of the data_models module in tools __init__.py, which triggers the execution of the @mcp_tool decorator on list_data_models to add it to the tool registry.
    data_models,
Behavior4/5

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

Annotations provide readOnlyHint=true, which the description doesn't contradict. The description adds valuable behavioral context beyond annotations: it discloses pagination behavior ('Returns paginated list'), specifies what metadata is included ('mappings and log types'), and mentions the permission requirement ('Permissions: {"all_of": ["View Rules"]}'). This provides useful operational context that annotations alone don't cover.

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 appropriately sized with three focused paragraphs: purpose statement, additional context about data models, and behavioral details. Each sentence adds value without redundancy. The structure is logical with purpose first, though the permissions information might be better integrated rather than appended.

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 relative simplicity (list operation with 2 optional parameters), 100% schema coverage, readOnlyHint annotation, and existence of an output schema, the description provides excellent contextual completeness. It covers purpose, behavioral traits (pagination, metadata, permissions), and context about what data models are, making it fully adequate for agent understanding.

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 both parameters (cursor, limit) well-documented in the schema. The description doesn't add any parameter-specific information beyond what's in the schema, but doesn't need to since schema coverage is complete. The baseline score of 3 is appropriate when the schema carries the full parameter documentation burden.

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 ('List all data models') and resource ('from your Panther instance'), with additional context about what data models are used for ('used only in Panther's Python rules to map log type schema fields to a unified data model'). It distinguishes from sibling tools like 'get_data_model' by specifying it lists all models rather than retrieving a single one.

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 context by mentioning data models are used in Panther's Python rules, but doesn't explicitly state when to use this tool versus alternatives like 'get_data_model' or other list tools. It includes permissions information, which provides some guidance on prerequisites, but lacks explicit when/when-not instructions 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