update_persona
Modify existing persona profiles by updating their names and prompt content to adapt AI behavior for different expert roles.
Instructions
기존 페르소나 프로필을 수정합니다
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 수정할 페르소나 이름 | |
| content | Yes | 새로운 페르소나 프롬프트 내용 |
Implementation Reference
- src/index.ts:472-483 (handler)Handler for update_persona tool: validates input using updatePersonaSchema, saves the updated persona content via savePersona helper, and returns a success message.case 'update_persona': { const validated = updatePersonaSchema.parse(args); await savePersona(validated.name, validated.content); return { content: [ { type: 'text', text: `페르소나 "${validated.name}"이(가) 업데이트되었습니다.`, }, ], }; }
- src/validation.ts:25-28 (schema)Zod schema defining the input structure for update_persona: requires validated name and content fields with size/security constraints.export const updatePersonaSchema = z.object({ name: personaNameSchema, content: personaContentSchema, });
- src/index.ts:341-358 (registration)Registers the update_persona tool in the MCP server's tool list with name, description, and JSON input schema matching the Zod schema.{ name: 'update_persona', description: '기존 페르소나 프로필을 수정합니다', inputSchema: { type: 'object', properties: { name: { type: 'string', description: '수정할 페르소나 이름', }, content: { type: 'string', description: '새로운 페르소나 프롬프트 내용', }, }, required: ['name', 'content'], }, },
- src/index.ts:126-133 (helper)Core helper function that performs security validation on name/content and writes the persona file to the local directory.async function savePersona(name: string, content: string): Promise<void> { // 파일명 및 컨텐츠 검증 const validatedName = validatePersonaName(name); const validatedContent = validatePersonaContent(content); const filePath = path.join(PERSONA_DIR, `${validatedName}.txt`); await fs.writeFile(filePath, validatedContent, 'utf-8'); }