Skip to main content
Glama

browse_collection

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

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

  • Core implementation of browseCollection logic: uses index first, falls back to GitHub API, then cache. Filters for MCP-supported types.
    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);
      }
    }
  • Input schema and description for the browse_collection tool.
    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'.",
          },
        },
      },
    },
  • Tool definition and handler registration returned by getCollectionTools().
    {
      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)
    },
  • Registers the collection tools (including browse_collection) in the MCP tool registry.
    this.toolRegistry.registerMany(getCollectionTools(instance));
  • Helper function to format browse results into user-friendly Markdown with navigation and install instructions.
    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('');
    }
Behavior2/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 of behavioral disclosure. It describes the tool as a 'browse' operation, which implies read-only access, but doesn't explicitly state whether it's safe, requires authentication, has rate limits, or what the output format looks like. The mention of 'content types' adds some context, but critical behavioral traits like pagination, error handling, or data freshness are missing.

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 reasonably concise with three sentences. The first sentence clearly states the purpose, the second enumerates content types, and the third clarifies the 'personas' type. There's no wasted text, and it's front-loaded with the core functionality. However, the second sentence could be slightly more streamlined by integrating the content type list more seamlessly.

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 moderate complexity (2 parameters, no output schema, no annotations), the description is partially complete. It covers the purpose and parameters adequately but lacks details on behavioral aspects (e.g., output format, error cases) and usage differentiation from siblings. Without annotations or output schema, more context on what the tool returns and how to interpret results would improve completeness.

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?

The input schema has 100% description coverage, with clear parameter definitions (section and type). The description adds marginal value by listing examples of content types (personas, skills, agents, templates) and clarifying that 'personas' is a specific type, but doesn't provide additional syntax, format details, or constraints beyond what's in the schema. With high schema coverage, the baseline score of 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: 'Browse content from the DollhouseMCP collection by section and content type.' It specifies the verb ('browse'), resource ('content from the DollhouseMCP collection'), and key parameters (section and content type). However, it doesn't explicitly differentiate from sibling tools like 'search_collection' or 'get_collection_content', which likely have overlapping functionality.

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 listing content types (personas, skills, agents, templates) and clarifying that 'personas' refers to a specific type. It also hints at parameter usage (e.g., type is only used when section is 'library'). However, it lacks explicit guidance on when to use this tool versus alternatives like 'search_collection' or 'get_collection_content', and doesn't mention prerequisites or exclusions.

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