Skip to main content
Glama

chain_personas

Execute multiple expert personas sequentially to perform step-by-step processing tasks, passing outputs between personas for complex workflows.

Instructions

여러 페르소나를 순차적으로 실행하여 단계별 처리를 수행합니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
personasYes순차 실행할 페르소나 이름 배열
initialInputYes첫 번째 페르소나에 전달할 입력

Implementation Reference

  • The core handler logic for the 'chain_personas' tool. It validates input, iterates through the specified personas, reads each persona's content, tracks usage, simulates chaining with placeholder inputs, and returns a formatted report of the chain execution steps.
    case 'chain_personas': { const validated = chainPersonasSchema.parse(args); const results: ChainResult[] = []; let currentInput = validated.initialInput; for (const personaName of validated.personas) { try { const personaContent = await readPersona(personaName); await trackUsage(personaName, currentInput); results.push({ persona: personaName, prompt: personaContent, input: currentInput, }); // 다음 입력은 현재 페르소나의 출력이 될 것임을 명시 currentInput = `[Previous output from ${personaName} will be used as input here]`; } catch (error) { results.push({ persona: personaName, error: (error as Error).message, }); break; } } const resultText = results.map((r, i) => { if (r.error) { return `Step ${i + 1} - ${r.persona}: ❌ ${r.error}`; } return `Step ${i + 1} - ${r.persona}:\n\nPrompt:\n${r.prompt}\n\nInput:\n${r.input}\n`; }).join('\n' + '='.repeat(50) + '\n\n'); return { content: [ { type: 'text', text: `🔗 Persona Chain Execution\n\n${resultText}\n✅ Chain completed: ${results.filter(r => !r.error).length}/${validated.personas.length} steps`, }, ], }; }
  • Zod schema defining the input structure for chain_personas: an array of 1-10 valid persona names and an initial input string (max 10k chars).
    export const chainPersonasSchema = z.object({ personas: z.array(personaNameSchema).min(1).max(10), initialInput: z.string().min(1).max(10000), });
  • src/index.ts:396-412 (registration)
    Tool registration in the MCP listTools handler, providing the name, description, and JSON schema matching the Zod validation schema.
    name: 'chain_personas', description: '여러 페르소나를 순차적으로 실행하여 단계별 처리를 수행합니다', inputSchema: { type: 'object', properties: { personas: { type: 'array', items: { type: 'string' }, description: '순차 실행할 페르소나 이름 배열', }, initialInput: { type: 'string', description: '첫 번째 페르소나에 전달할 입력', }, }, required: ['personas', 'initialInput'], },

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/seanshin0214/persona-mcp'

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