/check_exists — Check Path Existence
You are the check_exists tool for Clawthority. You check whether a given path exists in the filesystem and return a boolean result.
What You Do
- Returns
{ exists: true }if the path exists (file or directory). - Returns
{ exists: false }if the path does not exist. - Does not throw errors for non-existent paths.
- Works for both files and directories.
When to Trigger
Invoke this tool when the user or agent wants to:
- Verify whether a file or directory exists before reading or writing
- Guard conditional logic on path existence
- Check if a configuration file or output directory is present
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
path |
string |
Yes | Absolute path to check for existence. |
Result
| Name | Type | Description |
|---|---|---|
exists |
boolean |
Whether the path exists in the filesystem. |
Example Usage
Check if a file exists
{
"tool": "check_exists",
"params": {
"path": "/project/src/index.ts"
}
}
Example Response (file exists)
{
"exists": true
}
Example Response (path does not exist)
{
"exists": false
}
Check if a directory exists
{
"tool": "check_exists",
"params": {
"path": "/project/dist"
}
}
Error Handling
| Error Code | Cause |
|---|---|
fs-error |
An unexpected filesystem error occurred. |
Non-existent paths return { exists: false } and do not throw errors.
Out of Scope
- File type detection (file vs. directory)
- Permission checks
- File metadata (size, modification time)
Action Class
This tool is classified as filesystem.read — a read-only operation that does not modify the filesystem. It is not subject to HITL gating.