Skip to content

[`agentic_crew.tools.file_tools`](#module-agentic_crew.tools.file_tools)

File manipulation tools for CrewAI agents.

These tools enable agents to read and write code to specific directories in game package codebases (e.g., packages/otterfall).

WriteFileInputInput schema for GameCodeWriterTool.
GameCodeWriterToolTool for writing code files to a game package codebase.
ReadFileInputInput schema for GameCodeReaderTool.
GameCodeReaderToolTool for reading code files from a game package codebase.
ListDirInputInput schema for DirectoryListTool.
DirectoryListToolTool for listing files in a directory.
_find_workspace_rootSearch upward for workspace root (contains pyproject.toml with workspace).
get_workspace_rootGet the workspace root directory for the target game code package.
ALLOWED_WRITE_DIRS
ALLOWED_EXTENSIONS

Search upward for workspace root (contains pyproject.toml with workspace).

Get the workspace root directory for the target game code package.

Returns packages/<package_name> as the workspace root, where the game code lives.

Uses marker file search to find workspace root reliably, regardless of where this module is installed or imported from.

Args: package_name: Name of the target package. If not provided, uses TARGET_PACKAGE environment variable, or defaults to “otterfall”.

Returns: Path to packages/<package_name> directory.

agentic_crew.tools.file_tools.ALLOWED_WRITE_DIRS

Section titled “agentic_crew.tools.file_tools.ALLOWED_WRITE_DIRS”

[‘src/ecs’, ‘src/ecs/data’, ‘src/ecs/systems’, ‘src/components’, ‘src/components/ui’, ‘src/stores’, …

agentic_crew.tools.file_tools.ALLOWED_EXTENSIONS

Section titled “agentic_crew.tools.file_tools.ALLOWED_EXTENSIONS”

None

class agentic_crew.tools.file_tools.WriteFileInput

Section titled “class agentic_crew.tools.file_tools.WriteFileInput”

Bases: pydantic.BaseModel

Input schema for GameCodeWriterTool.

‘Field(…)’

‘Field(…)’

class agentic_crew.tools.file_tools.GameCodeWriterTool

Section titled “class agentic_crew.tools.file_tools.GameCodeWriterTool”

Bases: crewai.tools.BaseTool

Tool for writing code files to a game package codebase.

This tool is restricted to specific directories to ensure agents only modify appropriate parts of the codebase.

‘Write Game Code File’

None

Write the file content to the specified path.

class agentic_crew.tools.file_tools.ReadFileInput

Section titled “class agentic_crew.tools.file_tools.ReadFileInput”

Bases: pydantic.BaseModel

Input schema for GameCodeReaderTool.

‘Field(…)’

class agentic_crew.tools.file_tools.GameCodeReaderTool

Section titled “class agentic_crew.tools.file_tools.GameCodeReaderTool”

Bases: crewai.tools.BaseTool

Tool for reading code files from a game package codebase.

Use this to understand existing patterns before writing new code.

‘Read Game Code File’

None

Read the file content from the specified path.

class agentic_crew.tools.file_tools.ListDirInput

Section titled “class agentic_crew.tools.file_tools.ListDirInput”

Bases: pydantic.BaseModel

Input schema for DirectoryListTool.

‘Field(…)’

class agentic_crew.tools.file_tools.DirectoryListTool

Section titled “class agentic_crew.tools.file_tools.DirectoryListTool”

Bases: crewai.tools.BaseTool

Tool for listing files in a directory.

Use this to discover existing files and understand project structure.

‘List Directory Contents’

None

List directory contents.