gmail_search
Pack: gmail · Endpoint: https://gateway.pipeworx.io/gmail/mcp
Search emails using Gmail query syntax (e.g., ‘from:[email protected]’, ‘subject:invoice’, ‘has:attachment’, ‘after:2024/01/01’, ‘is:unread’). Returns matching message IDs.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
query | string | yes | Gmail search query (e.g., “from:[email protected] after:2024/01/01 has:attachment”) |
max_results | number | no | Maximum number of messages to return (default 10, max 100) |
Example call
Arguments
{
"query": "from:[email protected] after:2024/01/01 has:attachment"
}
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_search","arguments":{"query":"from:[email protected] after:2024/01/01 has:attachment"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('gmail_search', {
"query": "from:[email protected] after:2024/01/01 has:attachment"
});
More examples
{
"query": "is:unread subject:invoice",
"max_results": 50
}
Response shape
| Field | Type | Description |
|---|---|---|
messages | array | Array of matching message summaries |
nextPageToken | string | Token for fetching next page of results |
resultSizeEstimate | number | Estimated total number of matching messages |
error | string | Error code if connection not authenticated |
message | string | Error message if connection not authenticated |
Full JSON Schema
{
"type": "object",
"properties": {
"messages": {
"type": "array",
"description": "Array of matching 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.