Skip to main content
Glama

gmail.users.messages.send

Sends an email message to recipients in the To, Cc, and Bcc headers through the Gmail API.

Instructions

Sends the specified message to the recipients in the To, Cc, and Bcc headers. For more information, see Create and send email messages [HTTP POST] — creates or triggers a change; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON Message object accepting classificationLabelValues, historyId, id, internalDate, labelIds, payload, raw, sizeEstimate and 2 more fields; pass it via params or whole via body_file Siblings over the same resource: batchDelete, batchModify, delete, get, import, insert, list, modify, trash, untrash.

Input Schema

NameRequiredDescriptionDefault
queryNoExtra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe.
paramsNoParameter map merged into the request; typed parameters win.
userIdYes[URL path segment] The user's email address. The special value `me` can be used to indicate the authenticated user.me
dry_runNoReturn the request that would be sent, without sending it.
body_fileNoRead the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON Message object.
request_bodyNoRequest body of type Message: pass it via `params` (merged into the built body) or whole via `body_file`.

Output Schema

NameRequiredDescriptionDefault
idNo
rawNo
payloadNo
snippetNo
labelIdsNo
threadIdNo
historyIdNo
internalDateNo
sizeEstimateNo
classificationLabelValuesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / body_file / description
      Previous value: -"Read the request body from this file ('-' for stdin) instead of building one from the parameters."New value: +"Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON Message object."
    • addedInput schema / properties / request_body
      Added value: +{
      +  "description": "Request body of type Message: pass it via `params` (merged into the built body) or whole via `body_file`.",
      +  "properties": {
      +    "classificationLabelValues": {
      +      "items": {
      +        "properties": {
      +          "fields": {
      +            "items": {
      +              "properties": {
      +                "fieldId": {
      +                  "type": "string"
      +                },
      +                "selection": {
      +                  "type": "string"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "labelId": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "historyId": {
      +      "type": "string"
      +    },
      +    "id": {
      +      "type": "string"
      +    },
      +    "internalDate": {
      +      "type": "string"
      +    },
      +    "labelIds": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "payload": {
      +      "properties": {
      +        "body": {
      +          "properties": {
      +            "attachmentId": {
      +              "type": "string"
      +            },
      +            "data": {
      +              "type": "string"
      +            },
      +            "size": {
      +              "type": "integer"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "filename": {
      +          "type": "string"
      +        },
      +        "headers": {
      +          "items": {
      +            "properties": {
      +              "name": {
      +                "type": "string"
      +              },
      +              "value": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "mimeType": {
      +          "type": "string"
      +        },
      +        "partId": {
      +          "type": "string"
      +        },
      +        "parts": {
      +          "items": {
      +            "properties": {
      +              "body": {
      +                "properties": {
      +                  "attachmentId": {
      +                    "type": "string"
      +                  },
      +                  "data": {
      +                    "type": "string"
      +                  },
      +                  "size": {
      +                    "type": "integer"
      +                  }
      +                },
      +                "type": "object"
      +              },
      +              "filename": {
      +                "type": "string"
      +              },
      +              "headers": {
      +                "items": {
      +                  "properties": {
      +                    "name": {
      +                      "type": "string"
      +                    },
      +                    "value": {
      +                      "type": "string"
      +                    }
      +                  },
      +                  "type": "object"
      +                },
      +                "type": "array"
      +              },
      +              "mimeType": {
      +                "type": "string"
      +              },
      +              "partId": {
      +                "type": "string"
      +              },
      +              "parts": {
      +                "items": {
      +                  "properties": {
      +                    "body": {
      +                      "type": "object"
      +                    },
      +                    "filename": {
      +                      "type": "string"
      +                    },
      +                    "headers": {
      +                      "items": {
      +                        "type": "object"
      +                      },
      +                      "type": "array"
      +                    },
      +                    "mimeType": {
      +                      "type": "string"
      +                    },
      +                    "partId": {
      +                      "type": "string"
      +                    },
      +                    "parts": {
      +                      "items": {
      +                        "type": "object"
      +                      },
      +                      "type": "array"
      +                    }
      +                  },
      +                  "type": "object"
      +                },
      +                "type": "array"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "raw": {
      +      "type": "string"
      +    },
      +    "sizeEstimate": {
      +      "type": "integer"
      +    },
      +    "snippet": {
      +      "type": "string"
      +    },
      +    "threadId": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed3 schema fields changed
    • addedInput schema / properties / userId / default
      Added value: +"me"
    • changedInput schema / properties / userId / description
      Previous value: -"The user's email address. The special value `me` can be used to indicate the authenticated user."New value: +"[URL path segment] The user's email address. The special value `me` can be used to indicate the authenticated user."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "classificationLabelValues": {
      +      "items": {
      +        "properties": {
      +          "fields": {
      +            "items": {
      +              "properties": {
      +                "fieldId": {
      +                  "type": "string"
      +                },
      +                "selection": {
      +                  "type": "string"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "labelId": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "historyId": {
      +      "type": "string"
      +    },
      +    "id": {
      +      "type": "string"
      +    },
      +    "internalDate": {
      +      "type": "string"
      +    },
      +    "labelIds": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "payload": {
      +      "properties": {
      +        "body": {
      +          "properties": {
      +            "attachmentId": {
      +              "type": "string"
      +            },
      +            "data": {
      +              "type": "string"
      +            },
      +            "size": {
      +              "type": "integer"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "filename": {
      +          "type": "string"
      +        },
      +        "headers": {
      +          "items": {
      +            "properties": {
      +              "name": {
      +                "type": "string"
      +              },
      +              "value": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "mimeType": {
      +          "type": "string"
      +        },
      +        "partId": {
      +          "type": "string"
      +        },
      +        "parts": {
      +          "items": {
      +            "properties": {
      +              "body": {
      +                "properties": {
      +                  "attachmentId": {
      +                    "type": "string"
      +                  },
      +                  "data": {
      +                    "type": "string"
      +                  },
      +                  "size": {
      +                    "type": "integer"
      +                  }
      +                },
      +                "type": "object"
      +              },
      +              "filename": {
      +                "type": "string"
      +              },
      +              "headers": {
      +                "items": {
      +                  "properties": {
      +                    "name": {
      +                      "type": "string"
      +                    },
      +                    "value": {
      +                      "type": "string"
      +                    }
      +                  },
      +                  "type": "object"
      +                },
      +                "type": "array"
      +              },
      +              "mimeType": {
      +                "type": "string"
      +              },
      +              "partId": {
      +                "type": "string"
      +              },
      +              "parts": {
      +                "items": {
      +                  "properties": {
      +                    "body": {
      +                      "type": "object"
      +                    },
      +                    "filename": {
      +                      "type": "string"
      +                    },
      +                    "headers": {
      +                      "items": {
      +                        "type": "object"
      +                      },
      +                      "type": "array"
      +                    },
      +                    "mimeType": {
      +                      "type": "string"
      +                    },
      +                    "partId": {
      +                      "type": "string"
      +                    },
      +                    "parts": {
      +                      "items": {
      +                        "type": "object"
      +                      },
      +                      "type": "array"
      +                    }
      +                  },
      +                  "type": "object"
      +                },
      +                "type": "array"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "raw": {
      +      "type": "string"
      +    },
      +    "sizeEstimate": {
      +      "type": "integer"
      +    },
      +    "snippet": {
      +      "type": "string"
      +    },
      +    "threadId": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

A3.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does substantial work: it declares the write nature, the read-only-profile refusal, the JSON response shape, and the two body-passing routes (`params` merge vs. whole `body_file`). It still omits that the `raw` field must be base64url-encoded RFC 2822 and where the sent message lands (Sent label/threadId), which are common failure and expectation points for this call.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core sentence is front-loaded correctly, but the body is padded with an over-long field enumeration that trails into 'and 2 more fields', plus a bare sibling-name dump with no relational information. The HTTP method and readonly-profile note earn their place; the field list mostly does not.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Return values are covered by an output schema, so the description needn't explain them, and the mutation/readonly semantics are addressed. What remains missing for a nested-body write tool is the send-vs-insert distinction and the raw-message encoding requirement — both directly determine whether a call succeeds.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents userId, params, body_file, dry_run and the Message body. The description restates the body field names ('classificationLabelValues, historyId, id, internalDate, labelIds, payload, raw, sizeEstimate and 2 more fields') and the params/body_file routing, which largely duplicates the schema's own request_body description. The '2 more fields' hedge adds neither precision nor the merge-precedence nuance beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Sends the specified message to the recipients in the To, Cc, and Bcc headers.' An agent knows exactly what the operation does. However, it lists sibling names (insert, import) without distinguishing itself from them, which matters because Gmail's insert vs. send semantics differ in ways that affect tool choice.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The '[HTTP POST] — creates or triggers a change; refused under --readonly safety profiles' clause gives a real usage gate for restricted environments, and the sibling list hints at the alternative surface. But there is no explicit when-to-use-this-vs-insert/import guidance, leaving the most consequential routing decision (send vs. insert vs. drafts.send) to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools