Skip to main content
Glama
panther-labs

Panther MCP Server

Official

get_scheduled_query

Read-only

Retrieve detailed information about a specific scheduled query by ID, including SQL code, schedule configuration, and metadata for security monitoring analysis.

Instructions

Get detailed information about a specific scheduled query by ID.

Returns complete scheduled query information including SQL, schedule configuration, and metadata.

Returns: Dict containing: - success: Boolean indicating if the query was successful - query: Scheduled query information if successful, containing: - id: Query ID - name: Query name - description: Query description - sql: The SQL query text - schedule: Schedule configuration (cron, rate, timeout) - managed: Whether the query is managed by Panther - createdAt: Creation timestamp - updatedAt: Last update timestamp - message: Error message if unsuccessful

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
query_idYesThe ID of the scheduled query to fetch (must be a UUID)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that executes the get_scheduled_query tool. It takes a UUID query_id, fetches the query details from the Panther REST API endpoint /queries/{query_id}, and returns a structured response with success status and query data or error message.
    async def get_scheduled_query(
        query_id: Annotated[
            UUID,
            Field(
                description="The ID of the scheduled query to fetch (must be a UUID)",
                examples=["6c6574cb-fbf9-49fc-baad-1a99464ef09e"],
            ),
        ],
    ) -> Dict[str, Any]:
        """Get detailed information about a specific scheduled query by ID.
    
        Returns complete scheduled query information including SQL, schedule configuration,
        and metadata.
    
        Returns:
            Dict containing:
            - success: Boolean indicating if the query was successful
            - query: Scheduled query information if successful, containing:
                - id: Query ID
                - name: Query name
                - description: Query description
                - sql: The SQL query text
                - schedule: Schedule configuration (cron, rate, timeout)
                - managed: Whether the query is managed by Panther
                - createdAt: Creation timestamp
                - updatedAt: Last update timestamp
            - message: Error message if unsuccessful
        """
        logger.info(f"Fetching scheduled query: {query_id}")
    
        try:
            # Execute the REST API call
            async with get_rest_client() as client:
                response_data, status_code = await client.get(f"/queries/{str(query_id)}")
    
            logger.info(f"Successfully retrieved scheduled query: {query_id}")
    
            # Format the response
            return {
                "success": True,
                "query": response_data,
            }
        except Exception as e:
            logger.error(f"Failed to fetch scheduled query: {str(e)}")
            return {
                "success": False,
                "message": f"Failed to fetch scheduled query: {str(e)}",
            }
  • Input schema definition for the tool using Pydantic's Annotated with UUID type and Field providing description and example.
        query_id: Annotated[
            UUID,
            Field(
                description="The ID of the scheduled query to fetch (must be a UUID)",
                examples=["6c6574cb-fbf9-49fc-baad-1a99464ef09e"],
            ),
        ],
    ) -> Dict[str, Any]:
  • The @mcp_tool decorator registers the get_scheduled_query function into the global tool registry with required permissions and read-only annotation.
    @mcp_tool(
        annotations={
            "permissions": all_perms(Permission.DATA_ANALYTICS_READ),
            "readOnlyHint": True,
        }
    )
  • Invocation of register_all_tools on the FastMCP instance, which iterates over all decorated tools (including get_scheduled_query) and registers them with the MCP server using mcp_instance.tool() with extracted metadata.
    # Register all tools with MCP using the registry
    register_all_tools(mcp)
Behavior4/5

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

The annotations provide readOnlyHint=true, indicating a safe read operation. The description adds valuable context beyond this by detailing the return structure, including success status and error handling, and specifying required permissions ('Query Data Lake'), which enhances transparency about access requirements and response behavior.

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 front-loaded with the core purpose, followed by details on returns and permissions. It is appropriately sized with no redundant information, though the permissions note could be integrated more smoothly into the flow.

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 complexity (single parameter, read-only operation), the description is complete. It includes purpose, detailed return values, and permissions, and with an output schema present, it does not need to explain return values further. The annotations cover safety, and the schema handles parameters fully.

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?

The input schema has 100% description coverage, fully documenting the single parameter 'query_id' with its UUID format and examples. The description does not add any additional semantic details about the parameter beyond what the schema provides, so it meets the baseline score of 3.

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 tool's purpose with a specific verb ('Get detailed information') and resource ('about a specific scheduled query by ID'), distinguishing it from sibling tools like 'list_scheduled_queries' which returns a list rather than detailed information for a single query.

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 context by specifying that it fetches information for a specific scheduled query by ID, but does not explicitly state when to use this tool versus alternatives like 'list_scheduled_queries' or provide exclusions. The permissions requirement is noted, but no explicit guidance on tool selection is given.

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