personalize_message
Generate personalized LinkedIn messages for leads using their name, job title, and post content to create connection invitations or follow-up DMs.
Instructions
Generate a personalized LinkedIn invitation note or DM for a specific lead. Returns a message ready to copy-paste (max 200 chars for invitations, longer for DMs).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Lead's full name | |
| title | No | Job title | |
| post_snippet | No | Their LinkedIn post text | |
| priority | No | P2-warm | |
| message_type | No | Type: invitation (max 200 chars), dm1 (first DM after acceptance), dm2 (follow-up J+3), dm3 (final J+7) | invitation |
Implementation Reference
- src/index.ts:419-449 (handler)The async handler function for 'personalize_message' which generates an invitation or DM based on the input parameters.
async ({ name, title, post_snippet, priority, message_type }) => { const lead = { name, title, post_snippet, priority: priority ?? "P2-warm" }; let message: string; if (message_type === "invitation") { message = generateInvitationNote(lead); if (message.length > 200) { message = message.substring(0, 197) + "..."; } } else { const touchMap: Record<string, number> = { dm1: 1, dm2: 2, dm3: 3 }; message = generateDM(lead, touchMap[message_type] || 1); } return { content: [ { type: "text" as const, text: [ `Message type: ${message_type}`, `For: ${name}${priority ? ` (${priority})` : ""}`, `Length: ${message.length} chars${message_type === "invitation" ? " (max 200)" : ""}`, "", "---", message, "---", ].join("\n"), }, ], }; }, - src/index.ts:408-416 (schema)The input schema definition for 'personalize_message' using Zod validation.
inputSchema: { name: z.string().describe("Lead's full name"), title: z.string().optional().describe("Job title"), post_snippet: z.string().optional().describe("Their LinkedIn post text"), priority: z.enum(["P1-hot", "P2-warm", "P3-nurture", "P4-cold"]).default("P2-warm").optional(), message_type: z.enum(["invitation", "dm1", "dm2", "dm3"]).default("invitation").describe( "Type: invitation (max 200 chars), dm1 (first DM after acceptance), dm2 (follow-up J+3), dm3 (final J+7)", ), }, - src/index.ts:401-418 (registration)Registration of the 'personalize_message' tool with the MCP server.
server.registerTool( "personalize_message", { title: "Personalize Outreach Message", description: "Generate a personalized LinkedIn invitation note or DM for a specific lead. " + "Returns a message ready to copy-paste (max 200 chars for invitations, longer for DMs).", inputSchema: { name: z.string().describe("Lead's full name"), title: z.string().optional().describe("Job title"), post_snippet: z.string().optional().describe("Their LinkedIn post text"), priority: z.enum(["P1-hot", "P2-warm", "P3-nurture", "P4-cold"]).default("P2-warm").optional(), message_type: z.enum(["invitation", "dm1", "dm2", "dm3"]).default("invitation").describe( "Type: invitation (max 200 chars), dm1 (first DM after acceptance), dm2 (follow-up J+3), dm3 (final J+7)", ), }, annotations: { readOnlyHint: true, openWorldHint: false, destructiveHint: false }, },