create_key
Create a translation key, idempotent on (namespace, name). Returns created=false if the key already exists. When source_value is supplied AND the project has a source language, the value is also written as a source-language translation in the same call. ALWAYS set type to the key's semantic role (button / link / heading / image / icon / input_label / …) - do NOT leave it as the default 'text'; the type drives the key's a11y treatments. See the type field for the full 17-type taxonomy and when to use each.
Parameters
Section titled “Parameters”| Name | Type | Description | |
|---|---|---|---|
project_uuid | string | optional | Project UUID. Required when multiple projects are configured (SONENTA_PROJECTS); defaults to the single configured project otherwise. |
namespace | string | required | Namespace slug (LLM-friendly). |
name | string | required | Dot-notation key name (e.g. hero.title). |
source_value | string | optional | Optional source-language value to seed. |
description | string | optional | |
plurals | boolean | optional | |
max_length | integer | optional | |
type | string | optional | Semantic key type. Set this at CREATION - do NOT leave everything as 'text'. The type drives which a11y treatments the key offers (and whether it gets cognitive / plain-language scoring), so correct typing is what lets the a11y tooling work. Pick by the string's UI role: - text - body / paragraph copy (offers plain_language, screen_reader) - heading - a title or section heading (plain_language, screen_reader) - label - a standalone short label (plain_language, screen_reader) - caption - image caption / helper / secondary text (plain_language, screen_reader) - button - a button's label (offers aria_label, screen_reader) - link - a hyperlink / anchor label (aria_label, screen_reader) - menu_item - a navigation / menu entry (aria_label, screen_reader) - input_placeholder - a form input placeholder (aria_label) - input_label - a form field's label (aria_label) - tooltip - tooltip text (screen_reader) - badge - a small status / count badge (screen_reader) - error_message - a validation / error message (screen_reader) - toast - a transient toast / snackbar notification (screen_reader) - image - an image; THIS key's value IS the alt text - icon - an icon; THIS key's value IS the accessible name (aria) - meta_title - an SEO page heading, label, caption, badge, tooltip, error_message, toast, button, link, menu_item, input_placeholder, input_label, image, icon, meta_title, meta_description) |
Example
Section titled “Example”{ "tool": "create_key", "arguments": { "namespace": "<namespace>", "name": "<name>" }}