telegraph_get_page
Retrieve Telegraph page content and metadata using its path identifier. Returns a Page object with optional content field for programmatic access.
Instructions
Get a Telegraph page by its path. Returns a Page object.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the Telegraph page (e.g., "Sample-Page-12-15") | |
| return_content | No | If true, content field will be returned |
Implementation Reference
- src/tools/pages.ts:274-286 (handler)The handler case block in handlePageTool that executes the telegraph_get_page tool logic: validates input with GetPageSchema, calls the telegraph client getPage function, and formats the result as MCP content.case 'telegraph_get_page': { const input = GetPageSchema.parse(args); const result = await telegraph.getPage( input.path, input.return_content ); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2), }], }; }
- src/tools/pages.ts:31-34 (schema)Zod schema for input validation used in the telegraph_get_page handler.export const GetPageSchema = z.object({ path: z.string().describe('Path to the Telegraph page (e.g., "Sample-Page-12-15")'), return_content: z.boolean().optional().describe('If true, content field will be returned'), });
- src/tools/pages.ts:146-164 (registration)Tool registration object defining name, description, and inputSchema for telegraph_get_page, included in pageTools and thus allTools.{ name: 'telegraph_get_page', description: 'Get a Telegraph page by its path. Returns a Page object.', inputSchema: { type: 'object' as const, properties: { path: { type: 'string', description: 'Path to the Telegraph page (e.g., "Sample-Page-12-15")', }, return_content: { type: 'boolean', description: 'If true, content field will be returned', default: false, }, }, required: ['path'], }, },
- src/telegraph-client.ts:192-197 (helper)Helper function implementing the core API call to Telegraph's getPage endpoint via apiRequest, called by the tool handler.export async function getPage(path: string, return_content?: boolean): Promise<Page> { return apiRequest<Page>('getPage', { path, return_content, }); }
- src/tools/index.ts:12-12 (registration)Aggregation of all tools including pageTools (which contains telegraph_get_page) into allTools, exported and used by the MCP server.export const allTools = [...accountTools, ...pageTools, ...templateTools, ...exportTools];