Skip to main content
Glama
DollhouseMCP

DollhouseMCP

Official

browse_collection

Browse and explore AI behavioral profiles, skills, agents, and templates in the DollhouseMCP collection by section and content type to manage dynamic AI personas.

Instructions

Browse content from the DollhouseMCP collection by section and content type. Content types include personas (AI behavioral profiles), skills, agents, and templates. When users ask for 'personas', they're referring to content in the personas type.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sectionNoCollection section to browse (library, showcase, catalog). Leave empty to see all sections.
typeNoContent type within the library section: personas, skills, agents, templates, or memories. Only used when section is 'library'.

Implementation Reference

  • Registration of the browse_collection tool, including its description, inputSchema for parameters (section, type), and handler lambda delegating to server.browseCollection
    {
      tool: {
        name: "browse_collection",
        description: "Browse content from the DollhouseMCP collection by section and content type. Content types include personas (AI behavioral profiles), skills, agents, and templates. When users ask for 'personas', they're referring to content in the personas type.",
        inputSchema: {
          type: "object",
          properties: {
            section: {
              type: "string",
              description: "Collection section to browse (library, showcase, catalog). Leave empty to see all sections.",
            },
            type: {
              type: "string",
              description: "Content type within the library section: personas, skills, agents, templates, or memories. Only used when section is 'library'.",
            },
          },
        },
      },
      handler: (args: any) => server.browseCollection(args?.section, args?.type)
    },
    {
  • Core handler logic for browsing the collection: prioritizes index, falls back to GitHub API fetch, then cache/seed data. Filters for MCP-supported types and formats directory listings.
     */
    async browseCollection(section?: string, type?: string): Promise<{ items: any[], categories: any[], sections?: any[] }> {
      try {
        // Try using collection index first for faster browsing
        const indexResult = await this.browseFromIndex(section, type);
        if (indexResult) {
          logger.debug('Used collection index for browsing');
          return indexResult;
        }
        
        // Fallback to GitHub API
        let url = this.baseUrl;
        
        // If no section provided, show top-level sections
        if (!section) {
          const data = await this.githubClient.fetchFromGitHub(url, false);
          if (!Array.isArray(data)) {
            throw new Error('Invalid collection response. Expected directory listing.');
          }
          
          // Filter to only show content directories
          const sections = data.filter((item: any) => 
            item.type === 'dir' && ['library', 'showcase', 'catalog'].includes(item.name)
          );
          
          return { items: [], categories: [], sections };
        }
        
        // Browse within a section
        url = type 
          ? `${this.baseUrl}/${section}/${type}` 
          : `${this.baseUrl}/${section}`;
        
        const data = await this.githubClient.fetchFromGitHub(url, false);
        
        if (!Array.isArray(data)) {
          throw new Error('Invalid collection response. Expected directory listing.');
        }
        
        // In the library section, we have content type directories
        if (section === 'library' && !type) {
          // Filter to only show MCP-supported content types
          const contentTypes = data.filter((item: any) => {
            if (item.type !== 'dir') return false;
            const elementType = isElementType(item.name) ? item.name as ElementType : null;
            return elementType && isMCPSupportedType(elementType);
          });
          return { items: [], categories: contentTypes };
        }
        
        // For library content types, show files directly (flat structure)
        const items = data.filter((item: any) => item.type === 'file' && item.name.endsWith('.md'));
        // For non-library sections, they might still have subdirectories
        const categories = section === 'library' ? [] : data.filter((item: any) => item.type === 'dir');
        
        return { items, categories };
      } catch (error) {
        logger.debug(`GitHub API browse failed, falling back to cache: ${error}`);
        
        // Fallback to cached data
        return this.browseFromCache(section, type);
      }
    }
  • Helper method to format browse results into readable Markdown with navigation commands for sections, types, and individual items.
     */
    formatBrowseResults(items: any[], categories: any[], section?: string, type?: string, personaIndicator: string = ''): string {
      const textParts = [`${personaIndicator}🏪 **DollhouseMCP Collection**\n\n`];
      
      // Show top-level sections if no section specified
      if (!section && categories.length > 0) {
        textParts.push(`**📚 Collection Sections (${categories.length}):**\n`);
        categories.forEach((sec: any) => {
          const sectionIcons: { [key: string]: string } = {
            'library': '📖',
            'showcase': '⭐',
            'catalog': '💎'
          };
          const icon = sectionIcons[sec.name] || '📁';
          const descriptions: { [key: string]: string } = {
            'library': 'Free community content',
            'showcase': 'Featured high-quality content (coming soon)',
            'catalog': 'Premium content (coming soon)'
          };
          textParts.push(
            `   ${icon} **${sec.name}** - ${descriptions[sec.name] || 'Content collection'}\n`,
            `      Browse: \`browse_collection "${sec.name}"\`\n\n`
          );
        });
        return textParts.join('');
      }
      
      // Show content types within library section
      if (section === 'library' && !type && categories.length > 0) {
        textParts.push(`**📖 Library Content Types (${categories.length}):**\n`);
        categories.forEach((cat: any) => {
          const typeIcons: { [key: string]: string } = {
            'personas': '🎭',
            'skills': '🛠️',
            'agents': '🤖',
            'templates': '📄',
            'ensembles': '🎼',
            'memories': '🧠'
          };
          const icon = typeIcons[cat.name] || '📁';
          textParts.push(`   ${icon} **${cat.name}** - Browse: \`browse_collection "library" "${cat.name}"\`\n`);
        });
        textParts.push('\n');
      } else if (categories.length > 0) {
        // Only show category navigation for non-library sections (showcase, catalog)
        textParts.push(`**📁 Subdirectories in ${section}${type ? `/${type}` : ''} (${categories.length}):**\n`);
        categories.forEach((cat: any) => {
          const browsePath = type ? `"${section}" "${type}/${cat.name}"` : `"${section}" "${cat.name}"`;
          textParts.push(`   📂 **${cat.name}** - Browse: \`browse_collection ${browsePath}\`\n`);
        });
        textParts.push('\n');
      }
      
      if (items.length > 0) {
        const contentType = type || 'content';
        const contentIcons: { [key: string]: string } = {
          'personas': '🎭',
          'skills': '🛠️',
          'agents': '🤖',
          'templates': '📄',
          'ensembles': '🎼',
          'memories': '🧠'
        };
        const icon = contentIcons[contentType] || '📄';
        
        textParts.push(`**${icon} ${contentType.charAt(0).toUpperCase() + contentType.slice(1)} in ${section}${type ? `/${type}` : ''} (${items.length}):**\n`);
        items.forEach((item: any) => {
          // Use item.path for correct GitHub file path, item.name for display
          // This fixes the mismatch where browse returned "Code Review.md" but file is "code-review.md"
          const fullPath = item.path || (section + (type ? `/${type}` : '') + `/${item.name}`);
          const displayName = item.name.replace('.md', '');
          textParts.push(
            `   ▫️ **${displayName}**\n`,
            `      📥 Install: \`install_collection_content "${fullPath}"\`\n`,
            `      👁️ Details: \`get_collection_content "${fullPath}"\`\n\n`
          );
        });
      }
      
      return textParts.join('');
    }
  • Registers all collection tools (including browse_collection) via ToolRegistry during server setup.
    // Register collection tools
    this.toolRegistry.registerMany(getCollectionTools(instance));
  • Input schema definition for browse_collection tool parameters: optional section (library, showcase, catalog) and type (personas, skills, etc.).
    inputSchema: {
      type: "object",
      properties: {
        section: {
          type: "string",
          description: "Collection section to browse (library, showcase, catalog). Leave empty to see all sections.",
        },
        type: {
          type: "string",
          description: "Content type within the library section: personas, skills, agents, templates, or memories. Only used when section is 'library'.",
        },
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions browsing by section and type but doesn't disclose key behaviors like whether this is a read-only operation, if it requires authentication, what the output format is, or any rate limits. This leaves significant uncertainty for an agent.

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 appropriately concise with two sentences that directly address the tool's function. It front-loads the core purpose and adds a clarification about 'personas', with no wasted words, though it could be slightly more structured for optimal clarity.

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?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., list of items, metadata), how results are formatted, or any behavioral constraints. For a browsing tool with 2 parameters, this leaves the agent under-informed about execution outcomes.

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 both parameters thoroughly. The description adds minimal value by listing content types and clarifying 'personas', but doesn't provide additional semantics beyond what's in the schema descriptions, resulting in a baseline score.

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: 'Browse content from the DollhouseMCP collection by section and content type.' It specifies the verb (browse) and resource (DollhouseMCP collection). However, it doesn't explicitly differentiate from sibling tools like 'search_collection' or 'get_collection_content', which limits the score.

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

Usage Guidelines3/5

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

The description provides some implied usage context by mentioning content types and clarifying that 'personas' refers to a specific type. However, it lacks explicit guidance on when to use this tool versus alternatives like search tools or when parameters are required, leaving gaps in decision-making.

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