Skip to main content
Glama

Purge from trash

trash_purge
DestructiveIdempotent

Delete for good from the trash: permanent (no restore afterwards), and it frees the storage the items used. Pass one entry by its id (a trash_list entry's id; the server finds its type; it must be in the trash, a live item is refused NOT_IN_TRASH, an id that names nothing NOT_FOUND), or all: true to empty a whole trash: your own by default, or one of workspaceId, team, or a platform admin's account, as trash_list scopes it; type takes one type only, deletedBefore only what was deleted at or before that instant. all takes what was in the trash when the first call began and works in pages: while nextCursor is not null, call again with the same inputs and cursor: nextCursor, until it is null (a cursor sent with other inputs is refused INVALID_CURSOR). skipped lists each entry left in the trash and why: forbidden (you may not remove it), restored (it left the trash or was deleted again after the purge began), gone (already purged), failed (its purge failed; it is left in the trash, a new call tries it again, and if it keeps failing it stays). Needs the same authority as deleting each item. why is required for a workspace item and a workspace scope; their purge is recorded in the workspace history. Purging a folder or workspace takes everything in it.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "trash_purge"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoThe entry's id as the trash list shows it (an artifact's or bundle's id, a folder's or workspace's id); an artifact's alias or your own bundle's slug works too. The server finds its type.
allNoEmpty a whole trash instead of one entry.
whyNoRequired for workspace items: one sentence on the goal this change serves, not a description of this edit. Every edit to workspace files, rows, folders and settings takes one (task operations need none); sessions and summaries record themselves from it. At most 300 characters.
teamNoA team's trash, by slug or id: its folders and workspaces.
typeNoOnly entries of this type. Your own trash holds all four; a team's folders and workspaces; a workspace's artifacts and folders.
cursorNoWith all: the nextCursor of the previous call, sent with the same inputs.
accountNoAnother account's own trash, by account id or alias (platform admins only; anyone else is refused FORBIDDEN).
workspaceIdNoA workspace's trash, by its id or its slug: the artifacts and folders deleted in it.
deletedBeforeNoWith all: only entries deleted at or before this instant (ISO 8601).

Output Schema

NameRequiredDescriptionDefault
purgedYes
skippedYes
nextCursorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / why / description
      Previous value: -"Required for workspace items: one sentence on what the person is trying to accomplish, in their terms, not a description of this edit. Every workspace write takes one; sessions and summaries record themselves from it. At most 300 characters."New value: +"Required for workspace items: one sentence on the goal this change serves, not a description of this edit. Every edit to workspace files, rows, folders and settings takes one (task operations need none); sessions and summaries record themselves from it. At most 300 characters."
  2. Changed1 schema field changed
    • changedInput schema / properties / workspaceId / description
      Previous value: -"A workspace's trash, by its id or its slug: the artifacts and folders deleted in it (an external member sees shared items only)."New value: +"A workspace's trash, by its id or its slug: the artifacts and folders deleted in it."
  3. Changed5 schema fields changed
    • changedInput schema / properties / workspaceId / description
      Previous value: -"A workspace's trash: the artifacts and folders deleted in it (an external member sees shared items only)."New value: +"A workspace's trash, by its id or its slug: the artifacts and folders deleted in it (an external member sees shared items only)."
    • removedInput schema / properties / workspaceId / format
      Removed value: -"uuid"
    • addedInput schema / properties / workspaceId / maxLength
      Added value: +64
    • addedInput schema / properties / workspaceId / minLength
      Added value: +1
    • removedInput schema / properties / workspaceId / pattern
      Removed value: -"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
  4. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the destructiveHint/idempotentHint annotations, it discloses storage reclamation, cascading deletion for folders and workspaces, the full pagination protocol (repeat with identical inputs plus nextCursor until null, INVALID_CURSOR otherwise), and detailed `skipped` semantics including retry behavior for `failed` entries. It also notes the audit/history requirement (`why`) and the authority equivalence to deleting each item.

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 core irreversible-delete warning and storage benefit are front-loaded, and nearly every clause carries a distinct rule rather than filler. However, it is delivered as one dense run-on paragraph with stacked parentheticals, and the `why` requirement largely repeats the schema's own parameter description, making it harder to scan than it needs to be.

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

Completeness5/5

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

For a destructive, paginated, multi-scope tool with nine parameters, the description covers modes, scoping, failure handling, and cascade effects; an output schema exists so return-value exposition is not required. It also flags the partial-result case (`skipped`) that an agent must handle after a paginated purge loop.

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 already 100%, but the description still adds real meaning: `type` takes exactly one type, `deletedBefore` is an inclusive upper bound applied with `all`, `cursor` must be resubmitted with the same inputs, and `account` is restricted to platform admins. The remaining parameters (team, workspaceId, why) are only lightly reinforced rather than deepened beyond their schema text.

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?

"Delete for good from the trash: permanent (no restore afterwards)" states a specific verb (permanent purge), resource (trash entries), and consequence (irreversible, storage freed). That wording also implicitly separates it from trash_restore and trash_list without the agent needing to open either schema.

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

Usage Guidelines4/5

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

It clearly routes between the two modes: pass an `id` for one entry, or `all: true` to empty a trash, and directs the agent to trash_list for the id and scope semantics. It also states preconditions (item must be in the trash, NOT_IN_TRASH/NOT_FOUND otherwise) and the authority requirement. It never names trash_restore as the alternative when the intent is recoverable, so the exclusions are only implied by "no restore afterwards".

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.