telegraph_revoke_access_token
Revoke an active access token to invalidate it immediately and generate a new replacement token for enhanced security.
Instructions
Revoke the current access_token and generate a new one. The old token becomes invalid immediately.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| access_token | Yes | Access token of the Telegraph account to revoke |
Implementation Reference
- src/tools/account.ts:179-188 (handler)MCP tool handler for 'telegraph_revoke_access_token': validates input using Zod schema and delegates to telegraph.revokeAccessToken client function, returning JSON response.case 'telegraph_revoke_access_token': { const input = RevokeAccessTokenSchema.parse(args); const result = await telegraph.revokeAccessToken(input.access_token); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2), }], }; }
- src/telegraph-client.ts:121-125 (helper)Core implementation of revokeAccessToken: makes HTTP POST to Telegraph API endpoint '/revokeAccessToken' using the shared apiRequest utility.export async function revokeAccessToken(access_token: string): Promise<Account> { return apiRequest<Account>('revokeAccessToken', { access_token, }); }
- src/tools/account.ts:31-33 (schema)Zod input validation schema for the telegraph_revoke_access_token tool requiring 'access_token' string.export const RevokeAccessTokenSchema = z.object({ access_token: z.string().describe('Access token of the Telegraph account'), });
- src/tools/account.ts:115-128 (registration)Tool registration in accountTools array: defines name, description, and JSON inputSchema for MCP server registration.{ name: 'telegraph_revoke_access_token', description: 'Revoke the current access_token and generate a new one. The old token becomes invalid immediately.', inputSchema: { type: 'object' as const, properties: { access_token: { type: 'string', description: 'Access token of the Telegraph account to revoke', }, }, required: ['access_token'], }, },