skills_get_details
Retrieve documentation and file structure for installed skills to understand their functionality and usage instructions.
Instructions
Read the instruction manual (SKILL.md) and file structure of a locally installed skill. Use this to learn how to use a skill after installing it.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the installed skill |
Implementation Reference
- src/skills_mcp/server.py:65-87 (handler)Handler function for the 'skills_get_details' tool, registered via @mcp.tool(). Retrieves and formats skill details including path, file tree, and instructions.@mcp.tool() def skills_get_details( name: str = Field(description="Name of the installed skill") ) -> str: """ Read the instruction manual (SKILL.md) and file structure of a locally installed skill. Use this to learn how to use a skill after installing it. """ try: details = local.get_details(name) return f"""# Skill: {name} Path: {details['path']} ## File Structure ``` {details['tree']} ``` ## Instructions {details['instruction']} """ except Exception as e: return f"Error getting details: {str(e)}"
- src/skills_mcp/local.py:31-44 (helper)Supporting function that provides the core logic for fetching skill path, file tree, and instruction content, called by the tool handler.def get_details(name: str) -> Dict[str, str]: target_dir = config.root_dir / name if not target_dir.exists(): raise FileNotFoundError(f"Skill '{name}' is not installed locally.") skill_md = target_dir / "SKILL.md" if not skill_md.exists(): raise FileNotFoundError(f"Corrupted skill '{name}': SKILL.md missing.") return { "path": str(target_dir), "tree": generate_tree(target_dir), "instruction": skill_md.read_text(encoding="utf-8") }
- src/skills_mcp/utils.py:20-47 (helper)Utility to generate a filtered directory tree string for the skill folder, used in local.get_details.def generate_tree(root_path: Path) -> str: """Generates a visual file tree string, filtering out noise.""" output = [] # Walk the directory for dirpath, dirnames, filenames in os.walk(root_path): # 1. In-place filtering of directories to prevent recursion into ignored dirs dirnames[:] = [d for d in dirnames if d not in IGNORED_DIRS and not d.startswith(".")] rel_path = Path(dirpath).relative_to(root_path) if rel_path == Path("."): level = 0 else: level = len(rel_path.parts) indent = " " * (level - 1) output.append(f"{indent}- {rel_path.name}/") sub_indent = " " * level for f in sorted(filenames): if f in IGNORED_FILES or f.startswith("."): continue if any(f.endswith(ext) for ext in IGNORED_EXTENSIONS): continue output.append(f"{sub_indent}- {f}") return "\n".join(output)