Skip to main content
Glama

gmail.users.settings.cse.keypairs.create

Creates and uploads an S/MIME public key certificate chain and private key metadata for Gmail client-side encryption, letting users or delegated admins set up key pairs.

Instructions

Creates and uploads a client-side encryption S/MIME public key certificate chain and private key metadata for the authenticated user. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service account that has domain-wide delegation authority to impersonate users with the https://www.googleapis.com/auth/gmail.settings.basic scope. For users managing their ow [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 CseKeyPair object accepting disableTime, enablementState, keyPairId, pem, pkcs7, privateKeyMetadata, subjectEmailAddresses; pass it via params or whole via body_file Siblings over the same resource: disable, enable, get, list, obliterate.

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 requester's primary email address. To indicate the authenticated user, you can use the special value `me`.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 CseKeyPair object.
request_bodyNoRequest body of type CseKeyPair: pass it via `params` (merged into the built body) or whole via `body_file`.
chainValidationNo[query parameter] The type of certificate chain validation to perform at creation. The request will be rejected if the uploaded chain fails to satisfy the requested validation ch Values: `all` = Enable all certificate chain validation and certificate revocation checks. Recommended for normal use.; `none` = Disable all certificate chain validation and certificate revocation checks. This may be useful when deliberately creating key pairs with invalid, out-of-use certificate chains to be used only for decryption of historical S/MIME messages. Key pairs created with invalid or revoked certificates cannot be used in a CseIdentity object..all

Output Schema

NameRequiredDescriptionDefault
pemNo
pkcs7No
keyPairIdNo
disableTimeNo
enablementStateNo
privateKeyMetadataNo
subjectEmailAddressesNo

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 CseKeyPair object."
    • addedInput schema / properties / request_body
      Added value: +{
      +  "description": "Request body of type CseKeyPair: pass it via `params` (merged into the built body) or whole via `body_file`.",
      +  "properties": {
      +    "disableTime": {
      +      "type": "string"
      +    },
      +    "enablementState": {
      +      "enum": [
      +        "stateUnspecified",
      +        "enabled",
      +        "disabled"
      +      ],
      +      "type": "string"
      +    },
      +    "keyPairId": {
      +      "type": "string"
      +    },
      +    "pem": {
      +      "type": "string"
      +    },
      +    "pkcs7": {
      +      "type": "string"
      +    },
      +    "privateKeyMetadata": {
      +      "items": {
      +        "properties": {
      +          "hardwareKeyMetadata": {
      +            "properties": {
      +              "description": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "kaclsKeyMetadata": {
      +            "properties": {
      +              "kaclsData": {
      +                "type": "string"
      +              },
      +              "kaclsUri": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "privateKeyMetadataId": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "subjectEmailAddresses": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed5 schema fields changed
    • addedInput schema / properties / chainValidation / default
      Added value: +"all"
    • changedInput schema / properties / chainValidation / description
      Previous value: -"The type of certificate chain validation to perform at creation. The request will be rejected if the uploaded chain fails to satisfy the requested validation ch"New value: +"[query parameter] The type of certificate chain validation to perform at creation. The request will be rejected if the uploaded chain fails to satisfy the requested validation ch Values: `all` = Enable all certificate chain validation and certificate revocation checks. Recommended for normal use.; `none` = Disable all certificate chain validation and certificate revocation checks. This may be useful when deliberately creating key pairs with invalid, out-of-use certificate chains to be used only for decryption of historical S/MIME messages. Key pairs created with invalid or revoked certificates cannot be used in a CseIdentity object.."
    • addedInput schema / properties / userId / default
      Added value: +"me"
    • changedInput schema / properties / userId / description
      Previous value: -"The requester's primary email address. To indicate the authenticated user, you can use the special value `me`."New value: +"[URL path segment] The requester's primary email address. To indicate the authenticated user, you can use the special value `me`."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "disableTime": {
      +      "type": "string"
      +    },
      +    "enablementState": {
      +      "enum": [
      +        "stateUnspecified",
      +        "enabled",
      +        "disabled"
      +      ],
      +      "type": "string"
      +    },
      +    "keyPairId": {
      +      "type": "string"
      +    },
      +    "pem": {
      +      "type": "string"
      +    },
      +    "pkcs7": {
      +      "type": "string"
      +    },
      +    "privateKeyMetadata": {
      +      "items": {
      +        "properties": {
      +          "hardwareKeyMetadata": {
      +            "properties": {
      +              "description": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "kaclsKeyMetadata": {
      +            "properties": {
      +              "kaclsData": {
      +                "type": "string"
      +              },
      +              "kaclsUri": {
      +                "type": "string"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "privateKeyMetadataId": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "subjectEmailAddresses": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description does real work: it declares the HTTP method, that it creates/triggers a change, that it is refused under --readonly profiles, the required service-account domain-wide delegation and gmail.settings.basic scope, and that the API response resource is returned as JSON. Beyond that it says nothing about preconditions (duplicate keypairId, chain validation failure handling) beyond what chainValidation's schema text already covers.

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 purpose is front-loaded, but the text is a dense run-on that mixes an authorization paragraph, a bracketed transport note, a body-field inventory, and a sibling list, and it contains a visibly truncated clause. Several sentences could be dropped given the schema already carries the field inventory.

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

Completeness4/5

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

For a nested-body write tool the description covers auth, transport behavior, body construction routes, and sibling alternatives, and an output schema exists so return values need not be spelled out (it mentions them anyway). The main gap is the truncated audience sentence and no note on failure/duplicate behavior.

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 coverage is 100%, so the schema already documents every parameter including the chainValidation enum and the nested CseKeyPair body. The description only restates the body field list and the params/body_file routing, adding no semantics not already present in structured fields.

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

Purpose5/5

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

The first sentence states a precise verb and resource: creates and uploads a CSE S/MIME public key certificate chain plus private key metadata. It then names the sibling operations over the same resource (disable, enable, get, list, obliterate), so an agent can place it correctly without opening another schema.

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?

It sketches two audiences (administrators acting for users vs. users acting on their own), but the second path is cut off mid-sentence ("For users managing their ow"), so the guidance is incomplete. Naming the siblings implies when not to use this tool, but there is no explicit "use create when creating a new keypair, not when toggling one" statement.

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