Lists the files and subdirectories in a specific path. Useful for exploring the project structure.
AI agents call list_directory_contents to retrieve information from Code Context Manager without modifying anything — typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
This tool retrieves and queries directory structure information with no side effects or ability to modify, execute, or delete data. It falls squarely into the Read category as a passive exploration capability. The low severity reflects minimal blast radius if misused—an agent could enumerate sensitive paths but cannot access file contents, execute code, or alter the filesystem.
From the tool's definition Tool name 'list_directory_contents' and description 'Lists the files and subdirectories in a specific path' indicate a read-only operation that retrieves filesystem metadata without modification, deletion, or execution.
Attacks that exploit this kind of access
Lists the files and subdirectories in a specific path. Useful for exploring the project structure. It is categorised as a Read tool in the Code Context Manager MCP Server, which means it retrieves data without modifying state.
Register the Code Context Manager MCP server in PolicyLayer and add a rule for list_directory_contents: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Code Context Manager. Nothing to install.
list_directory_contents is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the list_directory_contents rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for list_directory_contents. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
list_directory_contents is provided by the Code Context Manager MCP server (theraaz/code-context-manager-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
list_directory_contents is one line of Code Context Manager's registry record.
The record carries the whole server: verified identity, auth posture, risk grade, every tool classified, recommended policy — re-checked continuously.
Teams ship this data inside their own products. See what a licence covers →