MCP banner payloads
Audience: Developer.
MCP banner tools use the CMS field names for create and update mutations.
packages/shared/src/util/BannerFieldRegistry.ts defines the field contract.
Import this metadata from @haendlerapp/shared/server. Keep it out of the public shared entry.
For MCP authentication and token generation, see MCP Authentication.
Two components use VISIBLE_BANNER_FIELDS_BY_TYPENAME as the field authority:
- The Keystone Admin UI reads each field
nameto select the visible fields for atypename. - The MCP information endpoint supplies the complete field descriptor. AI callers use it to construct correct
payloadobjects.
If the host has not supplied the MCP capability document in model context, clients call cms.information.get first.
They then call cms.banners.create or cms.banners.update.
For repository changes, use Add a banner type. Update field descriptors before you change CMS visibility or MCP instructions.
Information payload
The MCP information response exposes banner metadata under structures.bannerTypeSystem.
bannerTypeSystem: {
allowedTypenames: Array<BannerTypename>;
defaultVisibleFieldNames: Array<string>;
relationshipWrappers: Array<BannerRelationMutationContract>;
byTypename: Array<{
typename: BannerTypename;
visibleFieldNames: Array<string>;
requiredFieldNames: Array<string>;
fields: Array<BannerVisibleFieldDefinition>;
}>;
}Use byTypename[*].fields as the practical payload guide for cms.banners.create and cms.banners.update.
Field descriptor
Each visible banner field uses a BannerVisibleFieldDefinition descriptor.
type BannerVisibleFieldDefinition = {
name: string;
type: BannerFieldType;
requiredForCreate: boolean;
autoManaged: boolean;
enumValues?: Array<string>;
relationshipWrapper?: 'oneToOne' | 'oneToMany';
amount?: number | null;
min?: number;
actions?: readonly BannerButtonAction[];
hints: Array<string>;
};Fields
The exact schema field name accepted by cms.banners.create and cms.banners.update.
Use the CMS field name, not the resolved frontend property name. For example, GridWrapper create and update payloads use gridFullWidth. The rendered banner uses fullWidth.
The simplified payload type used by MCP clients.
Common values:
stringstring_arraybooleanintegerenumenum_arrayjsonjson_arrayquery_paramsrichtextrelation_onerelation_manyorder_entries
Identifies fields to supply for valid creation.
The CMS uses this flag for required-field validation. MCP callers use it to select fields. It can identify validation rules or rendering requirements. For example, the CMS can save a PricingBanner without name or price. The backend then excludes it during hydration.
Identifies fields that CMS or Admin UI ordering usually maintains.
Examples:
heroSlidesOrderstepsItemsOrdergridLeftBannersOrdergridRightBannersOrderproductComparisonVehiclesOrder
MCP creation or updates can require these fields. For nested content, the backend often resolves children from the order field, not the raw relationship field.
Lists exact accepted values for enum-like fields.
Copy schema values, not translated labels. For example, gridColumnsWidth uses FIFTY_FIFTY, SIXTY_FORTY, and FORTY_SIXTY.
Marks relation fields that need Keystone nested mutation wrappers.
MCP tools do not automatically wrap relation values. Send the explicit structure from bannerTypeSystem.relationshipWrappers.
// oneToOne connect
imageBlock: {
connect: {
id: 'image-id';
}
}
// oneToMany connect
images: {
connect: [{ id: 'image-id-1' }, { id: 'image-id-2' }];
}Button groups
Buttons use the required shared group format. CMS payloads contain resource IDs. Public responses contain resolved links, forms, and themes. Create the resource first, then use its ID in the group.
Minimum number of items in a button group. Complete required actions before saving.
Maximum number of items. Null means no maximum.
Actions permitted for this owner and group field.
buttons: {
items: [{
id: 'offers',
action: 'link',
text: 'View offers',
ctaLinkId: 'link-id',
contactFormId: null,
themeId: null,
style: 'primary',
}],
align: 'left',
width: 'intrinsic',
overflow: 'wrap',
}Nested HeroSlide payloads use buttons. Supply a complete group, including an explicit empty
items array where zero actions are permitted. Unsupported or incomplete group
values are rejected.
Use hints for behavior that is important but not obvious from the schema type.
Use hints for these cases:
- The CMS saves an empty field, but the backend excludes the banner as invalid.
- A relation update adds values instead of replacing them.
- A field requires a specific document structure, such as Lexical rich text.
- A field and its order field must stay synchronized.
Some CMS GraphQL fields require text, including values that represent numbers.
Treat imageBlockMaxHeight as a string field. Use values such as "520" or "520px", including when the value represents a height.
Relation update behavior
Relationship fields follow Keystone nested mutation semantics.
createadds new related records.connectattaches existing related records.disconnectremoves specific existing relations.- For many-relations,
createandconnectadd records to the relation set. They replace records only when the field explicitly supports replacement.
Updating a button group replaces the complete group value. Array order is the
action order. To remove an action, submit the remaining items. A LinkRowBanner
accepts only link actions; its group does not use relation mutation wrappers.
Order fields
Some banners render nested records from an order field.
For GridWrapper, setting only gridLeftBanners and gridRightBanners does not supply all data for rendering.
The backend resolves leftColumn and rightColumn from:
gridLeftBannersOrdergridRightBannersOrder
Use typed order entries for nested banners:
gridLeftBanners: {
connect: [{ id: 'textblock-a' }, { id: 'textblock-b' }],
},
gridLeftBannersOrder: [
{ id: 'textblock-a', typename: 'Textblock' },
{ id: 'textblock-b', typename: 'Textblock' },
],The same pattern applies to other order_entries fields. Keep the relationship field and order field synchronized when you write through MCP.
Rich text fields
cms.information.get supplies the shared rich-text contract once under structures.bannerTypeSystem.fieldFormats.richtext.
Banner fields such as markdownBlocks reference this contract through their richtext type.
Send Lexical-style document nodes or JSON-stringified document arrays.
markdownBlocks: [
{
type: 'heading',
level: 1,
children: [{ text: 'Hello world' }],
},
{
type: 'paragraph',
children: [
{ text: 'Visible banner text with ' },
{ text: 'bold emphasis', bold: true },
{ text: '.' },
],
},
];Use heading with level: 1 through 6 for headings. Use paragraph for body text.
Apply text formatting to child text nodes, for example bold: true, italic: true, or underline: true.
The tools do not convert plain Markdown strings to rich text. Send document nodes or JSON-stringified document arrays. Treat unsupported plain-string Markdown payloads as invalid input.
Archive query fields
query_params fields accept archive filter pairs and archive sorting presets.
Canonical shape:
query: [
{ key: 'BRAND', value: 'BMW' },
{ key: 'PRICE_MIN', value: '1000' },
{ key: 'sort', value: 'CREATED_AT' },
{ key: 'order', value: 'DESC' },
];Use the serialized enum values from SortOption and OrderOption, for
example CREATED_AT, OPRICE, NAME, ASC, and DESC.
The MCP payload normalizer also accepts shorthand strings like ['BRAND:BMW'] for archive banners. Use the canonical shape shown above in examples.
For authentication, use user-token setup or the OAuth contract. For repository field additions, use the banner development procedure.