Add Custom CSS
helpcenter_add_template_cssAdd a labelled block of custom CSS to the design, to restyle components, regions or the whole help center beyond what the settings offer.
It edits the help center's design DRAFT (its v2 template): the draft the dashboard's Template Editor opens, with a live preview. Nothing reaches visitors until helpcenter_publish_template — after editing, give the customer the Template Editor link from the result to review, and publish only when they ask. v2 help centers only (a classic one answers template_migration_required). Ids come from helpcenter_get_template.
The CSS is scoped to the help center automatically. Target one component with [data-hc-instance-id=""] and every component of a type with [data-hc-component-type="Hero"]; the guide's 'css' topic (helpcenter_get_template_guide) lists the other hooks. Use var(--hc-color-*) rather than literal colours so dark mode keeps working, and keep text at 4.5:1 contrast: on a primary-coloured band, set text and links to var(--hc-color-on-primary). Blocks apply in order and a later one wins, so override a theme's CSS with a block of your own rather than editing the theme's. @import and javascript: URLs are stripped. This is the guide's add_css operation.
Args:
css (string): the CSS.
label (string, optional): e.g. 'Cards · hover lift'.
enabled (boolean, optional): default true.
index (integer, optional): position among the blocks; omit to append.
id (string, optional): an id of your choosing.
etag (string, optional): from your last read or edit; refuses (stale_draft) if the draft changed since.
Returns: what each entry did (new ids), warnings worth relaying, and the draft status with its new etag.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"css": "<css>"
},
"name": "helpcenter_add_template_css"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Optional id of your choosing for the block. Omit and one is generated (and returned). | |
| css | Yes | The CSS. Scoped to the help center automatically; see the guide's 'css' topic. | |
| etag | No | Optimistic lock: the draft etag from your last read, or the one your last edit returned. When given, the call is refused (stale_draft) if someone changed the draft since — so you never build on a state you have not seen. Omit to apply to the current draft. | |
| index | No | 0-based position among the CSS blocks (they apply in order). Omit to append. | |
| label | No | A name for the block, e.g. 'Cards · hover lift'. | |
| enabled | No | false keeps the block without applying it. Default true. | |
| site_id | No | Which help center to act on: an id from helpcenter_list_sites. Needed when this connection reaches more than one help center; omit it when it reaches one. Applies to this call only — pass it on every call of a task, and ask the user which help center they mean if their request does not say. |