Skip to main content
Glama

search_all

Search across local, GitHub, and community collections for AI personas, skills, and templates with unified results, duplicate detection, and version comparison.

Instructions

Search across all available sources (local portfolio, GitHub portfolio, and collection) for elements. This provides unified search with duplicate detection and version comparison across all three tiers of the DollhouseMCP ecosystem.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query. Can match element names, keywords, tags, triggers, or descriptions across all sources.
sourcesNoSources to search. Defaults to ['local', 'github']. Include 'collection' to search the community collection.
typeNoLimit search to specific element type. If not specified, searches all types.
pageNoPage number for pagination (1-based). Defaults to 1.
page_sizeNoNumber of results per page. Defaults to 20.
sort_byNoSort results by criteria. Defaults to 'relevance'.

Implementation Reference

  • Registration of search_all tool in getPortfolioTools function, which returns the tool definitions including search_all for registration in ToolRegistry
    export function getPortfolioTools(server: IToolHandler): Array<{ tool: ToolDefinition; handler: ToolHandler<any> }> {
      const tools: Array<{ tool: ToolDefinition; handler: ToolHandler<any> }> = [
        {
          tool: {
            name: "portfolio_status",
            description: "Check the status of your GitHub portfolio repository including repository existence, elements count, sync status, and configuration details.",
            inputSchema: {
              type: "object",
              properties: {
                username: {
                  type: "string",
                  description: "GitHub username to check portfolio for. If not provided, uses the authenticated user's username.",
                },
              },
            },
          },
          handler: (args: PortfolioStatusArgs) => server.portfolioStatus(args?.username)
        },
        {
          tool: {
            name: "init_portfolio",
            description: "Initialize a new GitHub portfolio repository for storing your DollhouseMCP elements. Creates the repository structure with proper directories and README.",
            inputSchema: {
              type: "object",
              properties: {
                repository_name: {
                  type: "string",
                  description: "Name for the portfolio repository. Defaults to 'dollhouse-portfolio' if not specified.",
                },
                private: {
                  type: "boolean",
                  description: "Whether to create a private repository. Defaults to false (public).",
                },
                description: {
                  type: "string",
                  description: "Repository description. Defaults to 'My DollhouseMCP element portfolio'.",
                },
              },
            },
          },
          handler: (args: InitPortfolioArgs) => server.initPortfolio({
            repositoryName: args?.repository_name,
            private: args?.private,
            description: args?.description
          })
        },
        {
          tool: {
            name: "portfolio_config",
            description: "Configure portfolio settings such as auto-sync preferences, default visibility, submission settings, and repository preferences.",
            inputSchema: {
              type: "object",
              properties: {
                auto_sync: {
                  type: "boolean",
                  description: "Whether to automatically sync local changes to GitHub portfolio.",
                },
                default_visibility: {
                  type: "string",
                  enum: ["public", "private"],
                  description: "Default visibility for new portfolio repositories.",
                },
                auto_submit: {
                  type: "boolean", 
                  description: "Whether to automatically submit elements to the collection when they're added to portfolio.",
                },
                repository_name: {
                  type: "string",
                  description: "Default repository name for new portfolios.",
                },
              },
            },
          },
          handler: (args: PortfolioConfigArgs) => server.portfolioConfig({
            autoSync: args?.auto_sync,
            defaultVisibility: args?.default_visibility,
            autoSubmit: args?.auto_submit,
            repositoryName: args?.repository_name
          })
        },
        {
          tool: {
            name: "sync_portfolio",
            description: "Sync ALL elements in your local portfolio with your GitHub repository. By default uses 'additive' mode which only adds new items and never deletes (safest). Use 'mirror' mode for exact sync (with deletion confirmations). Use 'backup' mode to treat GitHub as backup source. ALWAYS run with dry_run:true first to preview changes. For individual elements, use 'portfolio_element_manager' instead.",
            inputSchema: {
              type: "object",
              properties: {
                direction: {
                  type: "string",
                  enum: ["push", "pull", "both"],
                  description: "Sync direction: 'push' (upload to GitHub), 'pull' (download from GitHub), or 'both' (bidirectional sync). Defaults to 'push'.",
                },
                mode: {
                  type: "string",
                  enum: ["additive", "mirror", "backup"],
                  description: "Sync mode: 'additive' (default, only adds new items, never deletes), 'mirror' (makes exact match, requires confirmation for deletions), 'backup' (GitHub as backup, only pulls missing items locally). Defaults to 'additive' for safety.",
                },
                force: {
                  type: "boolean",
                  description: "Whether to force sync even if there are conflicts. Use with caution as this may overwrite changes. In 'mirror' mode, this skips deletion confirmations.",
                },
                dry_run: {
                  type: "boolean",
                  description: "Show what would be synced without actually performing the sync. RECOMMENDED to run with dry_run:true first to preview changes.",
                },
                confirm_deletions: {
                  type: "boolean",
                  description: "In 'mirror' mode, require explicit confirmation for each deletion. Defaults to true unless force:true is set.",
                },
              },
            },
          },
          handler: (args: SyncPortfolioArgs) => server.syncPortfolio({
            direction: args?.direction || 'push',
            mode: args?.mode || 'additive',
            force: args?.force || false,
            dryRun: args?.dry_run || false,
            confirmDeletions: args?.confirm_deletions !== false // Default true unless explicitly false
          })
        },
        {
          tool: {
            name: "search_portfolio",
            description: "Search your local portfolio by content name, metadata, keywords, tags, or description. This searches your local elements using the portfolio index for fast metadata-based lookups.",
            inputSchema: {
              type: "object",
              properties: {
                query: {
                  type: "string",
                  description: "Search query. Can match element names, keywords, tags, triggers, or descriptions. Examples: 'creative writer', 'debug', 'code review', 'research'.",
                },
                type: {
                  type: "string",
                  enum: ["personas", "skills", "templates", "agents", "memories", "ensembles"],
                  description: "Limit search to specific element type. If not specified, searches all types.",
                },
                fuzzy_match: {
                  type: "boolean",
                  description: "Enable fuzzy matching for approximate name matches. Defaults to true.",
                },
                max_results: {
                  type: "number",
                  description: "Maximum number of results to return. Defaults to 20.",
                },
                include_keywords: {
                  type: "boolean",
                  description: "Include keyword matching in search. Defaults to true.",
                },
                include_tags: {
                  type: "boolean",
                  description: "Include tag matching in search. Defaults to true.",
                },
                include_triggers: {
                  type: "boolean",
                  description: "Include trigger word matching in search (for personas). Defaults to true.",
                },
                include_descriptions: {
                  type: "boolean",
                  description: "Include description text matching in search. Defaults to true.",
                },
              },
              required: ["query"],
            },
          },
          handler: (args: SearchPortfolioArgs) => server.searchPortfolio({
            query: args.query,
            elementType: args.type as any,
            fuzzyMatch: args.fuzzy_match,
            maxResults: args.max_results,
            includeKeywords: args.include_keywords,
            includeTags: args.include_tags,
            includeTriggers: args.include_triggers,
            includeDescriptions: args.include_descriptions
          })
        },
        {
          tool: {
            name: "search_all",
            description: "Search across all available sources (local portfolio, GitHub portfolio, and collection) for elements. This provides unified search with duplicate detection and version comparison across all three tiers of the DollhouseMCP ecosystem.",
            inputSchema: {
              type: "object",
              properties: {
                query: {
                  type: "string",
                  description: "Search query. Can match element names, keywords, tags, triggers, or descriptions across all sources.",
                },
                sources: {
                  type: "array",
                  items: {
                    type: "string",
                    enum: ["local", "github", "collection"]
                  },
                  description: "Sources to search. Defaults to ['local', 'github']. Include 'collection' to search the community collection.",
                },
                type: {
                  type: "string",
                  enum: ["personas", "skills", "templates", "agents", "memories", "ensembles"],
                  description: "Limit search to specific element type. If not specified, searches all types.",
                },
                page: {
                  type: "number",
                  description: "Page number for pagination (1-based). Defaults to 1.",
                },
                page_size: {
                  type: "number",
                  description: "Number of results per page. Defaults to 20.",
                },
                sort_by: {
                  type: "string",
                  enum: ["relevance", "source", "name", "version"],
                  description: "Sort results by criteria. Defaults to 'relevance'.",
                },
              },
              required: ["query"],
            },
          },
          handler: (args: SearchAllArgs) => server.searchAll({
            query: args.query,
            sources: args.sources,
            elementType: args.type as any,
            page: args.page,
            pageSize: args.page_size,
            sortBy: args.sort_by as any
          })
        }
      ];
    
      return tools;
    }
  • Tool handler function for 'search_all' that maps arguments and calls server.searchAll
    handler: (args: SearchAllArgs) => server.searchAll({
      query: args.query,
      sources: args.sources,
      elementType: args.type as any,
      page: args.page,
      pageSize: args.page_size,
      sortBy: args.sort_by as any
    })
  • TypeScript interface defining input arguments for search_all tool
    interface SearchAllArgs {
      query: string;
      sources?: string[];
      type?: string;
      page?: number;
      page_size?: number;
      sort_by?: 'relevance' | 'source' | 'name' | 'version';
    }
  • JSON schema for input validation of search_all tool
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "Search query. Can match element names, keywords, tags, triggers, or descriptions across all sources.",
          },
          sources: {
            type: "array",
            items: {
              type: "string",
              enum: ["local", "github", "collection"]
            },
            description: "Sources to search. Defaults to ['local', 'github']. Include 'collection' to search the community collection.",
          },
          type: {
            type: "string",
            enum: ["personas", "skills", "templates", "agents", "memories", "ensembles"],
            description: "Limit search to specific element type. If not specified, searches all types.",
          },
          page: {
            type: "number",
            description: "Page number for pagination (1-based). Defaults to 1.",
          },
          page_size: {
            type: "number",
            description: "Number of results per page. Defaults to 20.",
          },
          sort_by: {
            type: "string",
            enum: ["relevance", "source", "name", "version"],
            description: "Sort results by criteria. Defaults to 'relevance'.",
          },
        },
        required: ["query"],
      },
    },
  • Registration of portfolio tools (including search_all) into ToolRegistry during server setup
    this.toolRegistry.registerMany(getPortfolioTools(instance));
  • Core unified search implementation across all sources (local, GitHub, collection) matching search_all parameters exactly - likely called by server.searchAll
    public async search(searchOptions: UnifiedSearchOptions): Promise<UnifiedSearchResult[]> {
      const startTime = Date.now();
      const memoryBefore = process.memoryUsage().heapUsed;
    
      // Normalize and validate search options
      const normalizedOptions = this.normalizeSearchOptions(searchOptions);
    
      // Log security audit event
      this.logSearchSecurityEvent(normalizedOptions, searchOptions);
    
      logger.debug('Starting optimized unified portfolio search', normalizedOptions);
    
      // Check cache first
      const cachedResult = await this.checkSearchCache(normalizedOptions, startTime, memoryBefore);
      if (cachedResult) {
        return cachedResult;
      }
    
      try {
        // Handle streaming search separately
        if (normalizedOptions.streamResults) {
          return await this.streamSearch(normalizedOptions);
        }
    
        // Perform priority-based search
        const { results, sourceCount, enabledSources } = await this.performPriorityBasedSearch(normalizedOptions);
    
        // Process, paginate, and cache results
        const finalResults = await this.processFinalResults(
          results,
          normalizedOptions,
          startTime,
          memoryBefore,
          sourceCount,
          enabledSources
        );
    
        return finalResults;
    
      } catch (error) {
        const duration = Date.now() - startTime;
        ErrorHandler.logError('UnifiedIndexManager.search', error, { query: normalizedOptions, duration });
        throw ErrorHandler.wrapError(error, 'Failed to perform unified portfolio search', ErrorCategory.SYSTEM_ERROR);
      }
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context about 'duplicate detection and version comparison' which isn't in the schema, but doesn't describe important behavioral aspects like whether this is a read-only operation, what permissions are needed, rate limits, or what the response format looks like (especially problematic since there's no output schema).

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 perfectly concise - two sentences with zero waste. The first sentence states the core purpose, and the second sentence adds valuable differentiating context about unified search features. Every word earns its place.

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?

Given the tool's complexity (6 parameters, no annotations, no output schema), the description is incomplete. While it explains the unified search concept well, it doesn't address critical missing information: no output format description, no behavioral constraints, and no guidance on result interpretation despite mentioning 'duplicate detection and version comparison' - leaving the agent guessing about what the tool actually returns.

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 all 6 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema - it mentions searching 'elements' generally but doesn't elaborate on parameter usage or interactions. The baseline of 3 is appropriate when the schema does all the parameter documentation work.

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 tool's purpose with specific verbs ('search across all available sources') and resources ('local portfolio, GitHub portfolio, and collection'), and explicitly distinguishes it from siblings by mentioning 'unified search with duplicate detection and version comparison across all three tiers' - making it distinct from tools like search_portfolio or search_collection.

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

Usage Guidelines4/5

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

The description provides clear context about when to use this tool ('Search across all available sources') and what it offers ('unified search with duplicate detection and version comparison'), but doesn't explicitly state when NOT to use it or name specific alternatives among the many sibling search tools (like search_portfolio, search_collection, search_by_verb).

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/DollhouseMCP'

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