Skip to main content
Glama
Antonytm

mcp-sitecore-server

by Antonytm

add-rendering-to-placeholder

Add a rendering to a placeholder while validating it against the placeholder's allow-list, assigning a collision-free dynamic placeholder ID and returning the child placeholder path.

Instructions

Adds a rendering to a placeholder on a page, refusing it when the placeholder's settings do not allow that component (the allow-list is named in the error). This is the tool to compose a page with: presentation-add-rendering writes whatever it is told, and an invalid layout still saves and renders. Assigns a collision-free DynamicPlaceholderId when the rendering's parameters template defines one, and writes the full parameter set the template declares. Returns the placeholder path a child rendering should target, so a nested build is one call per level. Pass force=true to skip validation for migration or repair work. Read the guide://compose-page resource for the order to run the composition tools in, and for the dynamic placeholder, splitter and GridParameters cases that silently produce a broken page when guessed at.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoThe full path of the item, database prefix optional (e.g. master:/sitecore/content/Stride/Cova/Home or /sitecore/content/Stride/Cova/Home). Supply this or pageId.
forceNoSkip the placeholder-settings check and add the rendering anyway. For migration and repair work that legitimately has to write a layout the current settings forbid. The rendering item must still exist.
indexNoPosition to insert at within the placeholder. Appends by default.
pageIdNoThe ID of the page item (e.g. {110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}). Supply this or path.
projectNoOverrides the folder searched under /sitecore/layout/Placeholder Settings/Project. Defaults to the project (tenant) folder of the site the item belongs to, and falls back to the whole global Placeholder Settings tree.
databaseNoThe database to read. Defaults to master, and is ignored when path carries its own prefix.
languageNoThe item language. Defaults to the context language.
dataSourceNoThe rendering's datasource. Use the local:/Data/<name> form for a page-local datasource, or an item ID for a shared one — create-component-datasource returns the correct form in DatasourceReference.
parametersNoValues for the rendering's parameters, keyed by parameter name (e.g. {'GridParameters': '{F38CFEF8-...}'}). Every key the parameters template defines is written whether or not it appears here; these are the ones that get a value. Names not defined by the template are rejected rather than written.
finalLayoutNoWhich layout to write. Defaults to true (the final layout), which is where authored pages carry their renderings. Set false to write the shared layout.
placeholderYesThe placeholder to add the rendering to. The placeholder to resolve. Accepts a bare key ('headless-main', 'container', 'container-{*}') or a full runtime placeholder path ('/headless-main/page-section-1/container-2'), in which case the leaf segment is matched — including against the wildcard keys dynamic placeholders use. Use the exact runtime path for a nested placeholder — that is what gets written to the layout.
renderingIdNoID of the rendering definition item (e.g. {AD10DB7C-C944-42D9-9563-1F1070CC922E}). Supply this or renderingPath.
renderingPathNoPath of the rendering definition item (e.g. /sitecore/layout/Renderings/Project/Stride/RichText). Supply this or renderingId.
dynamicPlaceholderIdNoForce a specific DynamicPlaceholderId instead of the scanned max+1. Only use this to reproduce an exact layout; a colliding ID silently merges two placeholders.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.5

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only carry readOnlyHint=false/destructiveHint=false, so the description must carry the rest and does: validation refusal with the allow-list named in the error, collision-free DynamicPlaceholderId assignment, template-driven parameter writing, force bypassing validation, and the return of the placeholder path for nested builds. It even flags the silent-breakage cases.

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 primary action and sibling contrast, then layers in behavior. Every sentence carries signal, though the final guide pointer and the parameter-adjacent details make it long enough to be dense on first read.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 14-parameter mutation tool with no output schema, the description covers validation behavior, override path, return value semantics (placeholder path for the child call), and the resource to consult for the tricky nested/dynamic cases. Nothing an agent needs to invoke it correctly is missing.

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 the baseline is 3, but the description contributes behavior beyond field-level docs: force skips the settings check yet still requires the rendering item to exist, and dynamicPlaceholderId overrides the scanned max+1 with a warning about silent merging. These are consequences of parameter values, not just restatements.

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 ('Adds a rendering to a placeholder on a page') and immediately contrasts it with the sibling presentation-add-rendering, explaining why this tool is the one to use for composition. The scope (single rendering into a placeholder, one call per nesting level) is unambiguous.

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?

Explicitly names the alternative (presentation-add-rendering writes whatever it is told), gives the force=true migration/repair exception, and points to guide://compose-page for ordering of the composition tools. When-to-use and when-to-override are both covered.

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

Deploy Server

Other Tools