telegraph_create_account
Create a Telegraph account to manage articles programmatically. Save the returned access token for future API requests.
Instructions
Create a new Telegraph account. Returns an Account object with access_token that should be saved for future requests.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| short_name | Yes | Account name (1-32 characters) | |
| author_name | No | Default author name used when creating new articles (0-128 characters) | |
| author_url | No | Profile link opened when users click on the author name (0-512 characters) |
Implementation Reference
- src/tools/account.ts:134-147 (handler)Handler for the 'telegraph_create_account' tool: parses input with CreateAccountSchema, calls telegraph.createAccount, and returns the result as JSON text content.case 'telegraph_create_account': { const input = CreateAccountSchema.parse(args); const result = await telegraph.createAccount( input.short_name, input.author_name, input.author_url ); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2), }], }; }
- src/tools/account.ts:11-15 (schema)Zod input schema for validating parameters of the 'telegraph_create_account' tool.export const CreateAccountSchema = z.object({ short_name: z.string().min(1).max(32).describe('Account name (1-32 characters)'), author_name: z.string().max(128).optional().describe('Default author name (0-128 characters)'), author_url: z.string().max(512).optional().describe('Default profile link (0-512 characters)'), });
- src/tools/account.ts:37-62 (registration)Tool registration definition for 'telegraph_create_account' within the accountTools export array, specifying name, description, and JSON input schema.{ name: 'telegraph_create_account', description: 'Create a new Telegraph account. Returns an Account object with access_token that should be saved for future requests.', inputSchema: { type: 'object' as const, properties: { short_name: { type: 'string', description: 'Account name (1-32 characters)', minLength: 1, maxLength: 32, }, author_name: { type: 'string', description: 'Default author name used when creating new articles (0-128 characters)', maxLength: 128, }, author_url: { type: 'string', description: 'Profile link opened when users click on the author name (0-512 characters)', maxLength: 512, }, }, required: ['short_name'], }, },