All data sources

Gmail

OAuthgmail

Gmail connector for reading messages, threads, and labels, and for sending, drafting, deleting, and relabeling messages on the user's behalf (read & write). CRITICAL USAGE RULES: 1. Use listMessages() or listThreads() to discover IDs before calling getMessage(), deleteMessage(), or modifyLabels(). 2. Search using the q parameter with Gmail search syntax (from:, to:, subject:, has:attachment, etc.). 3. Write operations available: sendEmail, createDraft, trashMessage, deleteMessage, modifyLabels. Prefer trashMessage for "move to trash" / "delete" intents (reversible). deleteMessage is PERMANENT and irreversible — only use when explicitly asked to permanently/forever erase. 4. deleteMessage() permanently removes the message and cannot be undone — confirm with the user before calling it.

Provenance

PublisherGmail

Freshness & coverage

FreshnessFreshness not declared
GeographicNot declared
TemporalNot declared
AuthenticationCredentials required (OAuth)

Methods (10)

  • listMessages

    read

    List Gmail messages with optional Gmail search syntax.

    Input schema
    {
      "type": "object",
      "properties": {
        "q": {
          "type": "string",
          "description": "Gmail search query."
        },
        "maxResults": {
          "type": "number",
          "description": "Maximum messages to return."
        },
        "pageToken": {
          "type": "string",
          "description": "Pagination token."
        },
        "labelIds": {
          "type": "array",
          "description": "Optional Gmail label IDs.",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": true
    }
  • getMessage

    read

    Fetch one Gmail message by ID.

    Required paramsid
    Input schema
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Gmail message ID."
        },
        "format": {
          "type": "string",
          "description": "Response format such as full, metadata, or raw."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": true
    }
  • listThreads

    read

    List Gmail conversation threads with optional Gmail search syntax.

    Input schema
    {
      "type": "object",
      "properties": {
        "q": {
          "type": "string",
          "description": "Gmail search query."
        },
        "maxResults": {
          "type": "number",
          "description": "Maximum threads to return."
        },
        "pageToken": {
          "type": "string",
          "description": "Pagination token."
        }
      },
      "additionalProperties": true
    }
  • listLabels

    read

    List Gmail labels for the current mailbox.

    Input schema
    {
      "type": "object",
      "properties": {},
      "additionalProperties": true
    }
  • getProfile

    read

    Return the authenticated mailbox profile (email address, message totals).

    Input schema
    {
      "type": "object",
      "properties": {},
      "additionalProperties": true
    }
  • sendEmail

    write

    Send an email from the authenticated user's Gmail account.

    Required paramstosubjectbody
    Input schema
    {
      "type": "object",
      "properties": {
        "to": {
          "description": "Recipient email address(es).",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "cc": {
          "description": "Optional CC recipients.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "bcc": {
          "description": "Optional BCC recipients.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "from": {
          "type": "string",
          "description": "Optional From header."
        },
        "subject": {
          "type": "string",
          "description": "Email subject."
        },
        "body": {
          "type": "string",
          "description": "Email body (plain text or HTML)."
        },
        "isHtml": {
          "type": "boolean",
          "description": "Set true to send an HTML body."
        }
      },
      "required": [
        "to",
        "subject",
        "body"
      ],
      "additionalProperties": true
    }
  • createDraft

    write

    Create a Gmail draft without sending it.

    Required paramstosubjectbody
    Input schema
    {
      "type": "object",
      "properties": {
        "to": {
          "description": "Recipient email address(es).",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "cc": {
          "description": "Optional CC recipients.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "bcc": {
          "description": "Optional BCC recipients.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "from": {
          "type": "string",
          "description": "Optional From header."
        },
        "subject": {
          "type": "string",
          "description": "Draft subject."
        },
        "body": {
          "type": "string",
          "description": "Draft body (plain text or HTML)."
        },
        "isHtml": {
          "type": "boolean",
          "description": "Set true to save an HTML body."
        }
      },
      "required": [
        "to",
        "subject",
        "body"
      ],
      "additionalProperties": true
    }
  • deleteMessage

    write

    PERMANENTLY delete a Gmail message by ID — message is gone forever, NOT moved to Trash. Use trashMessage for the standard "move to trash" semantics, or modifyLabels to archive.

    Required paramsid
    Input schema
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Gmail message ID to permanently delete."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": true
    }
  • trashMessage

    unknown

    Move a Gmail message to the Trash folder. Reversible — Gmail purges trashed messages after 30 days. Use this for "move to trash" / "delete" intents from end users.

    Required paramsid
    Input schema
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Gmail message ID to move to Trash."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": true
    }
  • modifyLabels

    write

    Add and/or remove labels on a Gmail message (e.g. remove INBOX to archive, add STARRED to star).

    Required paramsid
    Input schema
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Gmail message ID."
        },
        "addLabelIds": {
          "type": "array",
          "description": "Label IDs to add.",
          "items": {
            "type": "string"
          }
        },
        "removeLabelIds": {
          "type": "array",
          "description": "Label IDs to remove.",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": true
    }