Skip to content

feat(scripted_tool): help builtin for runtime schema introspection#529

Merged
chaliy merged 2 commits intomainfrom
claude/help-builtin-command-3Kn4M
Mar 14, 2026
Merged

feat(scripted_tool): help builtin for runtime schema introspection#529
chaliy merged 2 commits intomainfrom
claude/help-builtin-command-3Kn4M

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 14, 2026

Summary

  • Add HelpBuiltin providing runtime tool schema introspection inside ScriptedTool scripts
  • help --list — list all tool names + descriptions
  • help <tool> — human-readable usage with flags
  • help <tool> --json — machine-readable JSON schema (pipeable to jq)
  • Add ScriptedToolBuilder::compact_prompt(bool) — when enabled, system_prompt() emits only names + one-liners and defers full schemas to help
  • 8 new tests covering all help modes, compact/full prompt, and jq piping

Test plan

  • cargo test --lib scripted_tool — all 40 tests pass
  • cargo fmt --check — clean
  • cargo clippy --all-targets --all-features -- -D warnings — clean

Closes #519

@chaliy chaliy changed the title feat(scripted_tool): help builtin for runtime schema introspection feat(scripted_tool): help, discover, MCP, shared context, state docs Mar 14, 2026
@chaliy chaliy changed the title feat(scripted_tool): help, discover, MCP, shared context, state docs feat(scripted_tool): help builtin for runtime schema introspection Mar 14, 2026
@chaliy chaliy force-pushed the claude/help-builtin-command-3Kn4M branch from 3ba1f8d to b4c1c18 Compare March 14, 2026 00:31
chaliy added 2 commits March 14, 2026 00:51
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
@chaliy chaliy force-pushed the claude/help-builtin-command-3Kn4M branch from dd2d587 to babfe90 Compare March 14, 2026 00:52
@chaliy chaliy merged commit 1f859a3 into main Mar 14, 2026
23 checks passed
@chaliy chaliy deleted the claude/help-builtin-command-3Kn4M branch March 14, 2026 01:00
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.

feat(scripted_tool): built-in help <tool> --json for runtime schema introspection

1 participant