feat(scripted_tool): help builtin for runtime schema introspection#529
Merged
feat(scripted_tool): help builtin for runtime schema introspection#529
Conversation
3ba1f8d to
b4c1c18
Compare
Add HelpBuiltin that provides runtime tool schema introspection: - `help --list` lists all tool names + descriptions - `help <tool>` prints human-readable usage - `help <tool> --json` prints machine-readable JSON schema (pipeable to jq) Add `compact_prompt(bool)` builder method to ScriptedToolBuilder. When enabled, system_prompt() emits only tool names + one-liners and instructs the LLM to use `help` for full details — reducing context window usage for large tool sets. 8 new tests. Update spec 014. Closes #519
Extend ToolDef with tags and category fields for progressive discovery. Add DiscoverBuiltin with --categories, --category, --tag, --search, and --json modes. Register alongside help builtin. 11 new tests. Update spec 014. Closes #521
dd2d587 to
babfe90
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HelpBuiltinproviding runtime tool schema introspection inside ScriptedTool scriptshelp --list— list all tool names + descriptionshelp <tool>— human-readable usage with flagshelp <tool> --json— machine-readable JSON schema (pipeable to jq)ScriptedToolBuilder::compact_prompt(bool)— when enabled,system_prompt()emits only names + one-liners and defers full schemas tohelpTest plan
cargo test --lib scripted_tool— all 40 tests passcargo fmt --check— cleancargo clippy --all-targets --all-features -- -D warnings— cleanCloses #519