Skip to main content
Glama

telegraph_edit_page

Modify existing Telegraph pages by updating content, titles, or author information using HTML or Markdown formatting.

Instructions

Edit an existing Telegraph page. Returns the updated Page object.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
access_tokenYesAccess token of the Telegraph account
pathYesPath to the page (e.g., "Sample-Page-12-15")
titleYesPage title (1-256 characters)
contentYesPage content - can be HTML string, Markdown string, or JSON array of Node objects
formatNoContent format: "html" or "markdown" (default: "html")html
author_nameNoAuthor name (0-128 characters)
author_urlNoProfile link (0-512 characters)
return_contentNoIf true, content field will be returned in the Page object

Implementation Reference

  • The handler logic for the 'telegraph_edit_page' tool. Validates input using EditPageSchema, parses the content into Telegraph Node format, calls the editPage API function, and returns the result as JSON-formatted text content.
    case 'telegraph_edit_page': { const input = EditPageSchema.parse(args); const content = telegraph.parseContent(input.content, input.format); const result = await telegraph.editPage( input.access_token, input.path, input.title, content, input.author_name, input.author_url, input.return_content ); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2), }], }; }
  • Zod schema defining the input parameters and validation rules for the telegraph_edit_page tool.
    export const EditPageSchema = z.object({ access_token: z.string().describe('Access token of the Telegraph account'), path: z.string().describe('Path to the page'), title: z.string().min(1).max(256).describe('Page title (1-256 characters)'), content: z.string().describe('Page content - can be HTML string, Markdown string, or JSON array of Node objects'), format: z.enum(['html', 'markdown']).optional().default('html').describe('Content format: "html" or "markdown" (default: "html")'), author_name: z.string().max(128).optional().describe('Author name (0-128 characters)'), author_url: z.string().max(512).optional().describe('Profile link (0-512 characters)'), return_content: z.boolean().optional().describe('If true, content field will be returned in the Page object'), });
  • Tool registration entry in the pageTools array, defining the name, description, and JSON input schema for 'telegraph_edit_page'. Included in allTools export.
    { name: 'telegraph_edit_page', description: 'Edit an existing Telegraph page. Returns the updated Page object.', inputSchema: { type: 'object' as const, properties: { access_token: { type: 'string', description: 'Access token of the Telegraph account', }, path: { type: 'string', description: 'Path to the page (e.g., "Sample-Page-12-15")', }, title: { type: 'string', description: 'Page title (1-256 characters)', minLength: 1, maxLength: 256, }, content: { type: 'string', description: 'Page content - can be HTML string, Markdown string, or JSON array of Node objects', }, format: { type: 'string', description: 'Content format: "html" or "markdown" (default: "html")', enum: ['html', 'markdown'], default: 'html', }, author_name: { type: 'string', description: 'Author name (0-128 characters)', maxLength: 128, }, author_url: { type: 'string', description: 'Profile link (0-512 characters)', maxLength: 512, }, return_content: { type: 'boolean', description: 'If true, content field will be returned in the Page object', default: false, }, }, required: ['access_token', 'path', 'title', 'content'], }, },
  • Helper function that performs the actual API request to Telegraph's editPage endpoint, wrapping the generic apiRequest call with typed parameters.
    export async function editPage( access_token: string, path: string, title: string, content: Node[], author_name?: string, author_url?: string, return_content?: boolean ): Promise<Page> { return apiRequest<Page>('editPage', { access_token, path, title, content, author_name, author_url, return_content, }); }

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