Skip to main content
Glama

Delete a document or folder

doc_delete
Destructive

Remove a document, a directory or a whole folder. Two calls: without confirm_token the call removes NOTHING and returns what would go plus a confirm_token bound to exactly that set; the second call, carrying the token, removes it. Needs manager on everything removed. Actions — delete: recoverable (doc_update action=restore): a file, everything under a directory, or a whole folder with its sync source when confirm_delete_folder repeats the folder's name; refused whole if any file is out of reach. Sharing is not withdrawn: reach grants survive a delete, so the restore brings the sharing back. A document another agent has claimed is refused unless override_claim=true, which they see. erase: PERMANENT, what the console calls "Delete forever": the content, every past version, its comments, its name, and what agents attached to it (truths, message threads, claims, subscriptions, lessons scoped to it); what you are not manager of is left and reported; a nameless record of the erasure stays. No tool deletes an account: a person does that themselves in the console (Account, Delete account forever).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "action": "<action>"
    },
    "name": "doc_delete"
  }
}

Input Schema

NameRequiredDescriptionDefault
nodeNoerase: the document's id, as returned beside its location — survives a rename or a move, so a citation written into a stored document keeps pointing at the right thing. Give this OR location, never both. A console link (`/d/<Name-Slug>-<32 hex>`, whole or just its id) is accepted too.
seatNothe seat token identity_write action=take_seat gave you; pass it on every call while you drive that agent, and each call that carries it keeps the seat yours for a whole lease from that call
actionYeswhat to do; each action takes the arguments its line names
locationNodelete: full path from the workspace root, e.g. "handbook/vendor/acme.md" (as printed by browse action=documents or search). A console link (`/d/<Name-Slug>-<32 hex>`, whole or just its id) is accepted too. · erase: full path from the workspace root, e.g. "handbook/vendor/acme.md". Give this OR node. A path is what a person reads; a node is what survives somebody reorganizing.
acting_asNoan agent identity below you, or one working in a folder you can write (pass its seat too), by its id (from identity_write action=spawn) or its @handle (brief_me lists your agents with both), to make this one call as, with that agent's narrower access; for a helper whose session signs in as its person
confirm_tokenNodelete: OMIT on the first call, which returns what would be deleted plus this token. Pass it on the second call to delete exactly that set; it expires, and is refused if the folder has changed. · erase: OMIT on the first call, which returns what would be destroyed plus this token. Pass it on the second call to erase exactly that set; it expires, and is refused if the set has changed.
override_claimNodelete: delete even though another agent has CLAIMED a document this removes. Logged, and they will see it. Default: refuse and name the holder.
idempotency_keyNoAny unique string you choose for this write, e.g. a UUID. If you retry the call with the same key and the same arguments, the first answer is returned and nothing is done twice. Reusing a key for a different request is refused. Keys are kept 24 hours.
confirm_delete_folderNodelete: required ONLY when deleting a whole folder: the folder's name again, exactly

Output Schema

NameRequiredDescriptionDefault
textNothe answer as prose, for an action that answers in prose
actionYesthe action that answered

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / seat / description
      Previous value: -"the seat token identity_write action=take_seat gave you; pass it on every call while you drive that agent, and each call that carries it keeps the seat yours for its lease"New value: +"the seat token identity_write action=take_seat gave you; pass it on every call while you drive that agent, and each call that carries it keeps the seat yours for a whole lease from that call"
  2. Changed1 schema field changed
    • changedInput schema / properties / acting_as / description
      Previous value: -"an agent identity below you, by its id (from identity_write action=spawn) or its @handle (brief_me lists your agents with both), to make this one call as, with that agent's narrower access; for a helper whose session signs in as its person"New value: +"an agent identity below you, or one working in a folder you can write (pass its seat too), by its id (from identity_write action=spawn) or its @handle (brief_me lists your agents with both), to make this one call as, with that agent's narrower access; for a helper whose session signs in as its person"
  3. Changed1 schema field changed
    • removedOutput schema / additionalProperties
      Removed value: -false
  4. Changed2 schema fields changed
    • changedInput schema / properties / acting_as / description
      Previous value: -"an agent identity below you (its id, from identity_write action=spawn) to make this one call as, with that agent's narrower access; for a helper whose session signs in as its person"New value: +"an agent identity below you, by its id (from identity_write action=spawn) or its @handle (brief_me lists your agents with both), to make this one call as, with that agent's narrower access; for a helper whose session signs in as its person"
    • changedInput schema / properties / seat / description
      Previous value: -"the seat token identity_write action=take_seat gave you; pass it on every call while you drive that agent"New value: +"the seat token identity_write action=take_seat gave you; pass it on every call while you drive that agent, and each call that carries it keeps the seat yours for its lease"
  5. Changed1 schema field changed
    • addedInput schema / properties / override_claim
      Added value: +{
      +  "description": "delete: delete even though another agent has CLAIMED a document this removes. Logged, and they will see it. Default: refuse and name the holder.",
      +  "type": "boolean"
      +}
  6. Changed2 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  7. Changed1 schema field changed
    • addedInput schema / properties / seat
      Added value: +{
      +  "description": "the seat token identity_write action=take_seat gave you; pass it on every call while you drive that agent",
      +  "maxLength": 64,
      +  "type": "string"
      +}
  8. Changed1 schema field changed
    • addedInput schema / properties / acting_as
      Added value: +{
      +  "description": "an agent identity below you (its id, from identity_write action=spawn) to make this one call as, with that agent's narrower access; for a helper whose session signs in as its person",
      +  "type": "string"
      +}
  9. Changed1 schema field changed
    • changedInput schema / properties / location / description
      Previous value: -"delete: full path from the workspace root, e.g. \"handbook/vendor/acme.md\" (as printed by browse action=documents or search) · erase: full path from the workspace root, e.g. \"handbook/vendor/acme.md\". Give this OR node. A path is what a person reads; a node is what survives somebody reorganizing."New value: +"delete: full path from the workspace root, e.g. \"handbook/vendor/acme.md\" (as printed by browse action=documents or search). A console link (`/d/<Name-Slug>-<32 hex>`, whole or just its id) is accepted too. · erase: full path from the workspace root, e.g. \"handbook/vendor/acme.md\". Give this OR node. A path is what a person reads; a node is what survives somebody reorganizing."
  10. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only say destructiveHint=true and idempotent=false; the description adds substantial behavior beyond that — the two-call confirm-token protocol where a first call removes NOTHING, that sharing grants survive a delete, that claims cause refusal unless override_claim is set and the holder is notified, and the full inventory of what erase destroys (content, versions, comments, name, truths, threads, claims, subscriptions, lessons) with a nameless erasure record remaining.

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?

Purpose and the two-call warning are front-loaded, and nearly every clause carries operational information. It is dense and em-dash-heavy, however — the erase consequences arrive as one long run-on, which slows scanning on a high-risk tool.

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 tool with a two-phase handshake, permissions, and side effects on sharing and claims, the description covers what an agent needs to act safely. An output schema exists, so return values need no explanation, and the recoverability/irreversibility distinction is spelled out completely.

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 node vs location, seat, acting_as, confirm_token, and confirm_delete_folder in detail. The description restates the confirm_token two-call flow and the node/location tradeoff rather than adding new parameter-level meaning, so the baseline of 3 applies.

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?

States a specific verb and resource ('Remove a document, a directory or a whole folder') and immediately splits the tool into two named modes, delete and erase, with distinct semantics. An agent can tell this apart from doc_update/doc_create siblings without opening the schema.

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

Usage Guidelines5/5

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

Explicitly says which mode to choose and why: delete is recoverable via doc_update action=restore, erase is PERMANENT and is what the console calls 'Delete forever'. It also names prerequisites (manager on everything removed), the refusal conditions (out-of-reach files, another agent's claim), and the override path, plus the blanket exclusion that no tool deletes an account.

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.

Resources