diff --git a/src/pages/tools.astro b/src/pages/tools.astro index a836195..10a9293 100644 --- a/src/pages/tools.astro +++ b/src/pages/tools.astro @@ -5,8 +5,13 @@ import BaseLayout from '../layouts/BaseLayout.astro';
-
+
+
// TOOL_CALLS.md

@@ -15,29 +20,27 @@ import BaseLayout from '../layouts/BaseLayout.astro';

Complete reference for all tool calls available in Zaguán Blade. - These are the standard tools you can add to your Local AI system prompts. + Add these to your Local AI system prompts to enable file operations, search, editor control, and command execution.

+
+ NOTE + This does not cover Blade-specific or ZLP (Zaguán Language Protocol) tools. These are standard file/editor tools for general AI coding assistance. +
- -
+ +
- -

Overview

- -
-

- This document describes the regular tool calls that Zaguán Blade supports. These are the tools you can add to your Local AI system prompts to extend usability. -

- -
- ℹ️ -

- Note: This does not cover Blade-specific or ZLP (Zaguán Language Protocol) tools. These are standard file/editor tools for general AI coding assistance. -

-
+
@@ -45,208 +48,340 @@ import BaseLayout from '../layouts/BaseLayout.astro';
- +

File Operations

-
+
- read_file - FILE_READ +
+ read_file + READ +
+

Read the complete contents of a file.

+
Aliases: file_path, filepath, filename
-

Read the complete contents of a file.

- -
-

Parameters

- - -
pathstring (required)File path (relative to workspace or absolute)
-
- -
-

Example

-
{ "path": "src/main.rs" }
+
+
+

Parameters

+ + + + + +
NameTypeDescription
pathrequired stringFile path (relative to workspace or absolute)
+
+
+

Example

+
{ "path": "src/main.rs" }
+
- read_file_range - FILE_READ +
+ read_file_range + READ +
+

Read a specific line range from a file with optional context.

-

Read a specific line range from a file with optional context.

- -
-

Parameters

- - - - - -
pathstring (required)File path
start_lineinteger (optional)Start line (1-indexed, default: 1)
end_lineinteger (optional)End line (1-indexed, default: end of file)
context_linesinteger (optional)Extra context lines before/after range (default: 0)
-
- -
-

Example

-
{
+            
+
+

Parameters

+ + + + + + + + +
NameTypeDescription
pathrequired stringFile path
start_lineoptional integerStart line (1-indexed, default: 1)
end_lineoptional integerEnd line (1-indexed, default: end of file)
context_linesoptional integerExtra context lines before/after range (default: 0)
+
+
+

Example

+
{
   "path": "src/lib.rs",
   "start_line": 50,
   "end_line": 100,
   "context_lines": 3
-}
+}
+
- write_file - FILE_WRITE +
+ write_file + / + create_file + WRITE +
+

Write content to a file. Creates parent directories if needed.

+
Content aliases: contents, text, data
-

Write content to a file. Creates parent directories if needed.

- -
-

Parameters

- - - -
pathstring (required)File path
contentstring (required)Content to write
-
- -
-

Example

-
{
+            
+
+

Parameters

+ + + + + + +
NameTypeDescription
pathrequired stringFile path
contentrequired stringContent to write
+
+
+

Example

+
{
   "path": "src/new_module.rs",
-  "content": "pub fn hello() {\n    println!(\"Hello!\");\n}\n"
-}
+ "content": "pub fn hello() {\n println!(\"Hello!\");\n}\n" +}
+
+
+
+ + +
+
+
+ edit_file + EDIT + LEGACY +
+

Apply a search/replace edit to a file (legacy tool).

+
Aliases: old/from for old_content, new/to for new_content
+
+
+
+

Parameters

+ + + + + + + +
NameTypeDescription
pathrequired stringFile path
old_contentrequired stringText to find
new_contentrequired stringReplacement text
+
+
+

Example

+
{
+  "path": "src/main.rs",
+  "old_content": "fn old_function()",
+  "new_content": "fn new_function()"
+}
+
-
+ +
+ ℹ️ +

Multi-patch operations are atomic — all patches are validated before any are applied. If any patch fails, no changes are made.

+
- delete_file - FILE_DELETE +
+ delete_file + DELETE +
+

Delete a file or directory.

-

Delete a file or directory.

- -
-

Parameters

- - - -
pathstring (required)Path to delete
recursiveboolean (optional)Required for directories (default: false)
+
+
+

Parameters

+ + + + + + +
NameTypeDescription
pathrequired stringPath to delete
recursiveoptional booleanRequired for directories (default: false)
+
+
+

Example

+
{ "path": "temp/old_file.txt" }
+
- move_file - FILE_MOVE +
+ move_file + MOVE +
+

Move or rename a file.

-

Move or rename a file.

- -
-

Parameters

- - - -
sourcestring (required)Source path
destinationstring (required)Destination path
+
+
+

Parameters

+ + + + + + +
NameTypeDescription
sourcerequired stringSource path
destinationrequired stringDestination path
+
+
+

Example

+
{
+  "source": "src/old_name.rs",
+  "destination": "src/new_name.rs"
+}
+
- copy_file - FILE_COPY +
+ copy_file + COPY +
+

Copy a file or directory (recursive for directories).

-

Copy a file or directory (recursive for directories).

- -
-

Parameters

- - - -
sourcestring (required)Source path
destinationstring (required)Destination path
+
+
+

Parameters

+ + + + + + +
NameTypeDescription
sourcerequired stringSource path
destinationrequired stringDestination path
+
+
+

Example

+
{
+  "source": "templates/base.html",
+  "destination": "src/templates/base.html"
+}
+
- get_file_info - FILE_INFO +
+ get_file_info + INFO +
+

Get metadata about a file or directory.

-

Get metadata about a file or directory.

- -
-

Parameters

- - -
pathstring (required)Path to inspect
-
- -
-

Returns

-

JSON with path, size, is_directory, is_file, modified, readonly

+
+
+

Parameters

+ + + + + +
NameTypeDescription
pathrequired stringPath to inspect
+
+
+

Returns

+
+ path size is_directory is_file modified readonly +
+
- create_directory - FILE_CREATE +
+ create_directory + CREATE +
+

Create a directory (and parent directories if needed).

-

Create a directory (and parent directories if needed).

- -
-

Parameters

- - -
pathstring (required)Directory path to create
+
+
+

Parameters

+ + + + + +
NameTypeDescription
pathrequired stringDirectory path to create
+
+
+

Example

+
{ "path": "src/modules/new_feature" }
+
@@ -256,122 +391,215 @@ import BaseLayout from '../layouts/BaseLayout.astro';