# createFilesystemMiddleware

> **Function** in `deepagents`

📖 [View in docs](https://reference.langchain.com/javascript/deepagents/middleware/createFilesystemMiddleware)

Create filesystem middleware with all tools and features.

## Signature

```javascript
createFilesystemMiddleware(options: FilesystemMiddlewareOptions = {}): AgentMiddleware<StateSchema<__type>, undefined, unknown, DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, string, unknown, "ls"> | DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, __type[] | __type[], unknown, "read_file"> | DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, string | ToolMessage<MessageStructure<MessageToolSet>> | Command<unknown, __type, string>, unknown, "write_file"> | DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, string | ToolMessage<MessageStructure<MessageToolSet>> | Command<unknown, __type, string>, unknown, "edit_file"> | DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, string, unknown, "glob"> | DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, string, unknown, "grep"> | DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, string, unknown, "execute">[], readonly []>
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `options` | `FilesystemMiddlewareOptions` | No |  (default: `{}`) |

## Returns

`AgentMiddleware<StateSchema<__type>, undefined, unknown, DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, string, unknown, "ls"> | DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, __type[] | __type[], unknown, "read_file"> | DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, string | ToolMessage<MessageStructure<MessageToolSet>> | Command<unknown, __type, string>, unknown, "write_file"> | DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, string | ToolMessage<MessageStructure<MessageToolSet>> | Command<unknown, __type, string>, unknown, "edit_file"> | DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, string, unknown, "glob"> | DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, string, unknown, "grep"> | DynamicStructuredTool<ZodObject<__type, $strip>, __type, __type, string, unknown, "execute">[], readonly []>`

---

[View source on GitHub](https://github.com/langchain-ai/deepagentsjs/blob/d879d1c979abc589c77489154f913db862d4d130/libs/deepagents/src/middleware/fs.ts#L1167)