Skip to main content
Glama

update_content

Modify existing content items in LightCMS by updating specific fields, preserving unchanged data, and automatically creating version history for tracking changes.

Instructions

Update an existing content item by ID. Creates a new version automatically. Only send fields you want to change.

For partial data updates, only the keys you include in "data" are changed — existing keys are preserved (merge semantics). Use clear_fields: ["field1", "field2"] to explicitly set fields to empty string. Set dry_run: true to validate the update without saving. To update by URL path instead of ID, use update_content_by_path. Always include version_comment so the version history is useful.

Up to 20 concurrent update_content calls are safe. For larger batches (>20 items), prefer bulk_update_content instead.

Example: {"id": "abc123", "data": {"body": "Updated text"}, "version_comment": "Revised intro paragraph"}

Content data fields support rich markup features:

  • [[Wikilinks]] and [[Page Title|display text]] — link to other pages by title or path; auto-update when paths change

  • [[include:snippet-name]] — embed a named snippet inline (reusable callouts, CTAs, disclaimers)

  • #hashtags — mention #tagname anywhere to automatically tag the page

  • Markdown fields (type "markdown") — GitHub Flavored Markdown converted to HTML at publish time Templates can use {{.lc_toc}} in their HTML layout to inject an auto-generated table of contents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoContent category
clear_fieldsNoField names to clear to empty string (removes ambiguity about how to delete field content)
dataNoTemplate field values
dry_runNoIf true, validate the update without saving
folder_pathNoFolder path
idYesContent ID (MongoDB ObjectID),required
meta_descriptionNoSEO meta description
og_imageNoOpen Graph image URL
raw_modeNoUse raw HTML mode
set_raw_modeNoSet to true to explicitly update raw_mode (needed to set it to false)
set_use_footerNoSet to true to explicitly update use_footer (needed to set it to false)
set_use_headerNoSet to true to explicitly update use_header (needed to set it to false)
set_use_themeNoSet to true to explicitly update use_theme (needed to set it to false)
slugNoURL slug
tagsNoTags for lc:query index pages
template_idNoTemplate ID (MongoDB ObjectID)
titleNoContent title
use_footerNoInclude site footer
use_headerNoInclude site header
use_themeNoApply site theme/layout
version_commentNoOptional comment describing this version change

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jonradoff/lightcms'

If you have feedback or need assistance with the MCP directory API, please join our Discord server