Skip to main content
Glama
DollhouseMCP

DollhouseMCP

Official

search_collection

Search for AI personas, skills, agents, and prompts in the DollhouseMCP collection using keywords to find behavioral profiles and content types.

Instructions

Search for content in the collection by keywords. This searches all content types including personas (AI behavioral profiles that users activate to change AI behavior), skills, agents, prompts, etc. When a user asks to 'find a persona', search in the collection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for finding content. Examples: 'creative writer', 'explain like I'm five', 'coding assistant'. Users typically search for personas by their behavioral traits or names.

Implementation Reference

  • Defines and registers the 'search_collection' tool including name, description, input schema (query: string required), and thin handler that extracts query param and delegates to server.searchCollection
    {
      tool: {
        name: "search_collection",
        description: "Search for content in the collection by keywords. This searches all content types including personas (AI behavioral profiles that users activate to change AI behavior), skills, agents, prompts, etc. When a user asks to 'find a persona', search in the collection.",
        inputSchema: {
          type: "object",
          properties: {
            query: {
              type: "string",
              description: "Search query for finding content. Examples: 'creative writer', 'explain like I'm five', 'coding assistant'. Users typically search for personas by their behavioral traits or names.",
            },
          },
          required: ["query"],
        },
      },
      handler: (args: any) => server.searchCollection(args.query)
    },
  • Core handler function that performs the actual search: validates query, attempts GitHub API search on DollhouseMCP/collection repo, updates cache, falls back to local cache search if API fails.
    async searchCollection(query: string): Promise<any[]> {
      logger.debug(`CollectionSearch.searchCollection called with query: "${query}"`);
      
      // Validate search query for security
      try {
        validateSearchQuery(query, 1000);
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        logger.error('Search query validation failed:', { query, error: errorMessage });
        ErrorHandler.logError('CollectionSearch.search.validateQuery', error, { query });
        return [];
      }
      
      try {
        // First, try GitHub API search if authenticated
        const searchUrl = `${this.searchBaseUrl}?q=${encodeURIComponent(query)}+repo:DollhouseMCP/collection+path:library+extension:md`;
        logger.debug(`Attempting GitHub API search with URL: ${searchUrl}`);
        const data = await this.githubClient.fetchFromGitHub(searchUrl, false); // Don't require auth for search
        
        if (data.items && Array.isArray(data.items)) {
          logger.debug(`Found ${data.items.length} items via GitHub API search`);
          
          // Update cache with fresh data from API
          await this.updateCacheFromGitHubItems(data.items);
          
          return data.items;
        }
        
        logger.debug('GitHub API search returned no items, falling back to cache');
        return [];
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        logger.debug(`GitHub API search failed: ${errorMessage}. Falling back to cached search.`);
        ErrorHandler.logError('CollectionSearch.search.githubApi', error, { query });
        
        // Fallback to cached search
        return this.searchFromCache(query);
      }
    }
Behavior3/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. It describes what gets searched (all content types) and provides a specific use case (finding personas), but lacks details on behavioral traits like pagination, rate limits, authentication needs, or what happens when no results are found. It adds some context but doesn't fully compensate for the lack of annotations.

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 efficiently structured in two sentences: the first states the purpose and scope, the second provides usage guidance. Every sentence earns its place with no wasted words, and key information is front-loaded.

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

Completeness3/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 adequate but has gaps. It covers purpose, scope, and usage well, but lacks details on return values, error handling, or performance characteristics. Given the complexity (searching multiple content types) and lack of structured data, it should do more to be fully complete.

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 the single 'query' parameter with examples. The description adds marginal value by mentioning 'keywords' and specifying content types, but doesn't provide additional syntax, format details, or constraints beyond what the schema provides. 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.

Purpose5/5

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

The description clearly states the specific action ('search for content') and resource ('collection'), and distinguishes it from siblings by specifying it searches 'all content types including personas, skills, agents, prompts, etc.' This differentiates it from more specialized search tools like search_by_verb or search_portfolio.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool: 'When a user asks to 'find a persona', search in the collection.' This gives clear context for usage and distinguishes it from alternatives like search_all or search_collection_enhanced by focusing on collection-specific content.

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