telegraph_get_account_info
Retrieve Telegraph account details including author name, URL, and page count using an access token. Specify which account fields to return for customized information.
Instructions
Get information about a Telegraph account.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| access_token | Yes | Access token of the Telegraph account | |
| fields | No | List of account fields to return (default: short_name, author_name, author_url) |
Implementation Reference
- src/tools/account.ts:165-177 (handler)The handler logic for the 'telegraph_get_account_info' tool. It validates the input using GetAccountInfoSchema, calls the telegraph.getAccountInfo function, and returns the result as JSON text.case 'telegraph_get_account_info': { const input = GetAccountInfoSchema.parse(args); const result = await telegraph.getAccountInfo( input.access_token, input.fields as AccountField[] | undefined ); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2), }], }; }
- src/tools/account.ts:24-29 (schema)Zod schema for input validation of the telegraph_get_account_info tool, defining access_token and optional fields.export const GetAccountInfoSchema = z.object({ access_token: z.string().describe('Access token of the Telegraph account'), fields: z.array(z.enum(['short_name', 'author_name', 'author_url', 'auth_url', 'page_count'])) .optional() .describe('List of account fields to return'), });
- src/tools/account.ts:93-114 (registration)Registration of the 'telegraph_get_account_info' tool in the accountTools array, including name, description, and input schema definition.{ name: 'telegraph_get_account_info', description: 'Get information about a Telegraph account.', inputSchema: { type: 'object' as const, properties: { access_token: { type: 'string', description: 'Access token of the Telegraph account', }, fields: { type: 'array', items: { type: 'string', enum: ['short_name', 'author_name', 'author_url', 'auth_url', 'page_count'], }, description: 'List of account fields to return (default: short_name, author_name, author_url)', }, }, required: ['access_token'], }, },