Skip to main content
Glama

telegraph_backup_account

Export all pages from a Telegraph account in Markdown or HTML format for backup purposes using an access token.

Instructions

Backup all pages from a Telegraph account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
access_tokenYesAccess token of the Telegraph account
formatNoExport formatmarkdown
limitNoMaximum number of pages to export

Implementation Reference

  • Main execution logic for the 'telegraph_backup_account' tool: validates input with BackupAccountSchema, fetches account page list using telegraph.getPageList, iterates over pages to fetch full content and convert to markdown or HTML, collects into exportedPages array, returns structured JSON response with total and exported counts.
    if (name === 'telegraph_backup_account') { const input = BackupAccountSchema.parse(args); const pageList = await telegraph.getPageList(input.access_token, 0, input.limit); const exportedPages = []; for (const page of pageList.pages) { const fullPage = await telegraph.getPage(page.path, true); const content = fullPage.content ? (input.format === 'markdown' ? nodesToMarkdown(fullPage.content) : nodesToHtml(fullPage.content)) : ''; exportedPages.push({ title: fullPage.title, path: fullPage.path, url: fullPage.url, content, }); } return { content: [{ type: 'text' as const, text: JSON.stringify({ total_count: pageList.total_count, exported_count: exportedPages.length, format: input.format, pages: exportedPages, }, null, 2), }], }; }
  • Zod schema for input validation of the 'telegraph_backup_account' tool, defining access_token (required), format, and optional limit.
    export const BackupAccountSchema = z.object({ access_token: z.string().describe('Access token of the Telegraph account'), format: z.enum(['markdown', 'html']).default('markdown').describe('Export format'), limit: z.number().int().min(1).max(200).default(50).optional(), });
  • Tool registration entry in exportTools array, specifying name, description, and input schema for 'telegraph_backup_account'.
    { name: 'telegraph_backup_account', description: 'Backup all pages from a Telegraph account', inputSchema: { type: 'object' as const, properties: { access_token: { type: 'string', description: 'Access token of the Telegraph account', }, format: { type: 'string', enum: ['markdown', 'html'], default: 'markdown', description: 'Export format', }, limit: { type: 'integer', minimum: 1, maximum: 200, default: 50, description: 'Maximum number of pages to export', }, }, required: ['access_token'], }, },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NehoraiHadad/telegraph-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server