Skip to main content
Glama

contentrain_content_save

Destructive

Save content entries for dictionaries, collections, documents, and singletons using model-specific fields, including locale, markdown, and media paths; changes auto-commit to git.

Instructions

Save content entries. Entry format varies by model kind: DICTIONARY — provide "locale" and "data" (flat key-value, all string values); "id" and "slug" are ignored; data keys are the identities. COLLECTION — provide "locale" and "data"; "id" is optional (auto-generated if omitted); "slug" is ignored. DOCUMENT — provide "slug" (required), "locale", and "data"; use the "body" key inside data for markdown content. SINGLETON — provide only "locale" and "data". MEDIA FIELDS (image/video/file): for a media-library asset, pass its storage path ("media/...") or URL; in cloud mode these are automatically normalized to absolute public delivery URLs on save (in markdown bodies too), so saved content renders in a browser anywhere with no SDK — in local mode the relative path is kept as-is. For external images (e.g. a CDN or Unsplash URL), pass the URL directly; it is saved untouched. Changes are auto-committed to git — do NOT manually edit .contentrain/ files after calling this tool.

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": {
      "model": "<model>",
      "entries": "<entries>"
    },
    "name": "contentrain_content_save"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYesModel ID
entriesYesContent entries to save

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.63
    • changedInput schema / properties / entries / items / properties / publish_at / description
      Previous value: -"Scheduled publish date, ISO 8601. Stored in meta only — never in the content file — and it does NOT change status: a draft stays a draft, and a published entry is delivered only once this date has passed. Publish with contentrain_bulk update_status. Pass null to clear a previously set date; omit to leave it unchanged."New value: +"Scheduled publish date, ISO 8601. Stored in meta only — never in the content file — and it does NOT change status: a draft stays a draft, and a published entry is delivered only once this date has passed. Publish with contentrain_content_status. Pass null to clear a previously set date; omit to leave it unchanged."
  2. Changed4 schema fields changedv1.0.33
    • changedInput schema / properties / entries / items / properties / expire_at / description
      Previous value: -"ISO 8601 date for scheduled expiry (stored in meta, must be after publish_at)"New value: +"Scheduled expiry, ISO 8601, must be after publish_at. Same rules as publish_at: meta only, never changes status, null clears, omit leaves unchanged."
    • changedInput schema / properties / entries / items / properties / expire_at / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedInput schema / properties / entries / items / properties / publish_at / description
      Previous value: -"ISO 8601 date for scheduled publishing (stored in meta)"New value: +"Scheduled publish date, ISO 8601. Stored in meta only — never in the content file — and it does NOT change status: a draft stays a draft, and a published entry is delivered only once this date has passed. Publish with contentrain_bulk update_status. Pass null to clear a previously set date; omit to leave it unchanged."
    • changedInput schema / properties / entries / items / properties / publish_at / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
  3. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already flag destructive=true and idempotent=false, so the safety bar is partly covered. The description adds substantial context the annotations cannot carry: automatic git commit, a warning not to hand-edit .contentrain/ files, and cloud-vs-local media path normalization. It stops short of stating what happens to an existing entry when the same id/slug is saved again — a notable omission for a destructive tool.

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-loaded with the core action, then cleanly segmented by model kind and by media handling; each segment carries information an agent needs to construct a valid entry. The media paragraph is long but earns its length given cloud/local divergence. Slightly dense as a single unbroken block.

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 destructive, non-idempotent write tool with no output schema, the description covers entry shape, media normalization, and side effects (git commit). The remaining gap is overwrite/upsert semantics and error behavior on validation failure, which an agent would need before re-saving an existing entry.

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 would be 3, but the description adds real constraints beyond the schema: which fields are ignored per model kind, that data must be flat string key-values for dictionaries, and that documents carry markdown under the "body" key. Only the media-path handling is duplicated loosely with schema wording.

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 ("Save content entries") and immediately branches into a per-model-kind contract (DICTIONARY/COLLECTION/DOCUMENT/SINGLETON) that makes the tool's scope concrete. It also names a sibling, contentrain_content_status, as the path for publishing. It doesn't fully disambiguate from other write-oriented siblings like content_merge or content_bulk, so not a 5.

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 clear per-kind usage rules — what to supply, what is ignored, and which alternative handles status changes ("Publish with contentrain_content_status"). Missing explicit when-not-to-use guidance relative to content_merge/content_bulk/apply, so routing between write tools still requires inference.

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