Skip to content

feat: add custom tool description CLI arguments - #6

Open
janbam wants to merge 3 commits into
devfrom
feature/custom-tool-description
Open

feat: add custom tool description CLI arguments#6
janbam wants to merge 3 commits into
devfrom
feature/custom-tool-description

Conversation

@janbam

@janbam janbam commented Nov 1, 2025

Copy link
Copy Markdown
Owner

Summary

This PR adds support for customizing the Self tool's description via CLI arguments, enabling users to tailor the tool description to their specific use case or deployment context.

Changes:

  • ✅ New --tool-description <text> argument for inline custom descriptions
  • ✅ New --tool-description-file <path> argument for file-based descriptions
  • ✅ Mutual exclusivity validation between both arguments
  • ✅ Duplicate usage detection with specific error messages
  • ✅ Empty description validation (after trim)
  • ✅ Comprehensive file reading error handling
  • ✅ Updated help text and documentation

Implementation Details:

  • Follows existing parseArgs validation patterns exactly
  • Fail-fast philosophy: invalid configs prevent server startup
  • Synchronous file reading for simplicity
  • ~50 lines of code added total (KISS principle)

Files Modified:

  • src/index.ts - Core implementation with CLI parsing and validation
  • README.md - Documentation and usage examples
  • CLAUDE.md - Developer notes and recent changes

Test Plan

All validation scenarios tested:

  • Mutual exclusivity error when both flags used
  • Duplicate flag usage detection
  • Empty description validation
  • Missing file error handling
  • Empty file error handling
  • Valid inline description works correctly
  • Valid file-based description works correctly
  • Custom descriptions appear correctly in MCP tool definition (verified via MCP-Debug)
  • Default description used when neither flag provided

Add --tool-description and --tool-description-file arguments to allow
customizing the Self tool's description at runtime.

Features:
- --tool-description <text> for inline custom descriptions
- --tool-description-file <path> for file-based descriptions
- Mutual exclusivity validation between both arguments
- Duplicate usage detection with specific error messages
- Empty description validation
- Comprehensive file reading error handling

Implementation follows existing parseArgs validation patterns with
fail-fast philosophy and clear error messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants