Skip to main content
Glama

Add to collection

add_content_item
Idempotent

Create a new content_items row for a site under a given content_type slug — this is the RIGHT tool for adding any repeating detail page (/projects/<slug>, /blog/<slug>, /searches/<slug>, /publications/<slug>, /work/<slug>, /talks/<slug>, /teaching/<slug>, etc.) when the site already declares a matching collections[] entry. The row is written to the site's DRAFT version, so it shows on the index page's <collection-list> and its detail URL /<prefix>/<slug> in PREVIEW right away (via the collection's template + Mustache substitution); it goes public on the next publish. DO NOT use add_page for detail pages of an existing collection — that creates a static page that the index won't reflect and sitemap won't auto-emit.

IMAGES IN content: source them yourself with find_images or upload_image (with url) — that is the normal path and needs nothing from the person. An image-typed field holds an OBJECT: { "url": "https://…", "alt": "what is in the picture" }. A bare URL string is accepted and stored as { url }, but send alt when you can — it is the only description a screen reader gets, and the template may render it. Check the field's declared type with list_content_types before composing: a url-typed field takes the plain string instead. But if they want THEIR OWN picture on an item (their product shot, their photo of the venue), do not try to carry the file: create the item with the text, then give them get_editor_link with page_slug set to that item's path (e.g. 'blog/my-first-post') so they can drop the original straight onto it.

content is validated against the content_type's JSON schema (lenient/open): required fields must be present and non-empty, declared fields must match their type, extra fields are allowed. Include every field the collection's template references — missing fields render as empty strings in the detail page. visibility defaults to 'public' (anonymous-readable).

SLUG BEHAVIOR (idempotent): re-calling with the SAME slug + identical content is a safe no-op — it returns success with already_existed:true (no error), so a retried write after a dropped connection won't double-post. Re-using the same slug with DIFFERENT content is a real collision and throws ConflictError — pick another slug or use edit_content_item to change the existing row.

If the site doesn't yet have a matching collections[] entry, add one first via create_collection (composes the collections[] entry + optional index page + items[] in one call). Each site defines its own schemas inline at collections[i].fields — there is no global content-type catalog; what shapes exist for a site is whatever the site's draft_fixture declares.

Input Schema

NameRequiredDescriptionDefault
slugYesSingle-segment kebab-case slug (lowercase alphanumeric + dashes, no slashes, no leading/trailing dashes). The DB enforces this via a CHECK constraint; invalid slugs are rejected at insert time.
contentYes
site_idYes
visibilityNopublic
content_typeYes
published_atNoISO-8601 timestamp used as the item's `publishedAt` for ordering. Defaults to now if omitted (and left untouched if `content.publishedAt` is already set). Sort a collection-list newest-first with sortBy:'publishedAt', sortDir:'desc' — more reliable than created_at, which can tie on bulk/automated inserts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare non-readOnly, idempotent, non-destructive, closed-world, but the description adds substantive behavior beyond them: writes land in the DRAFT version and only go public on publish, idempotent retry semantics with the already_existed:true return, and ConflictError on slug reuse with different content. It also discloses validation leniency (required fields enforced, extra fields allowed, missing template fields render as empty strings) and the visibility default of public.

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 routing sentence and the add_page exclusion before any detail, which is the right order. It is long (~350 words) and the image paragraph is discursive, but each section — routing, images, validation, slug behavior, prerequisite — carries non-redundant information, so little is wasted.

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 mutation tool with no output schema and thin schema coverage, this is near-complete: it covers the draft/publish lifecycle, validation contract, error/retry behavior, prerequisite collection existence, and the return marker already_existed:true. The gaps are minor — site_id is never characterized and the full success payload shape is only hinted at.

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 schema coverage at 33%, the description must carry weight and largely does: content is explained as a JSON object validated against the content_type schema, image-typed fields are documented as {url, alt} objects versus url-typed plain strings, content_type is tied to a site's inline collections[].fields, and slug idempotency semantics are spelled out. site_id and published_at get no treatment in the description, leaving two of six parameters to the schema alone.

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?

States a precise verb+resource ('Create a new content_items row for a site under a given content_type slug') and enumerates the exact URL patterns it serves. It explicitly carves itself out from the sibling add_page, so an agent can route without opening either schema.

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?

Gives explicit when-to-use, an explicit when-NOT-to-use ('DO NOT use add_page for detail pages of an existing collection') with the reason (index won't reflect it, sitemap won't emit). It also names the correct alternatives in each branch: create_collection when no collections[] entry exists, edit_content_item on slug collision, find_images/upload_image for images, and get_editor_link for user-supplied files.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources