         else
           msg.send "Sorry, I couldn't do it :("
 
-  robot.respond /(pager|major)( me)? schedules/i, (msg) ->
-    pagerDutyGet msg, "/schedules", {}, (json) ->
+  robot.respond /(pager|major)( me)? schedules( (.+))?$/i, (msg) ->
+    query = {}
+    if msg.match[4]
+      query['query'] = msg.match[4]
+    pagerDutyGet msg, "/schedules", query, (json) ->
       buffer = ''
       schedules = json.schedules
       if schedules

    msg.send "Okay, I'll remember your PagerDuty email is #{email}"

  # Assumes your Campfire usernames and PagerDuty names are identical
  robot.respond /pager( me)? (\d+)/i, (msg) ->
    campfireUserToPagerDutyUser msg, msg.message.user, (user) ->

      userId = user.id
      return unless userId

      start     = moment().format()
      minutes   = parseInt msg.match[2]
      end       = moment().add('minutes', minutes).format()
      override  = {
        'start':     start,
        'end':       end,
        'user_id':   userId
      }
      withCurrentOncall msg, (old_username) ->
        data = { 'override': override }
        pagerDutyPost msg, "/schedules/#{pagerDutyScheduleId}/overrides", data, (json) ->
          if json.override
            start = moment(json.override.start)
            end = moment(json.override.end)
            msg.send "Rejoice, #{old_username}! #{json.override.user.name} has the pager until #{end.format()}"

  robot.respond /(pager|major)( me)? incident (.*)$/, (msg) ->
    pagerDutyIncident msg, msg.match[3], (incident) ->

            value = false
        cb value

  withScheduleMatching = (msg, q, cb) ->
    query = {
      query: q
    }
    pagerDutyGet msg, "/schedules", query, (json) ->
      if json.schedules and json.schedules.length == 1
        cb(json.schedules[0])
      else
        # maybe look for a specific name match here?
        msg.send "#{q} matched #{json.schedules.length} schedules. Can you be more specific?"
        return

  withCurrentOncall = (msg, scheduleId, cb) ->
    oneHour = moment().add('hours', 1).format()
    now = moment().format()

