> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Filesystem

> Read files from a scoped local directory.

Read files from a scoped local directory. The provider exposes one tool: `query_fs` for searching and reading files.

```python theme={null}
from agno.agent import Agent
from agno.context.fs import FilesystemContextProvider

fs = FilesystemContextProvider(root="./docs")

agent = Agent(
    model=...,
    tools=fs.get_tools(),
)

agent.print_response("What topics are covered in the documentation?")
```

The agent calls `query_fs("documentation topics")`. A sub-agent handles file listing, searching, and reading.

## Configuration

| Parameter          | Type          | Default   | Description                                                            |
| ------------------ | ------------- | --------- | ---------------------------------------------------------------------- |
| `root`             | `str \| Path` | required  | Directory to scope the provider to.                                    |
| `id`               | `str`         | `"fs"`    | Tool becomes `query_<id>`.                                             |
| `exclude_patterns` | `list[str]`   | `None`    | Glob patterns to exclude (e.g., `["*.pyc", "__pycache__"]`).           |
| `model`            | `Model`       | `None`    | Model for the sub-agent.                                               |
| `mode`             | `ContextMode` | `default` | `default` or `agent` expose `query_fs`. `tools` exposes raw FileTools. |

## Tools Exposed

| Tool       | Description                                                      |
| ---------- | ---------------------------------------------------------------- |
| `query_fs` | Search files, read content, list directory structure. Read-only. |

<Note>
  FilesystemContextProvider is read-only. There is no `update_fs` tool.
</Note>

## Example queries

| Query                                        | What happens              |
| -------------------------------------------- | ------------------------- |
| "What files are in this project?"            | Lists directory structure |
| "Find all Python files that import requests" | Searches file content     |
| "Read the README"                            | Returns file content      |

## Resources

<CardGroup cols={2}>
  <Card title="FileTools Reference" icon="wrench" href="/tools/toolkits/local/file">
    Underlying toolkit methods
  </Card>

  <Card title="Cookbook Example" icon="book" href="https://github.com/agno-agi/agno/blob/main/cookbook/12_context/00_filesystem.py">
    Working example
  </Card>
</CardGroup>
