Tool reference

Every tool, and what it is allowed to do

This page is generated from the plugin's own tool registry, the same source the endpoint uses. The access class next to each tool is the one the server enforces, not a description written by hand.

read-only changes nothing. writes changes state. administrator needs the mapped user to be an administrator. off by default has to be switched on in the settings before it runs at all.

A token's scope narrows this further: read reaches only the read-only tools without the administrator ones, content adds entries, drafts, categories and globals, full reaches everything the mapped user may do. See scopes.

Entries 5 tools

ToolWhat it doesAccess
craft_create_entry
Create entry
Create an entry in a section. Needs the section handle and a title; slug, status, post date, author and custom fields are optional. Craft validates before saving, and a failed validation is reported field by field rather than as a bare failure.writes off by default
craft_delete_entry
Delete entry
Move an entry to the trash. Craft keeps it recoverable; pass hard=true to remove it for good, which cannot be undone.writes off by default
craft_get_entry
Get entry
One entry with its custom field values. Address it by id, uid or slug; with a slug, name the section as well when several sections may hold that slug.read-only
craft_list_entries
List entries
List entries, newest first by default. Filter by section handle, entry status or site. Only sections the mapped user may view are searched, so an unknown or forbidden section yields an empty list rather than an error.read-only
craft_update_entry
Update entry
Change an existing entry. Only the fields you pass are touched; everything else keeps its value.writes off by default

Drafts 4 tools

ToolWhat it doesAccess
craft_apply_draft
Apply draft
Apply a draft to its entry: the canonical entry takes the draft’s content, and the draft is gone afterwards. Refused unless the mapped user may save the canonical entry — being allowed to edit the draft is not enough.writes off by default
craft_create_draft
Create draft
Create a draft of an existing entry. Needs entryId or entryUid; name and notes are optional. The draft starts as a copy of the entry and changes nothing about it, which is why viewing the entry is enough — Craft’s own rule. This build cannot write content into the draft afterwards.writes off by default
craft_discard_draft
Discard draft
Discard a draft. A draft is not trashed — it is removed for good, and this cannot be undone. The canonical entry is left untouched.writes off by default
craft_list_drafts
List drafts
List entry drafts: named drafts and, on request, the control panel’s provisional working copies. Narrow to one entry with entryId or entryUid, or leave both out for every draft the mapped user may see. Reports each draft’s metadata — name, notes, creator, canonical entry — not its field values.read-only

Categories 5 tools

ToolWhat it doesAccess
craft_create_category
Create category
Create a category in a group. Needs the group handle and a title; slug, status, parent and custom fields are optional. Without a parent the category is placed at the top of the group’s structure. Craft validates before saving, and a failed validation is reported field by field rather than as a bare failure.writes off by default
craft_delete_category
Delete category
Move a category to the trash. Craft keeps it recoverable; pass hard=true to remove it for good, which cannot be undone. Descendants are NOT deleted: Craft moves them up one level, so a nested branch stays but changes shape. Address it by id or uid — deliberately not by slug, which can name more than one category.writes off by default
craft_get_category
Get category
One category with its custom field values and its place in the group’s structure. Address it by id, uid or slug; with a slug, name the group as well when several groups may hold that slug.read-only
craft_list_categories
List categories
List categories in structure order. Filter by group handle, status, site or structure level. Only groups the mapped user may view are searched, so an unknown or forbidden group yields an empty list rather than an error.read-only
craft_update_category
Update category
Change an existing category. Only the fields you pass are touched; everything else keeps its value. Passing parentId moves the category inside its group’s structure; a category cannot be moved to another group.writes off by default

Globals 3 tools

ToolWhat it doesAccess
craft_get_global
Get global set
One global set with its custom field values. Address it by handle — the stable name, which survives a move between two installations — or by id. Field values differ per site, so name the site when you mean a specific one; the answer always says which site it read.read-only
craft_list_globals
List global sets
The global sets this user may edit, with handle, name and uid. Global sets hold content that belongs to the whole site rather than to a single entry. Craft has a single permission for them, editGlobalSet, so this list is exactly what craft_update_global will accept. Values differ per site; pass a site handle, or read back which site the answer came from.read-only
craft_update_global
Update global set
Change the custom field values of a global set. Only the fields you pass are touched; everything else keeps its value. The set’s name and handle live in the project config and are not editable here, and there is no tool to create or delete a global set — Craft reserves that for administrators through the project config. Values are written for one site at a time.writes off by default

Schema 4 tools

ToolWhat it doesAccess
craft_get_field
Get field
One custom field by handle, id or uid. Field settings are NOT returned — only the names of the settings it has.read-only administrator
craft_list_entry_types
List entry types
The entry types of the sections this user may work in, each with the custom fields it holds: handle, type and whether the field is required. This is what you need to fill craft_create_entry correctly.read-only
craft_list_fields
List fields
Every custom field defined on this installation, with its type. Field settings are NOT returned — only the names of the settings each field has. For administrators; editors get the fields of their own entry types from craft_list_entry_types.read-only administrator
craft_list_sections
List sections
The sections this user may work in, with their type and the sites they run on. Use the handles from here for the section argument of the entry tools. Sections you may not view are not listed at all.read-only

Assets 3 tools

ToolWhat it doesAccess
craft_get_asset
Get asset
One asset with its full metadata and custom field values. Address it by id or uid. Returns the file’s metadata, never its contents.read-only
craft_list_assets
List assets
List assets with their metadata: filename, kind, size, dimensions and URL. Filter by volume handle, kind (image, pdf, video, …) or filename. Only volumes the mapped user may view are searched. Read-only — this build has no upload, rename or delete for files.read-only
craft_list_volumes
List volumes
The asset volumes this user may view, with handle, name and the number of assets in each. Useful before listing assets, because the volume handle is what narrows that call.read-only

System 2 tools

ToolWhat it doesAccess
craft_audit_log
Audit log
The most recent tool calls: time, user, tool, outcome (ok, error or denied) and the ARGUMENT KEYS — never the values, so the log cannot become a copy of the content it describes. A ring buffer: older rows drop out once it is full.read-only administrator
craft_system_info
System info
Version, edition, environment and database driver of this Craft installation, plus the installed plugins. Read-only; no content is touched.read-only administrator

Database 2 tools

ToolWhat it doesAccess
craft_db_query
Database query
Run one narrow SELECT. Deliberately restricted: a single statement, at most one physical table, no JOIN, no subquery, and only count/min/max/avg/sum as functions — a lexical guard can only vouch for what it can fully read. Craft tables carry a prefix; write {{%entries}} and it is resolved. On PostgreSQL, Craft's columns are camelCase and must be quoted ("dateUpdated"). Rows are returned without any element permission check, so this is for administrators.read-only administrator off by default
craft_db_schema
Database schema
The physical tables of this installation, or the columns of one table. Tables that craft_db_query may not read are listed but marked readable=false, so you can see they exist without trying. Pass the table name as Craft writes it ({{%entries}}) or as it is in the database (craft_entries).read-only administrator

Installation 2 tools

ToolWhat it doesAccess
craft_list_plugins
List plugins
Every plugin this installation has, including the ones that are switched off — craft_system_info only counts the enabled ones. Says whether each is installed, enabled, and whether the config file forces it off. No licence keys and no settings.read-only administrator
craft_list_sites
List sites
The sites this user may work in, with their handle and language. Use these handles for the site argument of the other tools. Sites you may not edit are not listed.read-only

Users 2 tools

ToolWhat it doesAccess
craft_get_current_user
Who am I
The Craft user this token is mapped to: name, groups, whether they are an admin, and the scope of the token itself. Use this to find out what you are allowed to do here before trying something that will be refused.read-only
craft_list_user_groups
List user groups
The user groups on this installation, with how many people are in each. No people and no permission lists — a group's permissions would be a map of where to attack.read-only administrator

Operations 5 tools

ToolWhat it doesAccess
craft_clear_cache
Clear a cache
Clear one cache by key. Start with "template" — it invalidates cached template output and is the gentle answer to stale pages. Keys that cost something (data, cp-resources, transform-indexes, asset-indexing-data) need confirm=true.writes administrator off by default
craft_get_logs
Recent log entries
The most recent log entries, reduced to time, level, category and the FIRST LINE of the message. Stack traces, SQL and request context are cut off, not returned: Craft logs $_POST, $_COOKIE and $_SESSION with every entry, so a raw log is not something to hand out. If the installation streams its log to stdout there are no files to read, and this says so instead of reporting silence.read-only administrator off by default
craft_list_caches
List caches
The caches this installation can clear, by key. Use a key with craft_clear_cache. Some keys cost something to clear and say so.read-only administrator
craft_list_routes
List routes
The routes defined in the project config, by URI pattern and site. The template each route points at is NOT returned — that is a server-side path.read-only administrator
craft_queue_status
Queue status
What the job queue is doing: totals by state, and the most recent jobs with their description and progress. For failed jobs the exception CLASS is returned, not its message — that message carries whatever value it tripped over.read-only administrator