Skip to main content
Glama
wpfleger96

PagerDuty MCP Server

by wpfleger96

list_users_oncall

Retrieve on-call users for a specific schedule within a given time range to quickly identify who is responsible for incidents.

Instructions

List the users on call for a schedule during the specified time range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schedule_idYesThe ID of the schedule to query
sinceNoStart of query range in ISO8601 format
untilNoEnd of query range in ISO8601 format

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that implements the 'list_users_oncall' logic. Calls PagerDuty API GET /schedules/{schedule_id}/users, validates parameters, parses user data, and returns formatted response.
    def list_users_oncall(
        *, schedule_id: str, since: Optional[str] = None, until: Optional[str] = None
    ) -> Dict[str, Any]:
        """List the users on call for a given schedule during the specified time range. Returns a list of users who are or will be on call during the specified period. Exposed as MCP server tool.
    
        Args:
            schedule_id (str): The ID of the schedule to list users on call for
            since (str): Start of date range in ISO8601 format (optional). Default is 1 month ago
            until (str): End of date range in ISO8601 format (optional). Default is now
    
        Returns:
            See the "Standard Response Format" section in `tools.md` for the complete standard response structure.
            The response will contain a list of users who are on call during the specified time range.
    
        Raises:
            See the "Error Handling" section in `tools.md` for common error scenarios.
        """
    
        if not schedule_id:
            raise ValueError("schedule_id cannot be empty")
    
        pd_client = create_client()
    
        params = {}
        if since:
            utils.validate_iso8601_timestamp(since, "since")
            params["since"] = since
        if until:
            utils.validate_iso8601_timestamp(until, "until")
            params["until"] = until
    
        try:
            response = pd_client.jget(f"{SCHEDULES_URL}/{schedule_id}/users", params=params)
            try:
                users_data = response["users"]
            except KeyError:
                raise RuntimeError(
                    f"Failed to fetch users on call for schedule {schedule_id}: Response missing 'users' field"
                )
    
            return utils.api_response_handler(
                results=[parse_user(result=user) for user in users_data],
                resource_name="users",
            )
        except Exception as e:
            utils.handle_api_error(e)
  • MCP tool wrapper that exposes 'list_users_oncall' as a FastMCP tool. Decorated with @mcp.tool(), delegates to schedules.list_users_oncall().
    @mcp.tool()
    def list_users_oncall(
        *, schedule_id: str, since: Optional[str] = None, until: Optional[str] = None
    ) -> Dict[str, Any]:
        """List the users on call for a schedule during the specified time range.
    
        Args:
            schedule_id (str): The ID of the schedule to query
            since (str): Start of query range in ISO8601 format
            until (str): End of query range in ISO8601 format
        """
        return schedules.list_users_oncall(
            schedule_id=schedule_id, since=since, until=until
        )
  • Registration via @mcp.tool() decorator on line 273 registers 'list_users_oncall' as an MCP tool in FastMCP server.
    @mcp.tool()
    def list_users_oncall(
        *, schedule_id: str, since: Optional[str] = None, until: Optional[str] = None
    ) -> Dict[str, Any]:
        """List the users on call for a schedule during the specified time range.
    
        Args:
            schedule_id (str): The ID of the schedule to query
            since (str): Start of query range in ISO8601 format
            until (str): End of query range in ISO8601 format
        """
        return schedules.list_users_oncall(
            schedule_id=schedule_id, since=since, until=until
        )
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only states a list operation without mentioning read-only nature, authentication needs, or any side effects, which is insufficient.

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 a single sentence of 13 words, directly stating the action and context with no redundant information. It is optimally concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple tool (3 parameters, output schema present), the minimal description covers the core purpose but lacks detail about return format or edge cases, making it adequate but not fully complete.

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%, so the schema already documents all parameters. The description adds only a vague reference to 'specified time range', providing no extra meaning beyond the schema's parameter descriptions.

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 uses specific verb 'List' and clearly identifies the resource ('users on call') and context ('for a schedule during the specified time range'), distinguishing it from sibling tools like 'get_oncalls' and 'get_schedules'.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, nor does it mention prerequisites or exclusions, leaving the agent to infer usage from the name alone.

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/wpfleger96/pagerduty-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server