Skip to main content
Glama

edit_persona

Modify specific properties of an existing AI persona, such as name, description, instructions, or metadata, to tailor its behavior and functionality within the DollhouseMCP server.

Instructions

Edit an existing persona's properties

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldYesField to edit: name, description, instructions, triggers, category, version, or metadata fields
personaYesThe persona name or filename to edit
valueYesThe new value for the field

Implementation Reference

  • Core implementation of the edit_persona tool handler. Locates the persona by identifier, sanitizes and updates the specified field (name, description, instructions/content, category, triggers, version), auto-increments version, validates the persona, saves to disk via loader, and returns success/error status.
    async editPersona( personaName: string, field: string, value: string ): Promise<{ success: boolean; message: string }> { const persona = this.findPersona(personaName); if (!persona) { return { success: false, message: `Persona not found: "${personaName}"` }; } try { const oldVersion = String(persona.metadata.version || '1.0'); switch (field.toLowerCase()) { case 'name': persona.metadata.name = sanitizeInput(value, 50); break; case 'description': persona.metadata.description = sanitizeInput(value, 200); break; case 'instructions': case 'content': persona.content = value; break; case 'category': persona.metadata.category = value; break; case 'triggers': persona.metadata.triggers = value.split(',').map(t => t.trim()).filter(t => t); break; case 'version': persona.metadata.version = value; break; default: return { success: false, message: `Unknown field: "${field}". Valid fields: name, description, instructions, category, triggers, version` }; } // Auto-increment version if not explicitly setting version if (field !== 'version') { persona.metadata.version = this.incrementVersion(oldVersion); } // Validate const validation = this.validator.validatePersona(persona); if (!validation.valid) { return { success: false, message: `Validation failed: ${validation.issues.join(', ')}` }; } // Save changes await this.loader.savePersona(persona); return { success: true, message: `Updated ${field} for "${persona.metadata.name}" (v${persona.metadata.version})` }; } catch (error) { return { success: false, message: `Failed to edit persona: ${error instanceof Error ? error.message : String(error)}` }; } }
  • Zod input schema for the edit_persona MCP tool, defining required parameters: persona_name (string), field (string), value (string) with descriptions.
    export const EditPersonaArgsSchema = z.object({ persona_name: z.string().describe("Name of the persona to edit"), field: z.string().describe("Field to edit (name, description, instructions, category, triggers, version)"), value: z.string().describe("New value for the field") });
  • Interface definition in IToolHandler for the editPersona method, which corresponds to the 'edit_persona' MCP tool. This interface is implemented by the server, mapping method calls to MCP tool invocations.
    editPersona(persona: string, field: string, value: string): Promise<any>;

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/DollhouseMCP/mcp-server'

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