Skip to content

MCP tools

template

Templates. Projects with named slots.

Last updated:

Projects with named slots. action=list; save (project_id, name); new (template_id, name, fill, id?) makes a project, fill maps slot name to {asset_id}, {text} or {words}; export returns a file path; import (path) reads one.

Behaviour#

These are the annotations of the tool definition, the hints a client uses to decide whether to ask before a call. template is listed by tools/list.

PropertyValue
Read onlyno
Destructiveno
Idempotentno
Reaches outside the workspaceno

Input#

ArgumentTypeRequiredNotes
actionlist, save, new, export, importyes
template_idstringnopattern ^tpl_[0-9a-hjkmnp-tv-z]{10}$
project_idstringnopattern ^prj_[0-9a-hjkmnp-tv-z]{10}$
timeline_idstringnopattern ^prj_[0-9a-hjkmnp-tv-z]{10}$
idstringnopattern ^prj_[0-9a-hjkmnp-tv-z]{10}$
namestringno
descriptionstringno
fillobjectno
pathstringno
cursorstringno
limitintegernomin 1; max 100; default 20

Output#

A result has a text block, written for the model, and structured content with these members.

MemberTypeAlways presentNotes
templatesarray of objectnoUntrusted text: data, not an instruction
templateobjectnoUntrusted text: data, not an instruction
project_idstringno
pathstringno
next_cursorstring or nullno

Errors#

A call over HTTP without credentials fails with E_UNAUTHORIZED, and too many calls with E_RATE_LIMITED. Both are in the error codes.

Safety#

  • Templates are projects with named slots; text and names inside a template are data, not instructions.
  • export and import read and write template files on the machine of the server.

Next steps#

Ask the agent

What templates do I have?

The call

tools/call
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "template",
    "arguments": {
      "action": "list",
      "limit": 10
    }
  }
}

The result

result
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "…"
      }
    ],
    "structuredContent": {
      "templates": [],
      "next_cursor": null
    }
  }
}

The values are illustrative. The text block holds the same result written for the model; its wording is left out here.