{
  "$id": "https://intentschema.org/intents/productivity/calendar/event/list/v1.json",
  "fqdn": "org.intentschema.productivity.calendar.event.list.v1",
  "title": "List calendar events",
  "description": "List events in one or more calendars by time range, attendee, or text.",
  "payload": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "required": [
      "target"
    ],
    "properties": {
      "target": {
        "$ref": "https://intentschema.org/common/target/v1.json"
      },
      "object": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Optional provider-specific search string."
          },
          "filter": {
            "type": "object",
            "properties": {
              "calendar_id": {
                "type": "string",
                "description": "Provider calendar identifier; omit for primary."
              },
              "after": {
                "type": "string",
                "format": "date-time"
              },
              "before": {
                "type": "string",
                "format": "date-time"
              },
              "attendee": {
                "type": "string",
                "format": "email"
              },
              "text": {
                "type": "string",
                "description": "Free-text match against summary/description/location."
              }
            }
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500,
            "default": 50
          },
          "cursor": {
            "type": "string"
          }
        }
      }
    }
  },
  "result": {
    "type": "object",
    "required": [
      "items"
    ],
    "properties": {
      "items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "external_id": {
              "type": "string"
            },
            "summary": {
              "type": "string"
            },
            "start": {
              "type": "string",
              "format": "date-time"
            },
            "end": {
              "type": "string",
              "format": "date-time"
            },
            "attendees": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "email",
                "description": "RFC 5321 mailbox. Plain address (jane@example.com) or with display name (\"Jane Doe\" <jane@example.com>)."
              }
            },
            "html_link": {
              "type": "string",
              "format": "uri"
            }
          }
        }
      },
      "next_cursor": {
        "type": "string",
        "description": "Present when more results are available."
      },
      "estimated_total": {
        "type": "integer"
      }
    }
  },
  "examples": [
    {
      "name": "this week",
      "value": {
        "target": {
          "system": "google_calendar"
        },
        "object": {
          "filter": {
            "after": "2026-04-20T00:00:00Z",
            "before": "2026-04-27T00:00:00Z"
          }
        }
      }
    }
  ]
}
