Skip to main content
Glama
DollhouseMCP

DollhouseMCP

Official

execute_agent

Execute an agent with a specific goal to activate different behavioral personas for AI assistants, enabling dynamic persona management through the DollhouseMCP server.

Instructions

Execute an agent element with a specific goal

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe agent name to execute
goalYesThe goal for the agent to achieve

Implementation Reference

  • Registration of the 'execute_agent' tool, including input schema, description, and handler that delegates to server.executeAgent(name, goal)
    {
      tool: {
        name: "execute_agent",
        description: "Execute an agent element with a specific goal",
        inputSchema: {
          type: "object",
          properties: {
            name: {
              type: "string",
              description: "The agent name to execute",
            },
            goal: {
              type: "string",
              description: "The goal for the agent to achieve",
            },
          },
          required: ["name", "goal"],
        },
      },
      handler: (args: ExecuteAgentArgs) => server.executeAgent(args.name, args.goal)
    },
  • TypeScript interface defining the input arguments for the execute_agent tool
    interface ExecuteAgentArgs {
      name: string;
      goal: string;
    }
  • Interface definition for the server's executeAgent method called by the tool handler
    executeAgent(name: string, goal: string): Promise<any>;
  • getElementTools function that returns the array of element tools including execute_agent, which gets registered in ServerSetup
    export function getElementTools(server: IToolHandler): Array<{ tool: ToolDefinition; handler: any }> {
      return [
        {
          tool: {
            name: "list_elements",
            description: "List all available elements of a specific type",
            inputSchema: {
              type: "object",
              properties: {
                type: {
                  type: "string",
                  description: "The element type to list",
                  enum: Object.values(ElementType),
                },
              },
              required: ["type"],
            },
          },
          handler: (args: ListElementsArgs) => server.listElements(args.type)
        },
        {
          tool: {
            name: "activate_element",
            description: "Activate a specific element by name",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "The element name to activate",
                },
                type: {
                  type: "string",
                  description: "The element type",
                  enum: Object.values(ElementType),
                },
              },
              required: ["name", "type"],
            },
          },
          handler: (args: ActivateElementArgs) => server.activateElement(args.name, args.type)
        },
        {
          tool: {
            name: "get_active_elements",
            description: "Get information about currently active elements of a specific type",
            inputSchema: {
              type: "object",
              properties: {
                type: {
                  type: "string",
                  description: "The element type to check",
                  enum: Object.values(ElementType),
                },
              },
              required: ["type"],
            },
          },
          handler: (args: GetActiveElementsArgs) => server.getActiveElements(args.type)
        },
        {
          tool: {
            name: "deactivate_element",
            description: "Deactivate a specific element",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "The element name to deactivate",
                },
                type: {
                  type: "string",
                  description: "The element type",
                  enum: Object.values(ElementType),
                },
              },
              required: ["name", "type"],
            },
          },
          handler: (args: DeactivateElementArgs) => server.deactivateElement(args.name, args.type)
        },
        {
          tool: {
            name: "get_element_details",
            description: "Get detailed information about a specific element",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "The element name to get details for",
                },
                type: {
                  type: "string",
                  description: "The element type",
                  enum: Object.values(ElementType),
                },
              },
              required: ["name", "type"],
            },
          },
          handler: (args: GetElementDetailsArgs) => server.getElementDetails(args.name, args.type)
        },
        {
          tool: {
            name: "reload_elements",
            description: "Reload elements of a specific type from the filesystem",
            inputSchema: {
              type: "object",
              properties: {
                type: {
                  type: "string",
                  description: "The element type to reload",
                  enum: Object.values(ElementType),
                },
              },
              required: ["type"],
            },
          },
          handler: (args: ReloadElementsArgs) => server.reloadElements(args.type)
        },
        // Element-specific tools
        {
          tool: {
            name: "render_template",
            description: "Render a template element with provided variables",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "The template name to render",
                },
                variables: {
                  type: "object",
                  description: "Variables to use in the template",
                  additionalProperties: true,
                },
              },
              required: ["name", "variables"],
            },
          },
          handler: (args: RenderTemplateArgs) => server.renderTemplate(args.name, args.variables)
        },
        {
          tool: {
            name: "execute_agent",
            description: "Execute an agent element with a specific goal",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "The agent name to execute",
                },
                goal: {
                  type: "string",
                  description: "The goal for the agent to achieve",
                },
              },
              required: ["name", "goal"],
            },
          },
          handler: (args: ExecuteAgentArgs) => server.executeAgent(args.name, args.goal)
        },
        // Generic element creation tool
        {
          tool: {
            name: "create_element",
            description: "Create a new element of any type",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "The element name",
                },
                type: {
                  type: "string",
                  description: "The element type",
                  enum: Object.values(ElementType),
                },
                description: {
                  type: "string",
                  description: "Element description",
                },
                content: {
                  type: "string",
                  description: "Element content (required for some types)",
                },
                metadata: {
                  type: "object",
                  description: "Additional metadata specific to element type",
                  additionalProperties: true,
                },
              },
              required: ["name", "type", "description"],
            },
          },
          handler: (args: CreateElementArgs) => server.createElement(args)
        },
        // Generic element editing tool
        {
          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)
        },
        // Generic element validation tool
        {
          tool: {
            name: "validate_element",
            description: "Validate an element for correctness and best practices",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "The element name to validate",
                },
                type: {
                  type: "string",
                  description: "The element type",
                  enum: Object.values(ElementType),
                },
                strict: {
                  type: "boolean",
                  description: "Whether to apply strict validation rules",
                  default: false,
                },
              },
              required: ["name", "type"],
            },
          },
          handler: (args: ValidateElementArgs) => server.validateElement(args)
        },
        // Generic element deletion tool
        {
          tool: {
            name: "delete_element",
            description: "Delete an element and optionally its associated data files",
            inputSchema: {
              type: "object",
              properties: {
                name: {
                  type: "string",
                  description: "The element name to delete",
                },
                type: {
                  type: "string",
                  description: "The element type",
                  enum: Object.values(ElementType),
                },
                deleteData: {
                  type: "boolean",
                  description: "Whether to delete associated data files (if not specified, will prompt)",
                  default: undefined,
                },
              },
              required: ["name", "type"],
            },
          },
          handler: (args: DeleteElementArgs) => server.deleteElement(args)
        },
      ];
    }
  • Registration of element tools (including execute_agent) into the ToolRegistry during server setup
    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');
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Execute an agent element' implies a potentially state-changing operation, but the description doesn't clarify whether this is a read-only action, what side effects occur, if authentication is needed, or how errors are handled. It lacks critical behavioral details for safe invocation.

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

Conciseness4/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action, making it easy to parse. However, it could be slightly more informative without sacrificing brevity.

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?

Given the complexity implied by 'execute' (suggesting a potentially stateful operation), lack of annotations, no output schema, and vague description, this is incomplete. The agent cannot reliably understand what execution entails, what results to expect, or how to handle this tool in context with siblings. More detail is needed for safe and effective use.

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?

The input schema has 100% description coverage, with clear documentation for 'name' and 'goal'. The description adds no additional parameter semantics beyond what's in the schema, such as format examples or constraints. With high schema coverage, a baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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

Purpose3/5

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

The description 'Execute an agent element with a specific goal' clearly states the action (execute) and target (agent element), but it's vague about what 'execute' entails and doesn't distinguish this tool from sibling tools like 'activate_element' or 'deactivate_element'. It provides a basic purpose but lacks specificity about the execution mechanism or outcome.

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?

The description offers no guidance on when to use this tool versus alternatives. With siblings like 'activate_element', 'deactivate_element', and 'get_element_details', there's no indication of prerequisites, appropriate contexts, or exclusions. It leaves the agent to infer usage from the tool name alone.

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

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