Skip to main content
Glama

gmail.users.threads.untrash

Restores a trashed Gmail thread and all its messages to the inbox. Use it to recover a conversation removed from Trash by mistake.

Instructions

Removes the specified thread from the trash. Any messages that belong to the thread are also removed from the trash. For more information, see Manage threads [HTTP POST] — creates or triggers a change; refused under --readonly safety profiles. Returns the API's response resource as JSON — request bodies are built from the typed parameters (typed flags win over the params map), or read whole from body_file Siblings over the same resource: delete, get, list, modify, trash.

Input Schema

NameRequiredDescriptionDefault
idYes[URL path segment] The ID of the thread to remove from Trash.
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.

Output Schema

NameRequiredDescriptionDefault
idNo
snippetNo
messagesNo
historyIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / id / description
      Previous value: -"The ID of the thread to remove from Trash."New value: +"[URL path segment] The ID of the thread to remove from Trash."
    • 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": {
      +    "historyId": {
      +      "type": "string"
      +    },
      +    "id": {
      +      "type": "string"
      +    },
      +    "messages": {
      +      "items": {
      +        "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": {
      +                      "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"
      +          },
      +          "raw": {
      +            "type": "string"
      +          },
      +          "sizeEstimate": {
      +            "type": "integer"
      +          },
      +          "snippet": {
      +            "type": "string"
      +          },
      +          "threadId": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "snippet": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral burden and discloses several important traits: HTTP POST mutation, refusal under readonly safety profiles, the side effect of untrashing all messages in the thread, and response/body construction behavior. It does not cover permission requirements or error behavior, but it adds substantial context beyond the schema.

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

Conciseness4/5

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

The description is front-loaded with the core action and side effect, then adds useful operational context. It is slightly verbose with the documentation link, HTTP verb note, safety-profile note, response construction note, and sibling list, but each piece is relevant.

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?

The tool has a full schema and an output schema, so the description need not repeat return values in detail. For an unannotated mutation, the description adequately covers the action, side effect, safety refusal, and body construction, though it omits permissions and error semantics.

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

Parameters4/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 the parameters. The description adds value by explaining that request bodies are built from typed parameters, that typed flags win over the params map, and that body_file can supply the whole body, which clarifies parameter relationships beyond the field-level schema descriptions.

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 description states a specific verb and resource: 'Removes the specified thread from the trash.' It also clarifies the side effect on messages in the thread and lists sibling operations over the same resource, so an agent can distinguish untrash from trash, delete, get, list, and modify.

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 description implies the tool is for restoring a trashed thread and notes that it is refused under --readonly safety profiles. It also lists sibling tools, but it does not explicitly state when to choose untrash versus trash/delete or what prerequisites apply, leaving selection somewhat implied.

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