Skip to content

Template Reference

The bodies of the files you author for Polytoken (facets, subagents, and skills) are templates. The front-matter schema for each file type is at the bottom of the page.

Templates catch typos at render time: referencing a variable that does not exist raises an error rather than rendering blank, so a broken prompt never reaches the model. Guard optional values with the functions below or with a conditional.

VariableTypeHolds
model_namestringThe active model’s name.
model_variantstringThe model family, for example claude, openai, or gemini.
model_idstringThe provider the model runs through, for example anthropic or openai.
max_tool_batch_sizenumberHow many counted tool calls the model may issue in one turn.
supports_visionbooleanWhether the model accepts images.
can_read_imagesbooleanWhether image reading is turned on for this model.
VariableTypeHolds
facet_namestringThe active facet’s name. Absent in a subagent template.
subagent_namestringThe subagent’s name. Present only in a subagent template.
project_pathstringThe project’s root directory.
cwdstringThe current working directory.
session_idstringThe current session’s identifier.
current_datestringToday’s date.
is_non_interactivebooleanWhether the current run has no human in the loop.
promptstringThe prompt that started this turn. Absent in an AGENTS.md template.
VariableTypeHolds
available_toolslistThe names of every tool the model can use this turn.
available_undeferred_toolslistThe tools whose full definitions Polytoken includes in the prompt this turn.
available_deferred_toolslistThe tools the model reaches through tool search.
tool_librarylistEach tool, with its name, description, and an example.
available_mcp_serverslistThe names of the connected MCP servers.
available_subagentslistEach subagent, with its name and description.
available_skillslistEach skill, with its name and description.
VariableTypeHolds
project_metadataobjectWhatever you set as project metadata, passed through untyped.
auto_drain_notificationsbooleanWhether Polytoken delivers finished background work as soon as it is ready.

The per-row notes above mark which variables a given template omits.

These functions are available in every template:

FunctionReturnsEffect
has_tool(name)booleanWhether a tool with that name is available this turn.
get_tool(name)objectThe named tool’s library entry, or an empty object if the tool is unavailable.
has_mcp(name)booleanWhether an MCP server with that name is connected.
is_model_variant(variant)booleanWhether the active model belongs to that family.
has_skill(name)booleanWhether a skill with that name is available.

One function is available only in a facet template, because a facet composes the system prompt:

FunctionReturnsEffect
transclude(uri)stringIncludes one of Polytoken’s shipped prompt fragments by its polytoken:// address.

The front matter of each authored file type has its own set of legal keys.

# TODO: add generated facet front-matter schema here.
# TODO: add generated subagent front-matter schema here.
# TODO: add generated skill front-matter schema here.