chain_personas
Execute multiple expert personas sequentially for step-by-step processing, starting with an initial input to chain specialized AI capabilities.
Instructions
여러 페르소나를 순차적으로 실행하여 단계별 처리를 수행합니다
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| personas | Yes | 순차 실행할 페르소나 이름 배열 | |
| initialInput | Yes | 첫 번째 페르소나에 전달할 입력 |
Implementation Reference
- src/index.ts:537-579 (handler)The handler function for the 'chain_personas' tool. It validates input using chainPersonasSchema, iterates through the list of personas, reads each persona's content, tracks usage, simulates chaining by preparing sequential inputs, and returns a detailed execution summary.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`, }, ], }; }
- src/validation.ts:38-41 (schema)Zod schema defining the input structure for chain_personas: an array of 1-10 persona names and an initial input string (max 10k chars). Used for validation in the handler.export const chainPersonasSchema = z.object({ personas: z.array(personaNameSchema).min(1).max(10), initialInput: z.string().min(1).max(10000), });
- src/index.ts:395-413 (registration)Registration of the 'chain_personas' tool in the ListTools response, including name, description, and JSON Schema for input validation (mirrors the Zod schema).{ name: 'chain_personas', description: '여러 페르소나를 순차적으로 실행하여 단계별 처리를 수행합니다', inputSchema: { type: 'object', properties: { personas: { type: 'array', items: { type: 'string' }, description: '순차 실행할 페르소나 이름 배열', }, initialInput: { type: 'string', description: '첫 번째 페르소나에 전달할 입력', }, }, required: ['personas', 'initialInput'], }, },
- src/index.ts:324-396 (registration)Specific line registering the tool name in the tools list.name: 'create_persona', description: '새로운 페르소나 프로필을 생성합니다', inputSchema: { type: 'object', properties: { name: { type: 'string', description: '페르소나 이름 (예: default, professional, casual)', }, content: { type: 'string', description: '페르소나 프롬프트 내용', }, }, required: ['name', 'content'], }, }, { name: 'update_persona', description: '기존 페르소나 프로필을 수정합니다', inputSchema: { type: 'object', properties: { name: { type: 'string', description: '수정할 페르소나 이름', }, content: { type: 'string', description: '새로운 페르소나 프롬프트 내용', }, }, required: ['name', 'content'], }, }, { name: 'delete_persona', description: '페르소나 프로필을 삭제합니다', inputSchema: { type: 'object', properties: { name: { type: 'string', description: '삭제할 페르소나 이름', }, }, required: ['name'], }, }, { name: 'list_personas', description: '사용 가능한 모든 페르소나 목록을 조회합니다', inputSchema: { type: 'object', properties: {}, }, }, { name: 'suggest_persona', description: '대화 컨텍스트를 분석하여 적합한 페르소나를 제안합니다 (트리거 시에만 활성화)', inputSchema: { type: 'object', properties: { context: { type: 'string', description: '분석할 대화 컨텍스트 또는 질문 내용', }, }, required: ['context'], }, }, { name: 'chain_personas',