Skip to main content
Glama

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>;

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