Skip to content

Conversation

@aganonki
Copy link

@aganonki aganonki commented Jun 5, 2025

Add ability to Override tools descriptions system prompt. Example usage - add your description in .roo/tools/read_file.md it will override default tool description it supports args param replacement with "

Related GitHub Issue

Closes: #4010

Description

Adds file based check in .roo/tools/
now it will look for {toolname.md} and if found replace current description with new one from file.
This allows users customize tool usage for specific models.
Some Models like GPT 4.1 and Sonnet 4 are great and require little guidance with tool usage so descriptions can be reduced drastically to achieve same effect.

Test Procedure

  1. Create toolname.md file in .roo/tools/

For ex. new file:
.roo/tools/read_file.md:

## read_file

Custom description

Description: Read file contents. Use for analyzing code, text files, or configs. Output includes line numbers. Extracts text from PDFs and DOCX. Not for other binary files.
Parameters: path (required) (relative to the current workspace directory ${args.cwd}), start_line (optional), end_line (optional)
  1. navigate to roo =>Prompt
  2. Click Preview System prompt
    image

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes.
    • All tests pass locally (npm test).
    • The application builds successfully with my changes.
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

image

Documentation Updates

Needs new section for advanced users how to customize tool descriptions. Check Test Procedure similar steps how to change descriptions. This also needs needs Warning note that improper custom description will affect or even break ability to call tools.

Additional Notes

.roo/tools/read_file.md it will override default tool description
this supports original args param replacement with data from args for any property

Get in Touch

Roo discord: Basas


Important

This PR adds functionality to override tool descriptions using markdown files with support for argument interpolation.

  • Feature:
    • Allows overriding tool descriptions by placing markdown files in .roo/tools/.
    • Supports argument interpolation in descriptions using ${args} syntax.
  • Implementation:
    • Updates getToolDescriptionsForMode in tools/index.ts to check for overrides using readToolOverrideWithArgs.
    • Adds readToolOverride and interpolateToolDescription functions in tools.ts for reading and processing overrides.
  • Testing:
    • Adds tool-overrides.test.ts to test default and custom tool descriptions, including argument interpolation and handling of empty/whitespace files.

This description was created by Ellipsis for 0d1200a. You can customize this summary. It will automatically update as commits are pushed.

aganonki added 2 commits June 5, 2025 12:50
Add ability to Override tools descriptions system prompt. Example usage add your description in .roo/tools/read_file.md it will override default tool description it supports args param replacement with "
@aganonki aganonki requested review from cte and mrubens as code owners June 5, 2025 10:37
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. documentation Improvements or additions to documentation enhancement New feature or request labels Jun 5, 2025
@aganonki aganonki mentioned this pull request Jun 5, 2025
4 tasks
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jun 5, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jun 5, 2025
@aganonki aganonki closed this Jun 5, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Prelim Review] to Done in Roo Code Roadmap Jun 5, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 5, 2025
@aganonki
Copy link
Author

aganonki commented Jun 5, 2025

Moved to New PR #4388 due to unit test and Prettier changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request PR - Needs Preliminary Review size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Custom tool descriptions

2 participants