gmail_list_messages

Pack: gmail · Endpoint: https://gateway.pipeworx.io/gmail/mcp

List messages in your inbox with optional filtering by label or read status. Returns message IDs, thread IDs, and preview text. Use gmail_search for complex queries like date ranges or attachments.

Parameters

NameTypeRequiredDescription
querystringnoGmail search query to filter messages (e.g., “from:alice subject:meeting”)
max_resultsnumbernoMaximum number of messages to return (default 10, max 100)
page_tokenstringnoToken for fetching the next page of results

Example call

Arguments

{
  "max_results": 10
}

curl

curl -X POST https://gateway.pipeworx.io/gmail/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"gmail_list_messages","arguments":{"max_results":10}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('gmail_list_messages', {
  "max_results": 10
});

More examples

{
  "query": "from:alice subject:meeting",
  "max_results": 20
}

Response shape

FieldTypeDescription
messagesarrayArray of message summaries
nextPageTokenstringToken for fetching next page of results
resultSizeEstimatenumberEstimated total number of matching messages
errorstringError code if connection not authenticated
messagestringError message if connection not authenticated
Full JSON Schema
{
  "type": "object",
  "properties": {
    "messages": {
      "type": "array",
      "description": "Array of message summaries",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Message ID"
          },
          "threadId": {
            "type": "string",
            "description": "Thread ID"
          },
          "labelIds": {
            "type": "array",
            "description": "Applied label IDs",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "nextPageToken": {
      "type": "string",
      "description": "Token for fetching next page of results"
    },
    "resultSizeEstimate": {
      "type": "number",
      "description": "Estimated total number of matching messages"
    },
    "error": {
      "type": "string",
      "description": "Error code if connection not authenticated"
    },
    "message": {
      "type": "string",
      "description": "Error message if connection not authenticated"
    }
  }
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "gmail": {
      "url": "https://gateway.pipeworx.io/gmail/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build May 9, 2026