telegraph_list_templates
Retrieve available page templates and their fields to create structured Telegraph pages with consistent formatting.
Instructions
List all available page templates with their fields
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/templates.ts:75-82 (handler)The core handler logic for the 'telegraph_list_templates' tool. It calls listTemplates() from the templates module and returns the result as formatted JSON text content.if (name === 'telegraph_list_templates') { return { content: [{ type: 'text' as const, text: JSON.stringify(listTemplates(), null, 2), }], }; }
- src/tools/templates.ts:24-31 (schema)Tool definition including name, description, and empty inputSchema (no parameters required). Part of the templateTools array.{ name: 'telegraph_list_templates', description: 'List all available page templates with their fields', inputSchema: { type: 'object' as const, properties: {}, }, },
- src/tools/index.ts:8-13 (registration)Imports templateTools (containing 'telegraph_list_templates') and handleTemplateTool, then registers it in the combined allTools export for the MCP server.import { templateTools, handleTemplateTool } from './templates.js'; import { exportTools, handleExportTool } from './export.js'; // Export all tool definitions export const allTools = [...accountTools, ...pageTools, ...templateTools, ...exportTools];
- src/templates/index.ts:184-190 (helper)Helper function listTemplates() that returns a list of all available templates with their metadata (name, description, fields), used by the tool handler.export function listTemplates(): Array<{name: string; description: string; fields: TemplateField[]}> { return Object.values(templates).map(t => ({ name: t.name, description: t.description, fields: t.fields, })); }