Skip to main content
Glama

Delete document

delete_document
DestructiveIdempotent

Delete a file at a tender or a grant — the record AND the object in storage. This is the counterpart to finalize_document_upload and to render_plan_document, which had no way back: a record could be removed by hand, but the file stayed, invisible to every listing. Pass document_id for a record, or storage_path for an object whose record is already gone (list_tender_documents shows those under unreferenced_files). Refuses a path outside this tenant. If the file was typeset from a plan source, the answer says so — the source survives and the next render_plan_folder recreates the file; use delete_draft_document to remove the source as well.

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": "delete_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
document_idNoA row in tender_documents or grant_documents.
storage_pathNoFor an object with no record. Exactly the value from unreferenced_files.delete_with.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, readOnlyHint=false, so the safety profile is covered. The description adds useful behavior: tenant-boundary refusal, the warning that a plan source survives and can be re-rendered, and that files without records remain invisible to listings. These additions are real but the core destructive semantics were already in annotations.

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?

Front-loads the core action and scope before the branch conditions, and every sentence carries information. The historical framing ("which had no way back: a record could be removed by hand...") is slightly verbose but still supports the usage decision.

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?

No output schema exists, and the description covers the return signal (the answer reports when a file was typeset from a plan source). For a two-parameter destructive tool with full annotation coverage, nothing needed to call it correctly is missing.

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 baseline is 3, but the description adds meaning: which parameter applies to which situation (record vs orphaned object) and where the storage_path value comes from (unreferenced_files.delete_with via list_tender_documents). That context is not in the schema's terse property 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?

States a specific verb and resource ("Delete a file at a tender or a grant — the record AND the object in storage"), including the dual-target scope that distinguishes it from record-only deletions. It proactively names related siblings (finalize_document_upload, render_plan_document) and clarifies it covers the case they left behind.

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 routes between the two modes: pass document_id for a record, storage_path for an orphaned object whose record is already gone. It also names an alternative for a distinct case — delete_draft_document when the plan source should also be removed — which is genuine when-to-use/when-not guidance.

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