Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mblode/rubber-duck/llms.txt
Use this file to discover all available pages before exploring further.
read_file
Read the contents of a file from the workspace.Parameters
Path to the file, relative to workspace root or absolute. Accepts alternative keys:
file, filepath, file_path, filename.Returns
File contents as UTF-8 string, or an error message prefixed with
"Error: ".Behavior
- Resolves relative paths against the workspace root
- Validates path stays within workspace boundaries
- Rejects files larger than 1 MB
- Returns canonical error messages for missing files
Examples
Implementation Details
Fromvoice-tools.ts:236-272:
write_file
Create a new file or overwrite an existing file with the provided content.Parameters
Path to the file, relative to workspace root or absolute. Accepts alternative keys:
file, filepath, file_path, filename.UTF-8 content to write to the file.
Returns
Success message with byte count, or an error message prefixed with
"Error: ".Behavior
- Creates parent directories automatically using
mkdir -psemantics - Overwrites existing files without warning
- Validates path stays within workspace boundaries
- Returns error if safe mode is enabled
Examples
Implementation Details
Fromvoice-tools.ts:274-316:
edit_file
Make a targeted edit to an existing file using find-and-replace.Parameters
Path to the file, relative to workspace root or absolute. Accepts alternative keys:
file, filepath, file_path, filename.Exact text to find in the file. Accepts alternative keys:
oldText, find. Must match exactly once.Replacement text. Accepts alternative keys:
newText, replace.Returns
Success message, or an error message prefixed with
"Error: ".Behavior
- Requires exact match of
old_text(case-sensitive) - Rejects ambiguous edits if
old_textappears multiple times - Returns error if
old_textis not found - Atomic operation: writes only if validation passes
Examples
Implementation Details
Fromvoice-tools.ts:318-373:
Best Practices
Use edit_file for targeted changes
Use edit_file for targeted changes
Prefer
edit_file over write_file when making small modifications. This preserves file history and reduces risk of data loss.Include enough context in old_text
Include enough context in old_text
Make
old_text unique to avoid ambiguity errors. Include surrounding context if needed.Handle errors gracefully
Handle errors gracefully
Always check for
"Error: " prefix in results:Related Tools
Bash
Execute shell commands for complex file operations
Search
Find files before reading or editing them