Skip to main content
Glama

archive_document

Soft-archive a saved document — it leaves the Files view but is recoverable server-side. Presence-aware: if the document is currently open in ANOTHER session and force is not set, the request FAILS honestly with HTTP 409 (code:"document_in_use" + open_in_sessions:N + suggested_action) so callers can confirm "open in N other session(s) — delete anyway?" and re-call with force=true. On force=true it archives, unlinks every session, and notifies the other sessions (which then prompt the user to keep editing or honor the deletion).

A no-op never wears a success status: if nothing was archived you get the 409 above, so a 2xx always means the archive actually happened.

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": {
      "document_id": "<document_id>"
    },
    "name": "archive_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
forceNoConfirm deletion of a doc that is open in another session. Without it, deleting an in-use doc fails with HTTP 409 (code document_in_use, open_in_sessions:N) instead of tombstoning — nothing is archived until you re-call with force=true.
document_idYes
from_sessionNoThe caller's own session id (so it is excluded from the in-use check). Omit for a pure Files-view delete.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / properties / authorization
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "title": "Authorization"
      -}
  2. First observed

TDQS

A4.3/5.0
Behavior5/5

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

No annotations exist, so the description carries the full burden and does so: it discloses soft-delete semantics, the exact 409 failure shape (code document_in_use, open_in_sessions:N, suggested_action), side effects of force=true (unlinks every session and notifies other sessions), and the no-op guarantee that 2xx means the archive happened. Permissions/auth requirements are the only notable omission.

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

Conciseness5/5

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

Front-loaded with the core purpose, then the failure mode, then the force consequences; every sentence conveys operational information. Minor overlap with the schema's force description is acceptable since it is framed as workflow rather than restatement.

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 mutation tool with no annotations and no output schema, the description supplies the failure contract and the success guarantee that an agent needs. Missing are the behavior for a nonexistent or already-archived document_id and any success payload shape, though the '2xx means it happened' line covers much of the latter.

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 67%, with force already well documented. The description adds value beyond the schema by explaining the downstream consequences of force=true — unlinking all sessions and notifying other sessions — which the schema does not state. document_id itself is given no explicit meaning anywhere beyond its name.

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

Purpose4/5

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

Opens with a specific verb+resource and immediately disambiguates the kind of deletion: 'Soft-archive a saved document — it leaves the Files view but is recoverable server-side.' This distinguishes it from irreversible deletion, but it never names or implicitly routes away from adjacent siblings such as unarchive_document or close_session_document.

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?

Gives strong conditional guidance for the key decision point: if the doc is open in another session and force is unset the call FAILS with 409, and the caller should confirm then re-call with force=true. It does not say when to prefer this over close_session_document or when to use unarchive_document, but the in-context when-to-use for force is explicit.

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.