Skip to main content
Glama

get_project_directory_files

Retrieve saved findings and data files from the project directory for security assessment review and analysis.

Instructions

read existing files from the project directory to see what findings and data have been saved

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_project_directory_files' tool. It lists all files and directories in the project directory (config.PROJECT_DIRECTORY), showing type (FILE/DIR), size, modified time, and name in a formatted table. Handles errors like non-existent directory.
    @mcp.tool(name="get_project_directory_files", description="read existing files from the project directory to see what findings and data have been saved") def get_project_directory_files(): try: project_path = Path(config.PROJECT_DIRECTORY) if not project_path.exists(): return f"Project directory does not exist: {project_path}" if not project_path.is_dir(): return f"Project path is not a directory: {project_path}" files_info = [] for item in project_path.iterdir(): stat = item.stat() file_type = "DIR" if item.is_dir() else "FILE" size = stat.st_size modified = datetime.fromtimestamp(stat.st_mtime).strftime("%Y-%m-%d %H:%M:%S") files_info.append(f"{file_type:<4} {size:>8} {modified} {item.name}") if not files_info: return f"Project directory is empty: {project_path}" header = f"Contents of {project_path}:\nTYPE SIZE MODIFIED NAME\n" + "-"*50 return header + "\n" + "\n".join(files_info) except Exception as e: return f"Error reading project directory: {str(e)}"
  • The @mcp.tool decorator registers the 'get_project_directory_files' function as an MCP tool with the specified name and description.
    @mcp.tool(name="get_project_directory_files", description="read existing files from the project directory to see what findings and data have been saved")

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/YoussefSahnoun/PentestMCP'

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