edit_element
Modify existing AI personas, skills, templates, agents, memories, or ensembles by updating specific fields like descriptions or metadata within the DollhouseMCP server.
Instructions
Edit an existing element of any type
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The element name to edit | |
| type | Yes | The element type | |
| field | Yes | The field to edit (e.g., 'description', 'metadata.author', 'content') | |
| value | Yes | The new value for the field |
Implementation Reference
- src/server/tools/ElementTools.ts:278-313 (handler)Handler implementation for the 'edit_element' tool. Receives args and delegates to server.editElement(args). Includes input schema validation.{ tool: { name: "edit_element", description: "Edit an existing element of any type", inputSchema: { type: "object", properties: { name: { type: "string", description: "The element name to edit", }, type: { type: "string", description: "The element type", enum: Object.values(ElementType), }, field: { type: "string", description: "The field to edit (e.g., 'description', 'metadata.author', 'content')", }, value: { description: "The new value for the field", oneOf: [ { type: "string" }, { type: "number" }, { type: "boolean" }, { type: "object" }, { type: "array" }, ], }, }, required: ["name", "type", "field", "value"], }, }, handler: (args: EditElementArgs) => server.editElement(args) },
- TypeScript interface defining the input arguments for edit_element tool.interface EditElementArgs { name: string; type: string; field: string; value: any; }
- src/server/ServerSetup.ts:51-87 (registration)Registers the element tools (including edit_element) into the ToolRegistry by calling getElementTools(instance).private registerTools(instance: IToolHandler): void { // Register element tools (new generic tools for all element types) this.toolRegistry.registerMany(getElementTools(instance)); // Register persona export/import tools (core functionality moved to element tools) this.toolRegistry.registerMany(getPersonaExportImportTools(instance)); // Register collection tools this.toolRegistry.registerMany(getCollectionTools(instance)); // DEPRECATED: Old user tools - replaced by dollhouse_config // Comment out to remove from tool list, but keep for reference during transition // this.toolRegistry.registerMany(getUserTools(instance)); // Register auth tools this.toolRegistry.registerMany(getAuthTools(instance)); // Portfolio tools (including sync_portfolio with new safety features) this.toolRegistry.registerMany(getPortfolioTools(instance)); // DEPRECATED: Old config tools - replaced by dollhouse_config // Comment out to remove from tool list, but keep for reference during transition // this.toolRegistry.registerMany(getConfigTools(instance)); // Register new unified config and sync tools this.toolRegistry.registerMany(getConfigToolsV2(instance)); // Register build info tools this.toolRegistry.registerMany(getBuildInfoTools(instance)); // Register Enhanced Index tools (semantic search and relationships) this.toolRegistry.registerMany(getEnhancedIndexTools(instance)); // Invalidate cache since tools have changed this.toolCache.invalidateToolList(); logger.debug('ToolDiscoveryCache: Cache invalidated due to tool registration'); }
- src/server/types.ts:25-25 (schema)Interface definition in IToolHandler for the editElement method called by the tool handler.editElement(args: {name: string; type: string; field: string; value: any}): Promise<any>;
- src/server/tools/ElementTools.ts:75-75 (registration)The getElementTools function that returns the array of tools including the edit_element tool for registration.export function getElementTools(server: IToolHandler): Array<{ tool: ToolDefinition; handler: any }> {