Skip to main content
Glama
panther-labs

Panther MCP Server

Official

list_database_tables

Read-only

Retrieve all available tables within a specified Panther Database to understand data structure and log types for security monitoring queries.

Instructions

List all available tables in a Panther Database.

Required: Only use valid database names obtained from list_databases

Returns: Dict containing: - success: Boolean indicating if the query was successful - tables: List of tables, each containing: - name: Table name - description: Table description - log_type: Log type - database: Database name - message: Error message if unsuccessful

Permissions:{'all_of': ['Query Data Lake']}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseYesThe name of the database to list tables for

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'list_database_tables' tool. It is decorated with @mcp_tool for registration and includes inline schema via Annotated[Field]. Fetches tables from a specified database using GraphQL pagination via LIST_TABLES_QUERY.
    @mcp_tool(
        annotations={
            "permissions": all_perms(Permission.DATA_ANALYTICS_READ),
            "readOnlyHint": True,
        }
    )
    async def list_database_tables(
        database: Annotated[
            str,
            Field(
                description="The name of the database to list tables for",
                examples=["panther_logs.public"],
            ),
        ],
    ) -> Dict[str, Any]:
        """List all available tables in a Panther Database.
    
        Required: Only use valid database names obtained from list_databases
    
        Returns:
            Dict containing:
            - success: Boolean indicating if the query was successful
            - tables: List of tables, each containing:
                - name: Table name
                - description: Table description
                - log_type: Log type
                - database: Database name
            - message: Error message if unsuccessful
        """
        logger.info("Fetching available tables")
    
        all_tables = []
        page_size = 100
    
        try:
            logger.info(f"Fetching tables for database: {database}")
            cursor = None
    
            while True:
                # Prepare input variables
                variables = {
                    "databaseName": database,
                    "pageSize": page_size,
                    "cursor": cursor,
                }
    
                logger.debug(f"Query variables: {variables}")
    
                # Execute the query using shared client
                result = await _execute_query(LIST_TABLES_QUERY, variables)
    
                # Get query data
                result = result.get("dataLakeDatabaseTables", {})
                for table in result.get("edges", []):
                    all_tables.append(table["node"])
    
                # Check if there are more pages
                page_info = result["pageInfo"]
                if not page_info["hasNextPage"]:
                    break
    
                # Update cursor for next page
                cursor = page_info["endCursor"]
    
            # Format the response
            return {
                "success": True,
                "status": "succeeded",
                "tables": all_tables,
                "stats": {
                    "table_count": len(all_tables),
                },
            }
        except Exception as e:
            logger.error(f"Failed to fetch tables: {str(e)}")
            return {"success": False, "message": f"Failed to fetch tables: {str(e)}"}
Behavior4/5

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

The annotations already declare readOnlyHint=true, indicating this is a safe read operation. The description adds valuable context beyond annotations by specifying required permissions ('Permissions:{'all_of': ['Query Data Lake']}') and detailing the exact return structure, which provides important behavioral information about authorization needs and output format.

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 well-structured and appropriately sized, with clear sections for purpose, requirements, and return values. While slightly longer than minimal, every sentence adds value and the information is front-loaded with the core purpose first.

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 moderate complexity, the description provides complete context: clear purpose, usage prerequisites, detailed return structure, and required permissions. With annotations covering safety and an output schema presumably documenting the return format, the description fills all necessary gaps for effective tool use.

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 single 'database' parameter. The description doesn't add any additional parameter semantics beyond what's in the schema, but the schema itself provides complete coverage, meeting the baseline expectation.

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 available tables') and target resource ('in a Panther Database'), distinguishing it from sibling tools like list_databases (which lists databases) and get_table_schema (which gets schema details). It provides a complete picture of what the tool does.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('Only use valid database names obtained from list_databases'), providing clear prerequisites and linking to a specific sibling tool. This gives the agent precise guidance on proper usage context.

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