generate_connect_link
Generate a shareable link that lets external clients connect their social accounts to your workspace. Control link expiry and optionally email the link.
Instructions
Generate a shareable link for external clients to connect their social accounts to the workspace
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expiryDays | No | Link expiry in days (1-30, default 7) | |
| sendEmail | No | Send the link via email | |
| No | Recipient email (required if sendEmail is true) |
Implementation Reference
- src/tools/accounts.ts:111-124 (handler)Handler function for the generate_connect_link tool. Calls POST /social-media/connect-link with expiryDays, sendEmail, and email, and returns the connect URL.
async (input) => { const data = await client.post<{ connectUrl: string }>( '/social-media/connect-link', { expiryDays: input.expiryDays, sendEmail: input.sendEmail, email: input.email, }, ); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, - src/tools/accounts.ts:93-110 (schema)Zod schema defining input validation: expiryDays (int 1-30, default 7), sendEmail (boolean, default false), email (optional email string).
{ expiryDays: z .number() .int() .min(1) .max(30) .default(7) .describe('Link expiry in days (1-30, default 7)'), sendEmail: z .boolean() .default(false) .describe('Send the link via email'), email: z .string() .email() .optional() .describe('Recipient email (required if sendEmail is true)'), }, - src/tools/accounts.ts:90-125 (registration)Registration of the 'generate_connect_link' tool via server.tool() within the registerAccountTools function.
server.tool( 'generate_connect_link', 'Generate a shareable link for external clients to connect their social accounts to the workspace', { expiryDays: z .number() .int() .min(1) .max(30) .default(7) .describe('Link expiry in days (1-30, default 7)'), sendEmail: z .boolean() .default(false) .describe('Send the link via email'), email: z .string() .email() .optional() .describe('Recipient email (required if sendEmail is true)'), }, async (input) => { const data = await client.post<{ connectUrl: string }>( '/social-media/connect-link', { expiryDays: input.expiryDays, sendEmail: input.sendEmail, email: input.email, }, ); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/index.ts:18-18 (registration)Top-level call to registerAccountTools which registers the generate_connect_link tool on the server.
registerAccountTools(server, client);