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,
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool edits an existing page and returns an updated Page object, but lacks critical details: authentication requirements (implied by access_token but not explicit), whether edits are destructive/reversible, rate limits, error conditions, or what 'updated Page object' entails. For a mutation tool with zero annotation coverage, this is insufficient.

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 perfectly concise: one sentence stating the action and another stating the return value. It's front-loaded with the core purpose and wastes no words. Every sentence earns its place by providing essential information not repeated elsewhere.

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

Completeness3/5

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

Given the tool's complexity (mutation with 8 parameters, no annotations, no output schema), the description is minimally adequate. It states the purpose and return type but lacks behavioral context, usage guidelines, and output details. With no output schema, the description doesn't explain what 'Page object' contains, leaving gaps for the agent.

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?

Schema description coverage is 100%, so the schema fully documents all 8 parameters. The description adds no parameter-specific information beyond what's in the schema (e.g., no examples, edge cases, or clarifications). According to guidelines, baseline is 3 when schema does the heavy lifting, even with no param info in description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Edit an existing Telegraph page') and identifies the resource ('Telegraph page'), distinguishing it from sibling tools like 'telegraph_create_page' (creation) and 'telegraph_get_page' (retrieval). It provides a precise verb+resource combination that leaves no ambiguity about the tool's function.

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. It doesn't mention prerequisites (e.g., needing an existing page), exclusions (e.g., not for creating new pages), or comparisons to siblings like 'telegraph_create_page' or 'telegraph_get_page'. The agent must infer usage from context alone.

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