Skip to main content
Glama

legal_put_document

Replace an entire legal document on a WordPress site with ordered sections, rewriting the linked page content in one call.

Instructions

Replace a whole legal document (every section not listed is gone). Sections are ordered; omit slug to derive it from the heading. The linked page's post_content is rewritten at once. The plugin ships no legal prose - it stores and renders what it is given. Returns { saved: true }.

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": {
      "site": "<site>",
      "doc": "<doc>",
      "sections": "<sections>"
    },
    "name": "legal_put_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
docYesDocument type
siteYesSite id (see list_sites)
titleNoDocument title, rendered as the H1; defaults to the document type's label (e.g. Impressum)
sectionsYesOrdered sections

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv3.14.0
    • changedInput schema / properties / sections / items / properties / body / description
      Previous value: -"HTML body"New value: +"HTML body, filtered through wp_kses_post"
    • addedInput schema / properties / sections / items / properties / heading / description
      Added value: +"Section heading (plain text)"
    • changedInput schema / properties / sections / items / properties / level / description
      Previous value: -"2 or 3, default 2"New value: +"Heading level, 2 (H2) or 3 (H3); default 2"
    • addedInput schema / properties / sections / items / properties / level / maximum
      Added value: +3
    • addedInput schema / properties / sections / items / properties / level / minimum
      Added value: +2
    • changedInput schema / properties / sections / items / properties / level / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / sections / items / properties / slug / description
      Previous value: -"Stable slug; derived from the heading when omitted"New value: +"Stable slug; derived from the heading when omitted, de-duplicated against the other sections"
    • changedInput schema / properties / title / description
      Previous value: -"Document title, rendered as the H1"New value: +"Document title, rendered as the H1; defaults to the document type's label (e.g. Impressum)"
    • changedInput schema / required
      Previous value: -[
      -  "site",
      -  "doc",
      -  "title",
      -  "sections"
      -]New value: +[
      +  "site",
      +  "doc",
      +  "sections"
      +]
  2. Addedv3.4.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden well: it discloses destructive full replacement, ordered sections, slug derivation, atomic post_content rewriting, and a concrete return value. It does not cover permissions or reversibility, but the critical mutation behavior is disclosed.

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?

The description is compact and front-loaded: the destructive whole-document replacement comes first, followed by operation details and the return shape. Every sentence adds useful information without waste.

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 full-document replacement tool with a fully described schema and no output schema, the definition explains the core behavior, replacement semantics, rendering assumptions, and return value. It could mention page creation or permission behavior, but the essential contract is complete.

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 doc, site, title, sections, heading, body, slug, and level. The description reinforces that sections are ordered and slugs derive from headings, but adds little beyond the schema's own field documentation.

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?

The description uses the specific verb "Replace" with a clearly scoped resource: a whole legal document, with every section not listed disappearing. This precisely distinguishes the tool from section-level siblings such as legal_add_section and legal_delete_section.

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?

The description makes the full-replacement condition explicit and warns that unlisted sections are gone, which signals when this tool is appropriate instead of partial edits. It does not name an alternative sibling directly, but the destructive full-document scope provides clear usage context.

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

Deploy Server

Other Tools