Skip to content

Commit c2525fe

Browse files
authored
Merge pull request #279 from tcdent/issue-267
Fix URL to file_read tool and extend docs
2 parents bd2d01a + d0f7b7c commit c2525fe

2 files changed

Lines changed: 32 additions & 2 deletions

File tree

agentstack/_tools/file_read/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"category": "computer-control",
44
"tools": ["read_file"],
55
"description": "Read contents of files",
6-
"url": "https://github.com/AgentOps-AI/AgentStack/tree/main/agentstack/tools/file_read",
6+
"url": "https://docs.agentstack.sh/tools/tool/file_read",
77
"dependencies": []
88
}

docs/tools/tool/file_read.mdx

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,38 @@ title: 'File Read'
33
description: 'Enables agents to read files stored locally'
44
---
55

6+
# File Read
7+
8+
This tool allows agents to read files stored locally on the system.
9+
610
## Installation
711

12+
To install the File Read tool, run the following command:
13+
814
```bash
915
agentstack tools add file_read
10-
```
16+
```
17+
18+
## Functions
19+
20+
### `file_read.read_file(file_path: str) -> str`
21+
22+
Reads the contents of a file at the given path.
23+
24+
#### Parameters:
25+
- `file_path` (str): Path to the file to read
26+
27+
#### Returns:
28+
- `str`: The contents of the file as a string
29+
30+
#### Raises:
31+
- `FileNotFoundError`: If the file does not exist
32+
- `PermissionError`: If the file cannot be accessed
33+
- `Exception`: For other file reading errors
34+
35+
36+
## Notes
37+
38+
- The agent has access to the local file system.
39+
- Ensure that the agent has the necessary permissions to read the file.
40+
- Large files may consume significant memory when read entirely into a string.

0 commit comments

Comments
 (0)