Skip to main content
Glama
fkesheh
by fkesheh

read_skill_file

View the complete contents of files within skill directories, including scripts, configuration files, and documentation, to examine file structure and content before modification or execution.

Instructions

Read and display the complete content of a specific file within a skill directory.

This tool allows you to view the contents of any file in a skill. Use this to:

  • Read Python scripts, data files, configuration files, etc.

  • Examine file contents before modifying them

  • Check file format and structure before running scripts

  • View documentation or data files

Parameters:

  • skill_name: The name of the skill directory (e.g., 'my-skill')

  • file_path: Relative path to the file within the skill directory (e.g., 'scripts/process.py', 'data/input.csv', 'README.md')

Important: file_path is relative to the skill's root directory, not the skills directory. Use forward slashes even on Windows.

Returns: The complete file content as text. If the file is very large, it will be truncated with a message indicating truncation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesRelative path to the file within the skill directory (e.g., 'SKILL.md' or 'scripts/process.py')
skill_nameYesName of the skill

Implementation Reference

  • Pydantic input schema for the read_skill_file tool, defining skill_name and file_path parameters.
    class ReadSkillFileInput(BaseModel): """Input for reading a skill file.""" skill_name: str = Field(description="Name of the skill") file_path: str = Field( description="Relative path to the file within the skill directory (e.g., 'SKILL.md' or 'scripts/process.py')" )
  • Supporting utility function that reads the content of a skill file, matching the tool's expected logic with validation for path, existence, and size.
    def read_file(skill_name: str, file_path: str) -> str: """ Read content of a skill file. Args: skill_name: Name of the skill file_path: Relative path to the file Returns: File content as string Raises: InvalidPathError: If path is invalid FileNotFoundError: If file doesn't exist FileTooBigError: If file exceeds size limit """ full_path = validate_path(skill_name, file_path) if not full_path.exists(): raise FileNotFoundError(f"File '{file_path}' does not exist in skill '{skill_name}'") if not full_path.is_file(): raise FileNotFoundError(f"'{file_path}' is not a file") file_size = full_path.stat().st_size if file_size > MAX_FILE_SIZE: raise FileTooBigError( f"File too large ({file_size / 1024:.1f} KB). " f"Maximum size is {MAX_FILE_SIZE / 1024:.1f} KB." ) return full_path.read_text()

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/fkesheh/skill-mcp'

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