# DollhouseMCP API Reference (v2.0.0) **Last Updated:** March 2026 This is a lookup reference for the DollhouseMCP MCP server API. It documents every operation, grouped by endpoint. For a workflow-oriented guide, see [LLM Quick Reference](../guides/llm-quick-reference.md). For architecture details, see [MCP-AQL Operations](../architecture/mcp-aql/OPERATIONS.md). --- ## Interface Modes ### MCP-AQL CRUDE (Default) The server exposes **5 MCP tool endpoints** that accept an `operation` field routing to the appropriate handler: | Endpoint | Tool Name | Semantics | |----------|-----------|-----------| | **Create** | `mcp_aql_create` | Additive, non-destructive (create elements, add entries, install, import) | | **Read** | `mcp_aql_read` | Safe, read-only (list, get, search, activate, introspect, validate, render) | | **Update** | `mcp_aql_update` | Modify existing state (edit elements, upgrade format) | | **Delete** | `mcp_aql_delete` | Remove state (delete elements, clear memory entries) | | **Execute** | `mcp_aql_execute` | Runtime execution lifecycle (run agents, confirm operations, manage handoffs) | Every call follows this shape: ```json { "operation": "", "element_type": "", "params": { ... } } ``` `element_type` accepts both singular (`persona`) and plural (`personas`) forms. It can appear at the top level or inside `params`. ### Discrete Mode (Backward Compatibility) The server can also expose each operation as a separate MCP tool (40+ individual tools). This mode exists for backward compatibility with v1.x integrations. Configure via server startup options. The MCP-AQL CRUDE interface is the default and recommended mode. --- ## Response Format All operations return a discriminated union: ```typescript // Success { success: true, data: { ... } } // Failure { success: false, error: "Human-readable error message" } ``` --- ## Introspection The server is self-documenting. Use introspection to get live, authoritative details about any operation: ```json mcp_aql_read { "operation": "introspect", "params": { "query": "operations" } } mcp_aql_read { "operation": "introspect", "params": { "query": "operations", "name": "create_element" } } mcp_aql_read { "operation": "introspect", "params": { "query": "format", "name": "persona" } } mcp_aql_read { "operation": "introspect", "params": { "query": "types" } } mcp_aql_read { "operation": "introspect", "params": { "query": "categories" } } ``` When in doubt about an operation's exact parameters or behavior, introspect it. The schemas below are accurate at time of writing but introspection is always the authoritative source. --- ## Gatekeeper (Permission System) Some operations require user confirmation before executing. Default permission levels by endpoint: | Endpoint | Default Policy | |----------|---------------| | **Read** | Auto-approve (safe, no side effects) | | **Create** | Session confirmation (confirm once, allowed for remainder of session) | | **Update** | Single-use confirmation (confirm every time) | | **Delete** | Single-use confirmation (confirm every time) | | **Execute** | Single-use confirmation (some lifecycle operations use session confirmation) | When confirmation is needed, the response will indicate it. Confirm with: ```json mcp_aql_execute { "operation": "confirm_operation", "params": { "operation": "create_element" } } ``` Then retry the original operation. Individual operations may override their endpoint default. Elements can also define custom gatekeeper policies via the `gatekeeper` field that take effect when activated. --- ## Element Types Six element types, each with different required fields for creation: | Type | Required Fields | Purpose | |------|----------------|---------| | `persona` | `instructions` | Behavioral profiles — AI tone, priorities, workflows | | `skill` | `content` | Discrete capabilities — domain knowledge, methodology | | `template` | `content` | Reusable content structures with variable placeholders | | `agent` | `content` or `goal` | Goal-oriented workflows with execution lifecycle | | `memory` | _(none)_ | Persistent context storage — entries added via `addEntry` | | `ensemble` | `metadata.elements` | Composite activation of multiple elements together | All types support `instructions` (behavioral directives) and `content` (reference material) as distinct first-class fields. Use `introspect query: "format"` for full field specifications. --- ## Parameter Conventions - **snake_case** for all parameter names: `element_name`, `element_type` - Both `element_type` and `elementType` accepted (snake_case preferred) - Element names are case-sensitive - `element_type` can be singular or plural (`persona` / `personas`) --- ## CREATE Operations Routed through `mcp_aql_create`. ### create_element Create a new element of any type. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `element_name` | string | Yes | Element name | | `element_type` | string | Yes | persona, skill, template, agent, memory, ensemble | | `description` | string | Yes | Short summary (1-2 sentences) | | `instructions` | string | Personas | Behavioral directives in command voice. Required for personas. | | `content` | string | Skills/Templates | Reference material, knowledge, template body. Required for templates. | | `goal` | object | Agents | Goal configuration: `{ template, parameters, successCriteria }` | | `tags` | string[] | No | Categorization tags | | `triggers` | string[] | No | Action verbs that trigger this element | | `category` | string | No | Category label (skills, templates, memories only) | | `activates` | object | Agents | Elements to auto-activate: `{ skills: [...], personas: [...] }` | | `tools` | object | Agents | Tool access policy: `{ allowed: [...], denied: [...] }` | | `systemPrompt` | string | Agents | Custom system prompt for LLM context | | `autonomy` | object | Agents | `{ riskTolerance, maxAutonomousSteps, requiresApproval, autoApprove }` | | `resilience` | object | Agents | `{ onStepLimitReached, onExecutionFailure, maxRetries, maxContinuations }` | | `gatekeeper` | object | No | Per-element security policy: `{ allow?, confirm?, deny?, scopeRestrictions?, externalRestrictions?: { description, allowPatterns?, confirmPatterns?, denyPatterns? } }`. Use `allow/confirm/deny` for MCP-AQL operation patterns like `read_*` or `delete_element`; use `externalRestrictions` for external tool patterns like `Read:*` or `Bash:git status*`. | | `metadata` | object | No | Additional metadata. For ensembles: include `elements` array. | ### import_element Import an element from exported data. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `data` | string or object | Yes | Export package (JSON string or object) | | `overwrite` | boolean | No | Overwrite if exists (default: false) | ### addEntry Add an entry to a memory element. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `element_name` | string | Yes | Memory element name | | `content` | string | Yes | Entry text content | | `tags` | string[] | No | Entry tags for categorization | | `metadata` | object | No | Structured metadata for correlation | ### install_collection_content Install an element from the community collection to the local portfolio. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `path` | string | Yes | Content path (e.g., `personas/creative-writer.md`) | ### submit_collection_content Submit a local element to the community collection via GitHub. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `content` | string | Yes | Element reference to submit | ### import_persona Import a persona from a file path or JSON string. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `source` | string | Yes | File path or JSON string | | `overwrite` | boolean | No | Overwrite existing persona | ### verify_challenge Submit verification code to unblock a danger zone operation. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `challenge_id` | string | Yes | UUID challenge ID from danger zone trigger | | `code` | string | Yes | Verification code displayed to the user | ### beetlejuice_beetlejuice_beetlejuice Safe-trigger the full danger zone verification pipeline for testing purposes. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `agent_name` | string | No | Agent to block (default: `beetlejuice-test-agent`) | ### init_portfolio Initialize a new GitHub portfolio repository. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `repository_name` | string | No | Name for the portfolio repository | | `private` | boolean | No | Whether the repository should be private | | `description` | string | No | Repository description | ### sync_portfolio Sync local portfolio with GitHub repository. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `direction` | string | No | `push` or `pull` (default: `push`) | | `mode` | string | No | Sync mode | | `force` | boolean | No | Force sync even with conflicts | | `dry_run` | boolean | No | Preview changes without applying | ### portfolio_element_manager Manage individual elements between local and GitHub. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `operation` | string | Yes | `list-remote`, `download`, `upload`, `compare` | | `element_name` | string | No | Element name to operate on | | `element_type` | string | No | Element type | | `options` | object | No | Operation options (`force`, `dry_run`, etc.) | ### setup_github_auth Start GitHub device-code authentication. No parameters. ### configure_oauth Configure GitHub OAuth client ID. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `client_id` | string | No | OAuth client ID | --- ## READ Operations Routed through `mcp_aql_read`. ### list_elements List elements with pagination, filtering, sorting, and aggregation. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `element_type` | string | Yes | Element type to list | | `page` | number | No | Page number, 1-indexed (default: 1) | | `pageSize` | number | No | Items per page (default: 20, max: 100) | | `sortBy` | string | No | `name`, `created`, `modified`, `version` (default: `name`) | | `sortOrder` | string | No | `asc` or `desc` (default: `asc`) | | `nameContains` | string | No | Partial name match (case-insensitive) | | `tags` | string[] | No | Must have ALL tags (AND logic) | | `tagsAny` | string[] | No | Must have ANY tag (OR logic) | | `author` | string | No | Filter by author | | `status` | string | No | `active`, `inactive`, or `all` | | `category` | string | No | Filter by category (case-insensitive) | | `aggregate` | object | No | `{ count: true, group_by?: "category" }` for count-only results | | `fields` | string or string[] | No | Field selection: preset (`minimal`, `standard`, `full`) or array | ### get_element Get an element by name and type, returning full content and metadata. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `element_name` | string | Yes | Element name | | `element_type` | string | Yes | Element type | | `fields` | string or string[] | No | Field selection preset or array | ### get_element_details Get detailed information about a specific element (currently equivalent to `get_element`; future versions will include extended metadata like relationship graphs and gatekeeper policy resolution). | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `element_name` | string | Yes | Element name | | `element_type` | string | Yes | Element type | | `fields` | string or string[] | No | Field selection preset or array | ### search_elements Full-text search across element names, descriptions, and content. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `query` | string | Yes | Search query (max 1000 chars) | | `element_type` | string | No | Filter by element type | | `page` | number | No | Page number | | `pageSize` | number | No | Results per page | | `sort` | object | No | `{ sortBy, sortOrder }` | | `fields` | string or string[] | No | Field selection preset or array | ### query_elements Structured filtering by tags, category, author, and more. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `element_type` | string | Yes | Element type to query | | `filters` | object | No | `{ nameContains, tags, author, status, category }` | | `sort` | object | No | `{ sortBy, sortOrder }` | | `pagination` | object | No | `{ page, pageSize }` | | `aggregate` | object | No | `{ count?: boolean, group_by?: string }` | | `fields` | string or string[] | No | Field selection preset or array | ### search Unified search across local, GitHub, and collection sources. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `query` | string | Yes | Search query | | `scope` | string or string[] | No | `local`, `github`, `collection`, `all`, or array of scopes | | `type` | string | No | Filter by element type | | `page` | number | No | Page number | | `limit` | number | No | Results per page | | `sort` | object | No | `{ field, order }` | | `filters` | object | No | `{ tags, author, createdAfter, createdBefore }` | | `fields` | string or string[] | No | Field selection preset or array | ### activate_element Activate an element for use in the current session. Persisted per-session via `DOLLHOUSE_SESSION_ID`. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `element_name` | string | Yes | Element name | | `element_type` | string | Yes | Element type | ### deactivate_element Deactivate an element, removing it from the current session. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `element_name` | string | Yes | Element name | | `element_type` | string | Yes | Element type | ### get_active_elements Get all currently active elements with rendered content. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `element_type` | string | No | Filter by type (omit for all) | ### validate_element Validate an existing element by name. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `element_name` | string | Yes | Element name | | `element_type` | string | Yes | Element type | | `strict` | boolean | No | Use strict validation | ### render Render a template with provided variables. Section-format templates (`