Skip to content

Agent tools

The Tool API tools of the Sites modules. An MCP server exposes them to AI agents; see AI agent tools.

sites:assign_content

Assign content to a site. Adds an entity to a site. The first site an entity gets is its canonical site; "canonical" makes this site the canonical site, which needs update access to the entity. Single-site content goes to one site only.

Input Type Required Description
entity entity yes The saved entity to assign.
site_id string yes The machine name of the site.
canonical boolean Whether the site becomes the entity's canonical (owning) site.

sites:current_site

Get current site. The site this request or process runs on: id, label, whether it is the hub, base URL, the content bundles it accepts, and its settings.

sites:entity_access

Check entity access. Whether you may view, update or delete an entity in the current site context, and the reason when the sites it belongs to refuse it. Ask before an edit that might be refused: content is edited on its canonical site, other sites change it through site overrides.

Input Type Required Description
entity entity yes The entity to ask about.
operation string yes The entity operation: view, update or delete.

sites:entity_sites

Get the sites of an entity. The sites an entity belongs to and its canonical site, as an entity form names them: the canonical site and the sites you manage content on. An entity without sites is unassigned; "other_sites" counts the sites it belongs to that are not yours to see.

Input Type Required Description
entity entity yes The entity to look up.

sites:site_arrange

Arrange a site. For platform administrators: sets a site's weight, its position among its sibling sites in lists (lower comes first). It does not move a site between main site and sub-site or to another main site.

Input Type Required Description
site_id string yes The machine name of the site.
weight integer yes The position among its siblings; lighter sites come first.

sites:site_config_override_set

Set a site configuration override. For platform administrators: overrides values of a configuration object for one site, or withdraws the override when no data is given. The data is a partial tree of the object, checked against its schema. Configuration a site setting owns is changed with sites:site_settings_set instead; a role's permissions are granted through per-site roles.

Input Type Required Description
site_id string The machine name of the site; the current site when empty.
name string yes The configuration object, e.g. system.performance.
data map The overriding values as a partial tree of the object; empty withdraws the override.
langcode string Override for one language; for every language when empty.
environment string Override for one environment; for every environment when empty.

sites:site_config_overrides

Get site configuration overrides. The configuration a site overrides, for platform administrators: per configuration object the overriding data, and whether a site setting owns it (such an override is changed with sites:site_settings_set).

Input Type Required Description
site_id string The machine name of the site; the current site when empty.
langcode string The overrides of one language; those every language shares when empty.
environment string The overrides of one environment; those every environment inherits when empty.

sites:site_create

Create a site. For platform administrators: creates a site. A main site answers on its own hostname; a sub-site lives under a main site at a path prefix. The new site is disabled: set it up, then put it in service with sites:site_set_enabled.

Input Type Required Description
site_id string yes The machine name: lowercase letters, digits and underscores. It does not change later.
label string yes The name of the site.
hostname string The hostname of a main site, e.g. acme.example.com.
main_site_id string For a sub-site: the main site it lives under.
prefix string For a sub-site: its path under the main site, e.g. jobs.
site_type string The site type; not needed when the platform has one.

sites:site_delete

Delete a site. For platform administrators: deletes a site for good; its settings, roles and memberships go with it. Say what becomes of its content: "detach" keeps all content, no longer belonging to the site; "reassign" moves the content that belongs only to this site to another site; "delete" deletes the content that belongs only to this site, which cannot be undone and has to be confirmed. Content shared with other sites always stays, and user accounts are never deleted. A site with sub-sites is not deleted.

Input Type Required Description
site_id string yes The machine name of the site.
content string yes What becomes of the content: detach, reassign or delete.
reassign_to string With "reassign": the site taking over the content.
confirm_delete_content boolean With "delete": true to confirm that the content belonging only to this site is deleted for good.

sites:site_list

List sites. The sites the current account reaches: on a site host the active site, on the hub the sites the account manages.

sites:site_member_roles_set

Set site member roles. Hands roles on a site to one of its people, or takes them away. You only ever change the roles sites:site_members names as assignable; other roles the person holds stay. "set" replaces the assignable roles with the ones given, "add" and "remove" change them.

Input Type Required Description
site_id string The machine name of the site; the current site when empty.
user_id integer yes The id of the person.
roles list The role ids.
mode string yes One of set, add and remove.

sites:site_members

Get site members. The people of a site whose members you manage (its content members and role holders) with the roles each holds there, and the roles you may hand out. A person is added to a site with sites:assign_content (the user as the entity).

Input Type Required Description
site_id string The machine name of the site; the current site when empty.

sites:site_set_enabled

Enable or disable a site. Enables or disables a site whose settings you manage. A disabled site keeps its content and settings but stops answering on its hostname.

Input Type Required Description
site_id string yes The machine name of the site.
enabled boolean yes True to enable the site, false to disable it.

sites:site_settings

Get site settings. The settings of a site you administer, per setting group: the effective value of every setting and which of them the site sets itself (the others are inherited). Read this before changing a setting; values are changed in the shape shown here.

Input Type Required Description
site_id string The machine name of the site; the current site when empty.
group string One setting group (e.g. system_site, appearance, content); every group you may read when empty.
langcode string A translation of the settings; the values every language shares when empty.
environment string An environment's values; the values every environment inherits when empty.

sites:site_settings_set

Set site settings. Changes settings of one setting group of a site you administer. Pass only the settings to change, in the shape sites:site_settings shows them; a setting given the value it would inherit follows its base again. Refused with the reasons when a value is not valid.

Input Type Required Description
site_id string The machine name of the site; the current site when empty.
group string yes The setting group (e.g. system_site, appearance, content).
values map yes The values to change, keyed by setting key.
langcode string The translation to change; the values every language shares when empty.
environment string The environment to change; the values every environment inherits when empty.

sites:unassign_content

Remove content from a site. Removes an entity from a site. Content cannot be removed from its canonical (owning) site: move the canonical site first with sites:assign_content. A user account can leave its canonical site; another of its sites becomes canonical.

Input Type Required Description
entity entity yes The entity to remove from the site.
site_id string yes The machine name of the site.

sites_clone:site_clone

Sites: clone site. For platform administrators: creates a new site from an existing one: its settings, and its content the way the source site says each kind is cloned (override it per content key with "methods"). The clone starts disabled; enable it once it is set up. A main site takes a hostname, a sub-site a main site and a path prefix.

Input Type Required Description
source_site_id string yes The site to clone.
site_id string yes The clone's machine name: lowercase letters, digits and underscores.
label string yes The clone's name.
hostname string The hostname of a main site.
main_site_id string For a sub-site: the main site it lives under.
prefix string For a sub-site: its path under the main site.
languages list The langcodes the clone speaks, among the source's; the source's when empty. The source's default language always stays.
default_language string The clone's default language, one of its languages; the source's when empty.
methods map Clone method ids keyed by content key, e.g. {"node:page": "clone_content"}; a key not named follows the source site.
clone_menus boolean Whether the links of the source's own menus are copied; the source site's cloning rules decide when left out.

sites_content_overrides:override_read

Sites: read override. What a site overrides of an entity: the pinned fields with the site's values, pinned paragraph fields, the per-site aspects (URL alias, menu link, sitemap settings) with their values, the fields that can be overridden, and the item keys sites_content_overrides:override_revert takes. The canonical site has no override; it edits the entity itself.

Input Type Required Description
entity entity yes The entity.
site_id string yes The machine name of the site.
langcode string The translation to read; the entity's own language when empty. Pins are per language.

sites_content_overrides:override_revert

Sites: revert override. Makes a site follow the canonical entity again, as the site's revert form does: the given item keys (from the revertable map of sites_content_overrides:override_read: field:NAME, nested:PATH, or an aspect id), or everything when none are given. The revision history is kept.

Input Type Required Description
entity entity yes The entity.
site_id string yes The machine name of the site.
langcode string The translation whose pins are reverted; the entity's own language when empty.
items list Item keys to revert; empty reverts everything the site overrides in this language.

sites_content_overrides:override_set

Sites: set override. Changes what one site shows of an entity without changing the entity for other sites, as the site's override form does. Fields: values keyed by field name (see sites_content_overrides:override_read for the overridable ones); every field that then differs from the canonical entity stays pinned for the site. Aspects: per-site data keyed by aspect id, e.g. sites_pathauto_alias {alias} or {automatic: true}, sites_menu_link {menu, title, parent, weight, description}, sites_simple_sitemap_settings {index, priority, changefreq, include_images}. Not on the entity's canonical site.

Input Type Required Description
entity entity yes The entity.
site_id string yes The machine name of the site.
langcode string The translation to override; the entity's own language when empty.
fields map Field values keyed by field name, as the entity takes them.
aspects map Aspect values keyed by aspect id.

sites_menu:menu_label_set

Set a site menu label. Gives one of a site's own menus a label that is shown on that site instead of the shared one; an empty label returns to the shared label.

Input Type Required Description
site_id string The machine name of the site; the current site when empty.
menu string yes The id of the menu, e.g. main.
label string The label on this site; empty for the shared label.

sites_menu:site_menus

List site menus. The menus a site has its own version of, for whoever manages the site's menus: the shared label, the label the site gives the menu, and the menu name its links are filed under. Use that menu name when creating a menu link for the site.

Input Type Required Description
site_id string The machine name of the site; the current site when empty.

sites_path_alias:alias_create

Create a URL alias. Gives a system path an alias on the sites whose URL aliases you manage: one alias per site, each applying on that site alone. Refused when the alias is already in use on a site. The alias of content a site shows under its own address is a site override instead (sites_content_overrides:override_set, aspect sites_pathauto_alias).

Input Type Required Description
path string yes The path that gets the alias, e.g. /node/5.
alias string yes The alias, starting with a slash, e.g. /about.
site_ids list The sites to create the alias on; the current site when empty.
langcode string The language the alias applies to; every language when empty.

sites_redirect:redirect_create

Sites: create redirect. Redirects a path on the sites whose redirects you manage: one redirect per site, each applying on that site alone. Refused when the path is already redirected on a site.

Input Type Required Description
source string yes The path to redirect, e.g. old-page or old-page?tab=1.
destination string yes Where it leads: a path starting with a slash (e.g. /node/5) or a URL.
site_ids list The sites to file the redirect on; the current site when empty.
langcode string The language the redirect applies to; every language when empty.
status_code integer The HTTP status code; the platform's default for redirects when empty.