Skip to main content
Glama

get_collection_content

Retrieve detailed information about AI personas or other content types from a collection. Specify the path to access specific elements like 'library/personas/creative-writer.md' for tailored insights.

Instructions

Get detailed information about content from the collection. Use this when users ask to 'see details about a persona' or 'show me the creative writer persona'. Personas are a type of content that defines AI behavioral profiles.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe collection path to the AI customization element. Format: 'library/[type]/[element].md' where type is personas, skills, templates, or agents. Example: 'library/skills/code-review.md'.

Implementation Reference

  • Registers the 'get_collection_content' tool in the tool registry, including name, description, input schema requiring 'path', and a handler that delegates to server.getCollectionContent(args.path). This is where the tool is made available to MCP.
    tool: { name: "get_collection_content", description: "Get detailed information about content from the collection. Use this when users ask to 'see details about a persona' or 'show me the creative writer persona'. Personas are a type of content that defines AI behavioral profiles.", inputSchema: { type: "object", properties: { path: { type: "string", description: "The collection path to the AI customization element. Format: 'library/[type]/[element].md' where type is personas, skills, templates, agents, or memories. Example: 'library/skills/code-review.md'.", }, }, required: ["path"], }, }, handler: (args: any) => server.getCollectionContent(args.path) },
  • Core handler logic: Fetches file content from DollhouseMCP/collection GitHub repo via GitHubClient, decodes base64, sanitizes content, securely parses YAML frontmatter, validates metadata security, returns metadata and body content. This executes the tool's primary function.
    async getCollectionContent(path: string): Promise<{ metadata: PersonaMetadata; content: string }> { const url = `${this.baseUrl}/${path}`; const data = await this.githubClient.fetchFromGitHub(url); if (data.type !== 'file') { throw new Error('Path does not point to a file'); } // Decode Base64 content const content = Buffer.from(data.content, 'base64').toString('utf-8'); // Sanitize content for display (this is view-only, not installation) const sanitizedContent = ContentValidator.sanitizePersonaContent(content); // Use secure YAML parser let parsed; try { parsed = SecureYamlParser.safeMatter(sanitizedContent); } catch (error) { if (error instanceof SecurityError) { throw new Error(`Security warning: This content contains potentially malicious content - ${error.message}`); } throw error; } const metadata = parsed.data as PersonaMetadata; // Additional validation for display const metadataValidation = ContentValidator.validateMetadata(metadata); if (!metadataValidation.isValid && metadataValidation.severity === 'critical') { throw new Error(`Security warning: This content contains potentially malicious content`); } return { metadata, content: parsed.content }; }
  • Zod schema defining input arguments for the tool: an object with required 'path' string describing the collection file path.
    export const GetCollectionContentArgsSchema = z.object({ path: z.string().describe("Path to the content file in the collection repository") });
  • IToolHandler interface definition for getCollectionContent method, used by the tool handler lambda.
    getCollectionContent(path: string): 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