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")
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions reading existing files but fails to detail critical aspects such as permissions required, whether it's a safe read operation, potential rate limits, or the format of returned data. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that efficiently states the action and purpose without unnecessary words. It is front-loaded with the core function, though it could be slightly more structured by separating the action from the intent for clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It does not explain what the tool returns (e.g., file list, content, metadata) or any behavioral traits like error handling. For a tool with no structured data support, more context is needed to guide effective usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter information is needed. The description does not add any parameter details, which is acceptable in this case, as there are no parameters to document, aligning with the baseline for zero parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool reads existing files from the project directory, which clarifies the verb (read) and resource (files). However, it's vague about the purpose ('to see what findings and data have been saved'), lacking specificity on what types of files or data are involved, and does not distinguish it from sibling tools like 'read_files' or 'spider_smb_shares'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is provided on when to use this tool versus alternatives. The description implies usage for viewing saved findings and data, but it doesn't specify contexts, prerequisites, or exclusions, leaving the agent without clear direction compared to other file-related tools in the sibling list.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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

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