Skip to main content
Glama

Instantiate Template Natively

instantiate_template_native

Create an AFFiNE document from a template via native block cloning, falling back to markdown only when required; supports variables, parent links, and tag copying.

Instructions

Instantiate a template using native AFFiNE block cloning when supported, falling back to markdown materialization only when necessary.

Input Schema

NameRequiredDescriptionDefault
titleNoOptional title for the new document. Defaults to the template title.
variablesNoKey-value map of {{variable}} substitutions applied during cloning.
parentDocIdNoOptional parent doc to link the instantiated doc under in the sidebar.
workspaceIdNoAFFiNE workspace id. Omit only when AFFINE_WORKSPACE_ID is configured.
preserveTagsNoIf true (default), copy the template's tags onto the instantiated doc.
allowFallbackNoIf false, fail instead of falling back to markdown materialization when native cloning is unsupported.
templateDocIdYesThe template doc to instantiate.

Output Schema

NameRequiredDescriptionDefault
okNo
codeNo
modeNo
docIdNo
errorNo
stageNo
titleNo
statusNo
detailsNo
warningsNo
causeCodeNo
retryableNo
blockCountNo
workspaceIdNo
rootBlockIdsNo
preservedTagsNo
linkedToParentNo
contentPersistedNo
recoveryGuidanceNo
metadataPersistedNo
sourceTemplateDocIdNo
unresolvedVariablesNo
nativeCloneSupportedNo
requiresManualRepairNo
replacedVariableCountNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.10.2

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds genuine behavioral context beyond the annotations: there are two execution paths (native cloning vs. markdown materialization) and the second is a degraded fallback. It does not say what side effects the markdown path has (fidelity loss, structure flattening) or that a new doc is created, which matters given idempotentHint=false and openWorldHint=true.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler; the primary mechanism comes before the fallback clause. It is efficient, though arguably too terse for a 7-parameter creation tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values need no explanation, and the schema documents parameters thoroughly. But for a non-idempotent, open-world creation tool with a fallback path, the description omits what the fallback implies for fidelity and when the agent should set allowFallback=false, leaving the picture only adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all seven parameters including variables, preserveTags, and allowFallback are already documented. The description names no parameters and adds no semantics beyond the schema, which is acceptable only at the baseline for full coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Instantiate a template') plus the mechanism (native AFFiNE block cloning with markdown fallback), which distinguishes it from create_doc_from_markdown. It stops short of naming the sibling it replaces or complements, so it is clear but not fully differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Falling back to markdown materialization only when necessary' implies the preferred path and a conditional fallback, which is useful usage guidance. However it never states when to pick this over create_doc_from_markdown or how it relates to inspect_template_structure, leaving alternative selection to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools