#[allow(clippy::wildcard_imports)]
use super::*;
#[allow(clippy::too_many_lines)]
pub(super) fn descriptors() -> Vec<ToolDescriptor> {
vec![
ToolDescriptor {
name: "list_templates",
description: "List the stable-ID issue/form templates stored in `tix.toml` (`tix template list`), one entry per template with its immutable `id`, mutable display `name`, explicit `scope`, `defaults`, ordered `prompts`, typed `references`, and any preserved `extensions`. Read-only. Template IDs are stable across renames; names are labels, not identity.",
input_schema: json!({
"type": "object",
"additionalProperties": false,
"properties": {}
}),
},
ToolDescriptor {
name: "get_template",
description: "Return one template's full metadata (`tix template show`): its immutable `id`, display `name`, explicit `scope`, `defaults`, ordered `prompts`, typed `references` and preserved unknown `extensions`. `template` is the stable ID, or a display name that names exactly one template — an ambiguous name is refused rather than guessed. Read-only.",
input_schema: json!({
"type": "object",
"additionalProperties": false,
"properties": {
"template": { "type": "string", "description": "Stable template ID, or a display name that names exactly one template." }
},
"required": ["template"]
}),
},
ToolDescriptor {
name: "create_template",
description: "Create a template under a new stable `id` (`tix template create`). The complete definition is validated against the shared registry before the atomic `tix.toml` save, so a refused create writes nothing. Templates are data: defaults, prompts and references can only name normal create fields and existing registries, never commands or arbitrary behavior.",
input_schema: json!({
"type": "object",
"additionalProperties": false,
"properties": template_definition_schema("id"),
"required": ["id"]
}),
},
ToolDescriptor {
name: "update_template",
description: "Replace the supplied parts of an existing template (`tix template update`). The stable `id` never changes, so a rename keeps identity, scope, defaults, prompts, references and preserved unknown metadata; a field the request omits is left exactly as it was. A same-content update is a no-op that writes nothing and returns `status: \"no-op\"`.",
input_schema: json!({
"type": "object",
"additionalProperties": false,
"properties": template_definition_schema("template"),
"required": ["template"]
}),
},
ToolDescriptor {
name: "duplicate_template",
description: "Copy a template to a new stable ID (`tix template duplicate`), leaving the source untouched. The copy carries the source's scope, defaults, prompts, references and preserved extensions verbatim; only the ID is new. `new_id` overrides the deterministic `<source>-copy` allocation and `name` overrides the copied label.",
input_schema: json!({
"type": "object",
"additionalProperties": false,
"properties": {
"template": { "type": "string", "description": "Stable ID of the template to copy, or a display name that names exactly one." },
"new_id": { "type": "string", "description": "The new stable ID. Omit for the deterministic `<source>-copy` (then `-copy-2`, …)." },
"name": { "type": "string", "description": "Display label for the copy. Omit to copy the source's label." }
},
"required": ["template"]
}),
},
ToolDescriptor {
name: "delete_template",
description: "Delete a template **definition** (`tix template delete`), never the issues created from it — issues are files in the issue tree that this service never names. Requires `confirm: true`; without it nothing is removed. Deleting an unknown reference is refused because nothing was stored to remove.",
input_schema: json!({
"type": "object",
"additionalProperties": false,
"properties": {
"template": { "type": "string", "description": "Stable ID of the template to delete, or a display name that names exactly one." },
"confirm": { "type": "boolean", "description": "Must be true. Without it nothing is removed and the refusal names the missing confirmation." }
},
"required": ["template", "confirm"]
}),
},
]
}