Skip to main content
Glama

get_skill_details

Retrieve detailed information about AI skills including documentation content, file paths, and directory structure to understand skill capabilities and resources.

Instructions

Get detailed information about a specific skill.

This tool provides the full SKILL.md content and/or file path, along with a recursive list of all files contained within the skill's directory. LLMs should use get_skill_related_file() to read the content of specific files.

Parameters

skill_name : str The name of the skill (from get_available_skills). return_type : str Type of data to return: "content" (default), "file_path", or "both". - "content": Returns only the SKILL.md content as text - "file_path": Returns only the absolute path to SKILL.md - "both": Returns both content and file path in a dict

Returns

dict[str, any] Dictionary containing: - skill_content: Full text or path of SKILL.md (based on return_type) - files: List of relative file paths in the skill directory

Raises

ValueError If the skill is not found or return_type is invalid.

Examples

details = get_skill_details("single-cell-rna-qc", return_type="content") print(details["files"]) ['SKILL.md', 'scripts/qc_analysis.py', ...]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
skill_nameYes
return_typeNoboth

Implementation Reference

  • The main handler function for the 'get_skill_details' tool. It is decorated with @mcp_server.tool(), fetches skill content and file list using SkillParser, and returns them based on the return_type.
    def get_skill_details(skill_name: str, return_type: str = "both") -> dict[str, any]:
        """Get detailed information about a specific skill.
    
        This tool provides the full SKILL.md content and/or file path, along with a recursive
        list of all files contained within the skill's directory. LLMs should use
        get_skill_related_file() to read the content of specific files.
    
        Parameters
        ----------
        skill_name : str
            The name of the skill (from get_available_skills).
        return_type : str
            Type of data to return: "content" (default), "file_path", or "both".
            - "content": Returns only the SKILL.md content as text
            - "file_path": Returns only the absolute path to SKILL.md
            - "both": Returns both content and file path in a dict
    
        Returns
        -------
        dict[str, any]
            Dictionary containing:
            - skill_content: Full text or path of SKILL.md (based on return_type)
            - files: List of relative file paths in the skill directory
    
        Raises
        ------
        ValueError
            If the skill is not found or return_type is invalid.
    
        Examples
        --------
        >>> details = get_skill_details("single-cell-rna-qc", return_type="content")
        >>> print(details["files"])
        ['SKILL.md', 'scripts/qc_analysis.py', ...]
        """
        try:
            skill_content = skill_parser.get_skill_content(skill_name, return_type=return_type)
            files = skill_parser.list_skill_files(skill_name, relative=True)
    
            return {
                "skill_content": skill_content,
                "files": files,
            }
        except ValueError as e:
            raise ValueError(f"Error getting skill details: {e}") from e
  • Registers the skill tools (including get_skill_details) by calling register_skill_tools on the MCP server instance.
    from skill_to_mcp.tools._skills import register_skill_tools
    
    register_skill_tools(mcp_server, skills_dir)
  • Helper method in SkillParser that retrieves the SKILL.md content or path for a given skill_name, called by the tool handler.
    def get_skill_content(
        self, skill_name: str, return_type: str = "both"
    ) -> "str | dict[str, str]":
        """Get the full content of a SKILL.md file by skill name.
    
        Parameters
        ----------
        skill_name : str
            Name of the skill.
        return_type : str
            Type of data to return: "content", "file_path", or "both" (default).
    
        Returns
        -------
        str | dict[str, str]
            If return_type is "content": Full content of the SKILL.md file.
            If return_type is "file_path": Absolute path to the SKILL.md file.
            If return_type is "both": Dictionary with "content" and "file_path" keys.
    
        Raises
        ------
        ValueError
            If skill is not found or return_type is invalid.
        """
        if return_type not in ("content", "file_path", "both"):
            raise ValueError(f"Invalid return_type: {return_type}. Must be 'content', 'file_path', or 'both'")
    
        skills = self.find_all_skills()
        for skill in skills:
            if skill.name == skill_name:
                skill_md_path = skill.skill_path / "SKILL.md"
    
                if return_type == "content":
                    return skill_md_path.read_text(encoding="utf-8")
                elif return_type == "file_path":
                    return str(skill_md_path.resolve())
                else:  # both
                    return {
                        "content": skill_md_path.read_text(encoding="utf-8"),
                        "file_path": str(skill_md_path.resolve()),
                    }
    
        raise ValueError(f"Skill '{skill_name}' not found")
  • Helper method in SkillParser that lists all files in the skill directory recursively, called by the tool handler.
    def list_skill_files(self, skill_name: str, relative: bool = True) -> "list[str]":
        """List all files in a skill directory recursively.
    
        Parameters
        ----------
        skill_name : str
            Name of the skill.
        relative : bool
            If True, return paths relative to skill directory. Default: True.
    
        Returns
        -------
        list[str]
            List of file paths in the skill directory.
    
        Raises
        ------
        ValueError
            If skill is not found.
        """
        skills = self.find_all_skills()
        for skill in skills:
            if skill.name == skill_name:
                files = []
                for file_path in skill.skill_path.rglob("*"):
                    if file_path.is_file():
                        if relative:
                            rel_path = file_path.relative_to(skill.skill_path)
                            files.append(str(rel_path))
                        else:
                            files.append(str(file_path))
                return sorted(files)
    
        raise ValueError(f"Skill '{skill_name}' not found")

Tool Definition Quality

Score is being calculated. Check back soon.

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/biocontext-ai/skill-to-mcp'

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