/**
* Expert Consultation Prompt
*
* A prompt template for requesting expert human consultation
* on specialized topics requiring domain expertise.
*/
import {
type PromptMessage,
type GetPromptResult,
type PromptArgument
} from '@modelcontextprotocol/sdk/types.js';
/**
* Arguments for the expert consultation prompt template
*/
export interface ExpertConsultationArgs {
topic: string;
expertise_area: string;
specific_question?: string;
background_info?: string;
expected_outcome?: string;
}
/**
* Prompt definition for expert consultation
*/
export const EXPERT_CONSULTATION_PROMPT = {
name: 'expert-consultation',
description: 'Request expert human consultation on specialized topics requiring domain expertise',
arguments: [
{
name: 'topic',
description: 'The main topic or subject for consultation',
required: true
},
{
name: 'expertise_area',
description: 'The specific area of expertise needed (e.g., medical, legal, technical, financial)',
required: true
},
{
name: 'specific_question',
description: 'A specific question to be answered (optional)',
required: false
},
{
name: 'background_info',
description: 'Relevant background information or context',
required: false
},
{
name: 'expected_outcome',
description: 'What type of outcome or deliverable is expected',
required: false
}
] as PromptArgument[]
} as const;
/**
* Generate the expert consultation prompt content
*
* @param args Arguments for prompt generation
* @returns Formatted prompt with messages
*
* @example
* ```typescript
* const result = await generateExpertConsultationPrompt({
* topic: "Database performance optimization",
* expertise_area: "Database Administration",
* specific_question: "How can we improve query performance for large datasets?",
* background_info: "PostgreSQL database with 10M+ records, complex joins causing timeouts",
* expected_outcome: "Specific optimization recommendations and implementation steps"
* });
* ```
*/
export async function generateExpertConsultationPrompt(args: ExpertConsultationArgs): Promise<GetPromptResult> {
const { topic, expertise_area, specific_question, background_info, expected_outcome } = args;
let promptText = `I'm seeking expert consultation from someone with expertise in **${expertise_area}**.
**Topic:** ${topic}`;
if (specific_question) {
promptText += `\n\n**Specific Question:** ${specific_question}`;
}
if (background_info) {
promptText += `\n\n**Background Information:**\n${background_info}`;
}
if (expected_outcome) {
promptText += `\n\n**Expected Outcome:** ${expected_outcome}`;
}
promptText += `\n\nAs an expert in ${expertise_area}, please provide:
1. Your professional analysis of the situation
2. Recommended approaches or solutions
3. Potential risks or considerations to be aware of
4. Any industry best practices that apply
5. Next steps or additional resources that might be helpful
Please draw upon your specialized knowledge and experience to provide insights that a generalist might miss.`;
const messages: PromptMessage[] = [
{
role: 'user',
content: {
type: 'text',
text: promptText
}
}
];
return {
description: `Expert consultation on ${topic} (${expertise_area})`,
messages
};
}