Skip to main content
Glama

Create Content

create_content

Create new content items in LightCMS using templates, with support for wikilinks, snippets, hashtags, and Markdown to build structured website pages.

Instructions

Create a new content item. Requires a template_id, title, slug, and the data fields defined by the template.

Workflow:

  1. Call list_templates to find the right template and its field names.

  2. Create the content with data matching those fields.

  3. Call publish_content to make it live (or set published=true here to do both in one step).

Set use_header=true, use_footer=true, use_theme=true for pages that should use the site layout. Always include version_comment to make history readable.

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 for collections
dataYesTemplate field values,required
folder_pathNoFolder path (e.g., /blog)
meta_descriptionNoSEO meta description
og_imageNoOpen Graph image URL
publishedNoPublish immediately
raw_modeNoUse raw HTML mode
slugYesURL slug for the content,required
tagsNoTags for lc:query index pages (e.g. ['AI & Machine Intelligence', 'Generative AI'])
template_idYesTemplate ID (MongoDB ObjectID),required
titleYesContent title,required
use_footerNoInclude site footer
use_headerNoInclude site header
use_themeNoApply site theme/layout
version_commentNoOptional comment describing this version

Implementation Reference

  • The handleEvent function processes chat events, including 'token' (streaming response) and 'sources' (retrieved context). It dynamically updates the UI to display the generated answer and links to sources.
    function handleEvent(evt) {
      if (evt.type === 'token' && evt.text) {
        rawAnswer += evt.text;
        ensureAnswer().innerHTML = renderMarkdown(rawAnswer);
        body.scrollTop = body.scrollHeight;
      } else if (evt.type === 'sources') {
        removeLoading();
        var results = evt.results || [];
        if (results.length === 0 && !answerEl) {
          body.innerHTML = '<p class="lc-no-results">No results found. Try rephrasing your question.</p>';
          return;
        }
        if (results.length > 0) {
          sourcesEl = document.createElement('div');
          sourcesEl.className = 'lc-sources';
          var html = '<div class="lc-sources-label">Sources</div>';
          for (var i = 0; i < results.length; i++) {
            var r = results[i];
            html += '<a class="lc-result" href="' + escHtml(r.url) + '">' +
              '<span class="lc-result-arrow">↗</span>' +
              '<span class="lc-result-title">' + escHtml(r.title) + '</span>' +
              '</a>';
          }
          sourcesEl.innerHTML = html;
          body.appendChild(sourcesEl);
          body.scrollTop = body.scrollHeight;
        }
      } else if (evt.type === 'done') {
        sendBtn.disabled = false;
        input.value = '';
        input.focus();
      }
    }
Behavior5/5

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

While annotations only indicate non-destructive behavior, the description extensively documents behavioral traits: wikilinks auto-update when paths change, Markdown converts to HTML at publish time, templates support {{.lc_toc}} injection, hashtags auto-tag pages, and version_comment affects history readability. This exceeds annotation coverage significantly.

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?

Well-structured with clear visual hierarchy: one-sentence summary, numbered workflow, specific parameter guidance, and rich markup documentation. While lengthy (appropriate for 15 parameters and complex templating behavior), every section serves distinct purposes without redundancy.

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?

Given the complexity (15 parameters, nested data object, rich markup features), the description comprehensively covers input requirements, workflow dependencies, and content processing behaviors. No output schema exists per context signals; the description appropriately focuses on creation mechanics rather than return values.

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?

With 100% schema coverage, baseline is 3. The description adds valuable context: template_id requires calling list_templates first, use_header/footer/theme control site layout wrapping, published=true combines creation with publishing, and version_comment is required for readable history. This elevates it above baseline.

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 opens with a clear, specific statement ('Create a new content item') and immediately distinguishes this from sibling tools by specifying required fields (template_id, title, slug, data) and contrasting with create_template, create_snippet, and create_collection.

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?

Provides an explicit numbered workflow (1. Call list_templates, 2. Create content, 3. Call publish_content) that establishes prerequisites and sequence. It explicitly names sibling tool publish_content as an alternative to using the published parameter, clarifying when to use each approach.

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

Install Server

Other Tools

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