feat(thulp-core): add ToolDefinition::to_mcp_input_schema() — bump 0.3.2#18
Merged
Conversation
Inverse of parse_mcp_input_schema(). Converts the typed Vec<Parameter> into an MCP/OpenAI-compatible JSON Schema Value, suitable for the tools[].function.parameters field that LLM APIs expect. Round-trip stable for name, type, required, description, default, enum_values. +4 unit tests covering basic, round-trip, enum/default carry, and empty-definition cases. Also: clarify thulp-registry positioning as a metadata-only catalog (not an execution runtime). Pawan and ares keep their own executable ToolRegistry; thulp-registry is for serializable tool catalogs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Adds
ToolDefinition::to_mcp_input_schema()tothulp-coreso callers canexpose tool definitions through MCP-compatible schemas without rebuilding
the JSON shape by hand. Bumps the crate to 0.3.2 along with the
matching
Cargo.lockupdate.This came out of the
pawan-mcpparallel client wrapper work (#20 in pawan)where pawan needed to bridge thulp tool defs into MCP input schemas at
runtime — the inline reimplementation became a copy-paste hazard, so the
helper lives upstream now.
Commits
c4ef220chore(thulp): sync 3 file(s)a3e3482feat(thulp-core): add ToolDefinition::to_mcp_input_schema() — bump 0.3.26136f56chore: update Cargo.lock for thulp-core 0.3.2 bump(Direct push to
masterwas rejected by branch protection — going through PR.)Test plan
cargo build -p thulp-core --releasecargo test -p thulp-core— covers the new helper🤖 Generated with Claude Code