Skip to main content
Glama
wpfleger96

PagerDuty MCP Server

by wpfleger96

list_users_oncall

Retrieve users on call for a specific PagerDuty schedule within a defined time range by providing the schedule ID, start time, and end time in ISO8601 format.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schedule_idYes
sinceNo
untilNo

Implementation Reference

  • Core handler function that implements the logic to fetch users on call for a PagerDuty schedule using the API, including validation, API call, parsing, and error handling.
    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 registration using @mcp.tool() decorator. Defines the tool schema via parameters and docstring, and delegates execution to the core handler in schedules.py.
    @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 mentions the time range constraint but doesn't describe what happens when parameters are null, whether results are paginated, what format the output takes, or any rate limits or authentication requirements. This leaves significant behavioral gaps.

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 efficiently structured with a clear purpose statement followed by parameter documentation. Every sentence serves a purpose, though the parameter documentation could be more integrated rather than a separate 'Args' section.

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

Completeness2/5

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

For a query tool with 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the output looks like, how null parameters are handled, or provide any error handling context. The parameter documentation helps but doesn't compensate for the overall lack of behavioral information.

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 description includes an 'Args' section that documents all three parameters with basic type information and format hints ('ISO8601 format'). With 0% schema description coverage, this adds meaningful value beyond the bare schema, though it doesn't fully explain parameter interactions or edge cases.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 ('List') and resource ('users on call for a schedule during the specified time range'). It distinguishes from general user listing tools but doesn't explicitly differentiate from sibling 'get_oncalls' which might have overlapping functionality.

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 like 'get_oncalls' or 'get_users'. It states what the tool does but offers no context about prerequisites, typical use cases, or when other tools might be more appropriate.

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

Related 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