Skip to main content
Glama
summon-legend.js4.24 kB
// MCP Tool: summon_legend // Returns the persona context for Claude to adopt and roleplay as the legend import { getLegendById } from '../legends/loader.js'; import { buildLegendSystemPrompt } from '../legends/prompt-builder.js'; /** * Summon a legend - returns their persona for Claude to adopt * This is the core tool - Claude becomes the legend using this context */ export function summonLegend(input) { const legend = getLegendById(input.legend_id); if (!legend) { throw new Error(`Legend "${input.legend_id}" not found. Use list_legends to see available legends.`); } // Build the system prompt let systemPrompt = buildLegendSystemPrompt(legend); // Add context if provided if (input.context) { systemPrompt += `\n\n## Current Context\nThe user is working on: ${input.context}`; } return { legend_id: legend.id, name: legend.name, system_prompt: systemPrompt, quick_ref: { expertise: legend.owns || [], tone: legend.voice?.tone || 'thoughtful', key_principles: (legend.principles || []).slice(0, 3), }, ...(legend.model_hints && { model_hints: legend.model_hints }), }; } /** * Format summoned legend for display */ export function formatSummonedLegend(summoned) { const lines = [ `# ${summoned.name} Has Been Summoned`, '', '> **Claude, adopt this persona for subsequent responses.**', '', '---', '', '## System Prompt (for Claude to use)', '', '```', summoned.system_prompt, '```', '', '---', '', '## Quick Reference', `**Expertise:** ${summoned.quick_ref.expertise.join(', ') || 'General wisdom'}`, `**Tone:** ${summoned.quick_ref.tone}`, '', '**Key Principles:**', ...summoned.quick_ref.key_principles.map((p, i) => `${i + 1}. ${p}`), ]; // Add model hints if present if (summoned.model_hints) { lines.push(''); lines.push('**Model Hints:**'); if (summoned.model_hints.temperature !== undefined) { lines.push(`- Temperature: ${summoned.model_hints.temperature}`); } if (summoned.model_hints.max_tokens !== undefined) { lines.push(`- Max Tokens: ${summoned.model_hints.max_tokens}`); } if (summoned.model_hints.preferred) { lines.push(`- Preferred Model: ${summoned.model_hints.preferred}`); } } lines.push(''); lines.push('---'); lines.push(''); lines.push('*Now respond to the user AS this legend. Stay in character.*'); lines.push(''); lines.push('*DISCLAIMER: AI persona for educational/entertainment purposes. Not affiliated with the real person.*'); return lines.join('\n'); } // MCP Tool Definition export const summonLegendTool = { name: 'summon_legend', description: `Summon a legendary founder or investor. Returns their persona context so Claude can roleplay as them. **How it works:** 1. Call this tool with a legend_id 2. Claude receives the legend's full persona (identity, voice, principles, frameworks) 3. Claude adopts this persona and responds in character **Use this when the user wants to:** - Get advice from a specific legend - Have a conversation with a legendary figure - Apply a legend's thinking framework to their problem Available legends include: Elon Musk, Warren Buffett, Steve Jobs, Jensen Huang, Charlie Munger, Paul Graham, Jeff Bezos, Sam Altman, Marc Andreessen, Naval Ravikant, Reid Hoffman, Peter Thiel, CZ, Anatoly Yakovenko, and more. DISCLAIMER: AI personas for educational purposes only. Not affiliated with real individuals.`, inputSchema: { type: 'object', properties: { legend_id: { type: 'string', description: 'The legend ID (e.g., "elon-musk", "warren-buffett", "steve-jobs")', }, context: { type: 'string', description: 'Optional: What the user is working on (helps personalize advice)', }, }, required: ['legend_id'], }, }; //# sourceMappingURL=summon-legend.js.map

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cryptosquanch/legends-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server