fix(tool): align JSON contract with conditional fetch fields#129
Merged
Conversation
e555f5a to
6cb3c12
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.
Motivation
FetchRequestandFetchResponsegained conditional-fetch fields (if_none_match,if_modified_since,etag) but the tool JSON contract (argument validator and input/output schemas) was not updated, causing JSON/MCP callers to be rejected and tooling to fail strict schema validation.Description
if_none_matchandif_modified_sincein the tool argument validator by updatingvalidate_argsincrates/fetchkit/src/tool.rs.if_none_matchandif_modified_sinceto the input schema inbuild_input_schemawith string types and descriptions so the tool definition advertises the fields.etagto the output schema inbuild_output_schemaso serializedFetchResponseobjects match the advertised schema.Tool::executionaccepts conditional fetch arguments (test_execution_accepts_conditional_fetch_arguments, and updatedtest_tool_schemas).Testing
cargo fmt --allwhich completed successfully.cargo test -p fetchkit test_tool_schemasandcargo test -p fetchkit test_execution_accepts_conditional_fetch_arguments, both of which passed.crates/fetchkit/src/tool.rsexercise schema exposure and argument validation and succeeded in CI-like local test runs.Codex Task