/**
* Template tool definitions.
* @module
*/
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
export const templateTools: Tool[] = [
{
name: "list_templates",
description:
"List all templates defined in the Logseq graph. " +
"Returns template names, whether they use Full House features, and fillable properties. " +
"Use this to discover available templates before using create_page_from_template.",
inputSchema: {
type: "object",
properties: {},
},
},
{
name: "get_template",
description:
"Get detailed information about a specific template. " +
"Returns the template structure, Full House expressions used, and fillable properties. " +
"Use this to understand a template before creating a page from it.",
inputSchema: {
type: "object",
properties: {
name: {
type: "string",
description: "Name of the template to retrieve",
},
},
required: ["name"],
},
},
{
name: "create_page_from_template",
description:
"Create a new page using a template. " +
"Fetches the template, substitutes variables into empty properties, and creates the page with template blocks. " +
"Full House expressions (like c.page.name, date.now) are preserved for Full House to render. " +
"Use list_templates to see available templates first.",
inputSchema: {
type: "object",
properties: {
pageName: {
type: "string",
description: "Name of the page to create",
},
template: {
type: "string",
description: "Name of the template to use (e.g., 'person', 'project', 'jira')",
},
variables: {
type: "object",
description:
"Optional values to fill empty properties. Example: { 'job-title': 'Engineer', 'team': '[[MLOps]]' }",
additionalProperties: { type: "string" },
},
},
required: ["pageName", "template"],
},
},
{
name: "create_blocks_from_template",
description:
"Insert template blocks into an existing page. " +
"Use this to add structured content like meeting notes, task lists, or sections to a page. " +
"Can append to page, or insert under a specific heading. " +
"Full House expressions are preserved for Full House to render.",
inputSchema: {
type: "object",
properties: {
pageName: {
type: "string",
description: "Name of the existing page to add blocks to",
},
template: {
type: "string",
description: "Name of the template to use (e.g., 'meeting', 'daily')",
},
insertPosition: {
type: "string",
enum: ["append", "prepend", "under-heading"],
description:
"Where to insert blocks: 'append' (default) adds to end, 'under-heading' adds as children of a heading block",
},
heading: {
type: "string",
description:
"Heading to insert under (required if insertPosition is 'under-heading'). Example: '## Notes'",
},
variables: {
type: "object",
description:
"Optional values to fill empty properties. Example: { 'owner': '[[John]]', 'date': '2025-12-05' }",
additionalProperties: { type: "string" },
},
},
required: ["pageName", "template"],
},
},
];