writing-assistance-prompts.tsโข5.97 kB
/**
* Writing Assistance Prompts
*
* Example MCP prompts for various writing and communication tasks.
*/
import { z } from "zod";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import type { MCPModule } from "../types/index.js";
/**
* Prompt registration function for writing assistance prompts
*/
async function register(server: McpServer): Promise<void> {
// Register email writing prompt
server.registerPrompt(
"write-email",
{
title: "Email Writing Assistant",
description: "Generate professional emails for various purposes",
argsSchema: {
purpose: z.enum([
"request",
"follow-up",
"introduction",
"apology",
"announcement",
"meeting-invite"
]).describe("Purpose of the email"),
recipient: z.string().describe("Recipient name or role"),
context: z.string().describe("Background context and key points to include"),
tone: z.enum([
"formal",
"professional",
"friendly",
"casual"
]).optional().describe("Desired tone of the email")
}
},
({ purpose, recipient, context, tone }) => {
const actualTone = tone || "professional";
const purposeInstructions = {
request: "requesting something specific",
"follow-up": "following up on a previous communication",
introduction: "introducing yourself or someone else",
apology: "apologizing for something",
announcement: "announcing news or information",
"meeting-invite": "inviting to a meeting"
};
return {
messages: [
{
role: "user",
content: {
type: "text",
text: `Please write a ${actualTone} email for ${purposeInstructions[purpose]} to ${recipient}.
Context and key points:
${context}
Please include:
1. Appropriate subject line
2. Professional greeting
3. Clear and concise body
4. Appropriate closing
5. Call to action (if needed)`
}
}
]
};
}
);
// Register technical documentation prompt
server.registerPrompt(
"write-technical-doc",
{
title: "Technical Documentation Assistant",
description: "Generate technical documentation for various purposes",
argsSchema: {
type: z.enum([
"api-reference",
"user-guide",
"installation-guide",
"troubleshooting",
"architecture-overview"
]).describe("Type of documentation"),
topic: z.string().describe("Main topic or system being documented"),
audience: z.enum([
"developers",
"end-users",
"administrators",
"stakeholders"
]).describe("Target audience"),
details: z.string().describe("Specific details, features, or requirements to include")
}
},
({ type, topic, audience, details }) => {
const typeDescriptions = {
"api-reference": "comprehensive API reference documentation",
"user-guide": "step-by-step user guide",
"installation-guide": "installation and setup instructions",
"troubleshooting": "troubleshooting guide with common issues and solutions",
"architecture-overview": "high-level architecture documentation"
};
return {
messages: [
{
role: "user",
content: {
type: "text",
text: `Please create ${typeDescriptions[type]} for ${topic}, targeted at ${audience}.
Requirements and details:
${details}
Please structure the documentation with:
1. Clear overview and purpose
2. Prerequisites (if applicable)
3. Step-by-step instructions
4. Examples and code snippets (if relevant)
5. Common issues and solutions (if applicable)
6. Additional resources or references`
}
}
]
};
}
);
// Register meeting summary prompt
server.registerPrompt(
"summarize-meeting",
{
title: "Meeting Summary Generator",
description: "Generate structured meeting summaries and action items",
argsSchema: {
meetingTitle: z.string().describe("Title or purpose of the meeting"),
participants: z.string().describe("List of meeting participants"),
notes: z.string().describe("Raw meeting notes or transcript"),
format: z.enum([
"standard",
"executive",
"action-focused",
"detailed"
]).optional().describe("Summary format style")
}
},
({ meetingTitle, participants, notes, format }) => {
const actualFormat = format || "standard";
const formatInstructions = {
standard: "standard meeting summary with key points and action items",
executive: "executive summary focused on decisions and outcomes",
"action-focused": "action-focused summary emphasizing tasks and responsibilities",
detailed: "detailed summary with comprehensive coverage of all topics"
};
return {
messages: [
{
role: "user",
content: {
type: "text",
text: `Please create a ${formatInstructions[actualFormat]} for the following meeting:
Meeting: ${meetingTitle}
Participants: ${participants}
Meeting notes:
${notes}
Please organize the summary with:
1. Meeting overview (date, participants, purpose)
2. Key discussion points
3. Decisions made
4. Action items with owners and deadlines
5. Next steps
6. Open questions or concerns`
}
}
]
};
}
);
}
/**
* Export the MCP module
*/
export const writingAssistancePrompts: MCPModule = {
register,
metadata: {
name: "writing-assistance-prompts",
description: "Writing and communication assistance prompts for MCP",
version: "1.0.0",
author: "PCN"
}
};
export default writingAssistancePrompts;