Skip to main content
Glama

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
NameRequiredDescriptionDefault
nameYesThe element name to edit
typeYesThe element type
fieldYesThe field to edit (e.g., 'description', 'metadata.author', 'content')
valueYesThe new value for the field

Implementation Reference

  • 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;
    }
  • 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');
    }
  • 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>;
  • 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 }> {
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states 'Edit an existing element' which implies a mutation operation, but doesn't disclose behavioral traits like required permissions, whether edits are reversible, rate limits, or what happens on failure. For a mutation tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 4 parameters, no annotations, and no output schema, the description is inadequate. It lacks details on behavioral context, error handling, or return values, leaving significant gaps for an AI agent to understand how to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all four parameters with descriptions and an enum for 'type'. The description adds no additional meaning beyond what the schema provides, such as examples of 'field' values or 'value' formats. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Edit') and resource ('an existing element of any type'), providing specific verb+resource pairing. However, it doesn't distinguish this tool from potential siblings like 'create_element' or 'delete_element' beyond the edit action, missing explicit differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'create_element' or 'delete_element'. The description implies usage for editing existing elements but offers no context about prerequisites, exclusions, or specific scenarios where this tool is preferred.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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