# update_paragraph

[MAINTENANCE] f978e588 — ID-addressable docx WRITE (the write counterpart of the get_element_by_id / paraId read primitive). Targets ONE paragraph in a stored .docx by its w14:paraId (the 'p{index}' fallback Word writes for an unlabelled paragraph) — NEVER by text match — rewrites its runs, saves the .docx in place, and re-syncs the doc_elements index row so it matches the new text. The document must already be stored in the doc-structure store via ingest_document (which registers a docx/latex document's structure here). Pass the SAME source/path you ingested under as doc. Provide EXACTLY ONE of: new_text (a plain string — one unformatted run) OR runs (a list of runs, each a bare string or {text, bold?, italic?, underline?} — basic run formatting is applied; the paragraph's original run formatting is replaced, not merged; its paragraph style/numbering is preserved). Returns {document_id, para_id, new_text, elements_resynced, source_path}. elements_resynced is 0 for a plain body paragraph (only headings are persisted as elements) — that is expected, not a failure. Errors (never a silent no-op) when the doc/source/para_id doesn't resolve. f7ee1ba7 — pass session_id to enable scoped-region claim enforcement: if another session has claimed the target para_id (or holds a whole-file lock), the write is REJECTED with error='docx_region_conflict'. Use claim_docx_region to acquire your region before writing. 5988a5bb — mandatory post-write verification now re-reads the file from disk and confirms the target paragraph's text actually landed before this ever reports success; on a rare verification failure the write is best-effort restored from backup and an error is returned instead. Response also now includes pre_counts/post_counts (the media/style/equation/relationship structural manifest from before and after the write). Three further OPT-IN parameters (each omitted by default, byte-identical behavior when omitted): expected_content_hash — a fail-closed precondition: if the source file's current on-disk content hash doesn't match, the write is REJECTED before anything is touched (get the current hash from a prior get_document_structure/get_structure staleness check). draft_output_path + wave_run_id (both-or-neither, with session_id also required) — writes to an ISOLATED draft path instead of the canonical file, claiming the paragraph as this wave's anchor via the real docx-merge manifest so a conflicting concurrent draft on the same paragraph is rejected; response carries draft_path/wave_run_id/ is_draft instead of elements_resynced (the canonical index is not touched until a merge). Persistent-state disclosure: on hosted Meridian, supplied text and project/session metadata are sent to and stored in Meridian's service; self-hosted deployments keep them in the configured local SQLite/Postgres database. This data is visible in the dashboard/API and later project context or handoffs. Delete individual tasks, notes, or decisions where supported, or delete the project/account using the documented controls. Do not include secrets.

Agent View of the PolicyLayer registry record for `update_paragraph`. HTML page: https://policylayer.com/tools/io-github-ajc3xc-meridian/update-paragraph

## Facts

- Tool: `update_paragraph`
- Server: Meridian (`@meridianmcp/mcp`) — https://policylayer.com/tools/io-github-ajc3xc-meridian.md
- Install: `npx -y @meridianmcp/mcp`
- Homepage: https://github.com/meridianmcp/Meridian
- Risk category: Write (Medium risk)
- Registry record: grade F, identity unverified
- Server auth posture: open
- Server CORS policy: *
- Server rate-limited: no
- Parameters: 10 (2 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `doc` | string | yes | The stored document's source (the path/URL you ingested it under via ingest_document, which registers a docx/latex document in the doc-structure store). |
| `runs` | array | no | List of runs — each a plain string or a {text, bold?, italic?, underline?} object. Provide this OR new_text, not both. |
| `para_id` | string | yes | The target paragraph's w14:paraId (or 'p{index}' fallback), as reported by the read side. |
| `new_text` | string | no | New paragraph text as a single unformatted run. Provide this OR runs, not both. |
| `project_id` | string | no |  |
| `session_id` | string | no | f7ee1ba7 — calling session id. When provided, scoped-region claim enforcement activates: the write is rejected if another session claims the target para_id or h |
| `wave_run_id` | string | no | 5988a5bb — the wave identifier scoping this draft's meridian.db.docx_merge manifest. Must be given together with draft_output_path and session_id. |
| `project_name` | string | no | Project name — an alternative to project_id; resolved to the id internally. project_id wins if both are given. |
| `draft_output_path` | string | no | 5988a5bb — opt-in wave-scoped draft mode: write to this isolated path instead of the canonical `doc`. Must be given together with wave_run_id and session_id; mu |
| `expected_content_hash` | string | no | 5988a5bb — opt-in fail-closed precondition: the write is rejected BEFORE touching the file if this doesn't match the source's CURRENT on-disk content hash. Omit |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_paragraph",
    "arguments": {
      "doc": "<doc>",
      "para_id": "<para_id>"
    }
  }
}
```

## Why update_paragraph is rated Medium

This tool creates or modifies data reversibly by updating paragraph content within a .docx document and saving it. While it modifies stored state, the changes are reversible (the original document can be re-modified or restored), making it Write rather than Destructive.

From the tool's own definition: "Tool description explicitly states 'WRITE' and describes 'rewrites its runs, saves the .docx in place, and re-syncs the doc_elements index row'. The operation modifies and persists content in a stored document."

Risk signals: High parameter count (10 properties)

## Use case

AI agents use update_paragraph to create or update resources in Meridian, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Meridian environment.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Meridian:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "update_paragraph": {
      "limits": [
        {
          "counter": "update_paragraph_rate",
          "window": "minute",
          "max": 30,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Meridian (174)

- `archive_decision` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/archive-decision.md
- `batch_mutate` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/batch-mutate.md
- `claim_sprint_item` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/claim-sprint-item.md
- `clear_capability_profile` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/clear-capability-profile.md
- `clone_profile_layer` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/clone-profile-layer.md
- `delete_custom_hook` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/delete-custom-hook.md
- `delete_note` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/delete-note.md
- `delete_sprint_item_pointer` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/delete-sprint-item-pointer.md
- `fan_out_sprint_items` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/fan-out-sprint-items.md
- `purge_ai_log` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/purge-ai-log.md
- `record_handoff_correction` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/record-handoff-correction.md
- `release_docx_region_claims` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/release-docx-region-claims.md
- `request_hitl` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/request-hitl.md
- `reset_plugin_override` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/reset-plugin-override.md
- `reset_profile_layer` — Destructive — https://policylayer.com/tools/io-github-ajc3xc-meridian/reset-profile-layer.md
- `complete_wave_gate` — Execute — https://policylayer.com/tools/io-github-ajc3xc-meridian/complete-wave-gate.md
- `execute_batch` — Execute — https://policylayer.com/tools/io-github-ajc3xc-meridian/execute-batch.md
- `prospect_symbol` — Execute — https://policylayer.com/tools/io-github-ajc3xc-meridian/prospect-symbol.md
- `run_verification` — Execute — https://policylayer.com/tools/io-github-ajc3xc-meridian/run-verification.md
- `start_session` — Execute — https://policylayer.com/tools/io-github-ajc3xc-meridian/start-session.md
- `analyze_model_efficiency` — Read — https://policylayer.com/tools/io-github-ajc3xc-meridian/analyze-model-efficiency.md
- `analyze_sprint` — Read — https://policylayer.com/tools/io-github-ajc3xc-meridian/analyze-sprint.md
- `batch_read` — Read — https://policylayer.com/tools/io-github-ajc3xc-meridian/batch-read.md
- `find_outputs_by_source` — Read — https://policylayer.com/tools/io-github-ajc3xc-meridian/find-outputs-by-source.md
- `find_similar_equation` — Read — https://policylayer.com/tools/io-github-ajc3xc-meridian/find-similar-equation.md
- `find_similar_figure` — Read — https://policylayer.com/tools/io-github-ajc3xc-meridian/find-similar-figure.md
- `find_similar_table` — Read — https://policylayer.com/tools/io-github-ajc3xc-meridian/find-similar-table.md
- `find_symbol_usages` — Read — https://policylayer.com/tools/io-github-ajc3xc-meridian/find-symbol-usages.md
- `get_agent_instructions` — Read — https://policylayer.com/tools/io-github-ajc3xc-meridian/get-agent-instructions.md
- `get_blog_posts` — Read — https://policylayer.com/tools/io-github-ajc3xc-meridian/get-blog-posts.md
- …and 144 more: https://policylayer.com/tools/io-github-ajc3xc-meridian.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=io-github-ajc3xc-meridian · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/io-github-ajc3xc-meridian
