Don't need to delete the tool usage descriptions.
I compared the original system prompt and the one that results after processing (via new dump fature), and I found that the descriptions of tool usage are missing, which causes the model to try to use it incorrectly.
example :
original prompt
## search_files
Description: Request to perform a regex search across files in a specified directory, providing context-rich results. This tool searches for patterns or specific content across multiple files, displaying each match with encapsulating context.
Parameters:
- path: (required) The path of the directory to search in (relative to the current workspace directory /home/rmk/Documents/mcp-logs-ai). This directory will be recursively searched.
- regex: (required) The regular expression pattern to search for. Uses Rust regex syntax.
- file_pattern: (optional) Glob pattern to filter files (e.g., '*.ts' for TypeScript files). If not provided, it will search all files (*).
Usage:
<search_files>
<path>Directory path here</path>
<regex>Your regex pattern here</regex>
<file_pattern>file pattern here (optional)</file_pattern>
</search_files>
Example: Requesting to search for all .ts files in the current directory
<search_files>
<path>.</path>
<regex>.*</regex>
<file_pattern>*.ts</file_pattern>
</search_files>
after processing
## search_files
Usage:
search_files arguments: {"path": "Directory path here", "regex": "Your regex pattern here", "file_pattern": "file pattern here (optional)"}
Example: Requesting to search for all .ts files in the current directory
search_files arguments: {"path": ".", "regex": ".*", "file_pattern": "*.ts"}
Now I understand why the model almost always forgets to specify the path field - it simply has no description and doesn't know which fields are required and which are not.
All of those descriptions have been moved from messages to the description field in the tool definition and are being maintained. Therefore, this is the intended behavior.
Yes, actually, I realized that now, I even see that there is a separate field listing all required fields, but I still don’t understand why the error happens so often when the path field remains unfilled.
Shouldn't the usage and examples sections be combined with the description, and also pass through the tools parameter?