Skip to content

Gmail — add Delete Label action #21079

@s0s0physm

Description

@s0s0physm

Is there a specific app this action is for?
Gmail

Please provide a link to the relevant API docs for the specific service / operation.
https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.labels/delete

Problem

Gmail's components let an agent create a label, list labels, and add or remove a label on a message, but there is no action to delete a label definition from the account. The existing remove-label-from-email action only detaches a label from a single message through users.messages.modify and does not remove the label itself. An agent managing a mailbox's label set cannot delete labels it or a user created.

What's needed

A new Delete Label action that calls users.labels.delete with the selected label id. It should reuse the existing label propDefinition in gmail.app.mjs, which is backed by listLabels, so the label is chosen from a dropdown, filtered to user-created labels because system labels such as INBOX and SENT cannot be deleted. Set destructiveHint to true, since the call permanently removes the label and strips it from every message and thread it was applied to.

Notes

  • Endpoint: DELETE users/{userId}/labels/{id}, which immediately and permanently deletes the label and removes it from any messages and threads it is applied to.
  • Uses the same modify scope that create-label already relies on, so no new OAuth scope is needed.
  • Related in-flight work: open PR gmail: AI-optimized action set for MCP #20697 (gmail: AI-optimized action set for MCP) reworks several Gmail label actions and adds gmail-modify-labels, but it does not add a delete-label-definition action. Coordinate naming with it.

[AI-11774]

Metadata

Metadata

Assignees

Labels

HIGH PRIORITYPIPE-SNactionNew Action RequestenhancementNew feature or requesttriagedFor maintainers: This issue has been triaged by a Pipedream employee

Type

No type
No fields configured for issues without a type.

Projects

Status
Doing

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions