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'],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool backs up all pages but does not mention critical behaviors like whether it requires authentication (implied by access_token), potential rate limits, output format details beyond the schema, or if it's a read-only operation. This leaves significant gaps for an agent to understand how to invoke it safely and effectively.

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

Conciseness5/5

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

The description is a single, direct sentence that efficiently conveys the core functionality without any unnecessary words. It is front-loaded and appropriately sized for the tool's complexity, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the tool's complexity (backup operation with authentication and format options), lack of annotations, and no output schema, the description is insufficient. It does not explain what the backup output looks like, how errors are handled, or any side effects, leaving the agent with incomplete information for proper usage.

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?

The input schema has 100% description coverage, clearly documenting each parameter's purpose, so the description does not need to add parameter details. It mentions 'all pages' which aligns with the 'limit' parameter but does not provide additional semantic context beyond what the schema offers, such as how the backup process works or error handling.

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?

The description clearly states the action ('Backup') and resource ('all pages from a Telegraph account'), making the tool's purpose immediately understandable. However, it does not explicitly differentiate from sibling tools like 'telegraph_export_page' or 'telegraph_get_page_list', which might handle similar content, leaving some ambiguity in scope.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, such as 'telegraph_export_page' for single pages or 'telegraph_get_page_list' for listing without backup. It lacks context on prerequisites, like needing an access token, or exclusions, such as handling large accounts with pagination.

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

Install Server

Other Tools

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