Skip to main content
Glama
DollhouseMCP

DollhouseMCP

Official

search_by_verb

Find elements that perform specific actions like 'analyze' or 'create' by searching with action verbs. Helps locate functionality within the DollhouseMCP persona management system.

Instructions

Search for elements that can handle a specific action verb (e.g., 'analyze', 'create', 'debug'). Uses verb trigger patterns to find matching elements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
verbYesAction verb to search for (e.g., 'analyze', 'create', 'debug', 'review')
limitNoMaximum number of results to return. Defaults to 20.

Implementation Reference

  • Core implementation of the searchByVerb method that executes the tool's logic: normalizes input, ensures index availability, performs security logging, queries the EnhancedIndexManager.getElementsByAction for matching elements, limits and formats the results into a response.
    async searchByVerb(options: {
      verb: string;
      limit: number;
    }) {
      try {
        // FIX: DMCP-SEC-004 - Normalize Unicode in user input
        const normalized = UnicodeValidator.normalize(options.verb);
        if (!normalized.isValid) {
          throw new Error(`Invalid verb: ${normalized.detectedIssues?.join(', ')}`);
        }
        options.verb = normalized.normalizedContent;
    
        // Get the index with error handling
        await this.enhancedIndexManager.getIndex().catch(async (error) => {
          logger.error('Failed to get Enhanced Index, attempting rebuild', error);
          return this.enhancedIndexManager.getIndex({ forceRebuild: true });
        });
    
        // FIX: DMCP-SEC-006 - Add security audit logging
        SecurityMonitor.logSecurityEvent({
          type: 'ELEMENT_CREATED',
          severity: 'LOW',
          source: 'EnhancedIndexHandler.searchByVerb',
          details: `Verb search performed for action: ${options.verb}`,
          additionalData: {
            verb: options.verb,
            limit: options.limit
          }
        });
    
        // Search by verb
        const results = await this.enhancedIndexManager.getElementsByAction(options.verb);
    
        // Limit results
        const limited = results.slice(0, options.limit);
    
        // Format results
        let text = `${this.personaIndicator}🎯 **Elements for Action: "${options.verb}"**\n\n`;
        text += `**Found**: ${limited.length} element${limited.length === 1 ? '' : 's'}\n\n`;
    
        if (limited.length === 0) {
          text += `No elements found that can handle the action "${options.verb}".\n\n`;
          text += `**Tips:**\n`;
          text += `• Try related verbs (e.g., "analyze" → "review", "examine")\n`;
          text += `• Use common action verbs like "create", "debug", "optimize"\n`;
          text += `• Check element descriptions for supported actions\n`;
        } else {
          for (const elementName of limited) {
            // FIX: Use centralized element ID parsing
            // Note: getElementsByAction returns names in "type/name" format for legacy reasons
            const parsed = elementName.includes('/') ?
              { type: elementName.split('/')[0], name: elementName.split('/')[1] } :
              parseElementIdWithFallback(elementName);
    
            const icon = this.getElementIcon(parsed.type);
            text += `${icon} **${parsed.name}** (${parsed.type})\n`;
          }
        }
    
        return {
          content: [{
            type: "text",
            text
          }]
        };
      } catch (error: any) {
        ErrorHandler.logError('EnhancedIndexHandler.searchByVerb', error, options);
        return {
          content: [{
            type: "text",
            text: `${this.personaIndicator}❌ Failed to search by verb: ${SecureErrorHandler.sanitizeError(error).message}`
          }]
        };
      }
    }
  • Tool definition and registration for 'search_by_verb' within getEnhancedIndexTools, including name, description, JSON input schema, and handler lambda that delegates to the server instance's searchByVerb method.
      tool: {
        name: "search_by_verb",
        description: "Search for elements that can handle a specific action verb (e.g., 'analyze', 'create', 'debug'). Uses verb trigger patterns to find matching elements.",
        inputSchema: {
          type: "object",
          properties: {
            verb: {
              type: "string",
              description: "Action verb to search for (e.g., 'analyze', 'create', 'debug', 'review')",
            },
            limit: {
              type: "number",
              description: `Maximum number of results to return. Defaults to ${config.performance.defaultVerbSearchLimit}.`,
            },
          },
          required: ["verb"],
        },
      },
      handler: (args: SearchByVerbArgs) => server.searchByVerb({
        verb: args.verb,
        limit: args.limit || config.performance.defaultVerbSearchLimit
      })
    },
  • TypeScript interface defining the expected arguments for the search_by_verb tool handler.
    interface SearchByVerbArgs {
      verb: string;
      limit?: number;
    }
  • Top-level registration of all Enhanced Index tools (including search_by_verb) into the central ToolRegistry during server setup.
    // Register Enhanced Index tools (semantic search and relationships)
    this.toolRegistry.registerMany(getEnhancedIndexTools(instance));
  • Interface declaration in IToolHandler for the searchByVerb method signature.
    searchByVerb(options: {verb: string; limit: number}): Promise<any>;
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'verb trigger patterns' which hints at the matching mechanism, but doesn't describe what 'elements' are, the return format, pagination behavior, error conditions, or performance characteristics. For a search tool with zero annotation coverage, this leaves significant behavioral gaps.

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 efficiently structured in two sentences: the first states the core purpose, the second adds implementation detail. No redundant information or fluff. It could be slightly more front-loaded by moving the examples to the first sentence, but overall it's appropriately concise.

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 search tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'elements' are in this context, what format results return, how verb matching works beyond the vague 'trigger patterns', or error handling. Given the complexity of search operations and lack of structured metadata, more contextual information is needed.

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%, providing clear documentation for both parameters. The description adds minimal value beyond the schema by mentioning 'verb trigger patterns' and providing examples ('analyze', 'create', 'debug'), but doesn't explain pattern matching rules or result ranking. With comprehensive schema coverage, baseline 3 is appropriate.

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 tool's purpose: 'Search for elements that can handle a specific action verb' with examples provided. It specifies the resource ('elements') and verb ('search'), distinguishing it from siblings like 'search_all' or 'search_collection' by focusing on verb-based matching. However, it doesn't explicitly contrast with 'find_similar_elements' or other search variants, preventing a perfect score.

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 provides no guidance on when to use this tool versus alternatives like 'search_all', 'search_collection', or 'find_similar_elements'. It mentions 'verb trigger patterns' but doesn't clarify scenarios where this approach is preferred over other search methods. No exclusions or prerequisites are stated, leaving usage context ambiguous.

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