Skip to main content
Glama

get_skill_details

Retrieve detailed information about specific skills including documentation content, file paths, and directory structure to enable comprehensive skill analysis and file access.

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

NameRequiredDescriptionDefault
skill_nameYes
return_typeNoboth

Input Schema (JSON Schema)

{ "properties": { "return_type": { "default": "both", "type": "string" }, "skill_name": { "type": "string" } }, "required": [ "skill_name" ], "type": "object" }

Implementation Reference

  • The handler function for the 'get_skill_details' tool, decorated with @mcp_server.tool(). It fetches skill content and file list using SkillParser and returns them in a dictionary. The docstring provides input/output schema details.
    @mcp_server.tool() 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
  • Calls register_skill_tools to register the MCP tools, including 'get_skill_details', on the FastMCP 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, path, or both for a given skill_name, called by the 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 recursively in the skill directory, used by the 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")

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