Input validation (Fixes #92) - #289
Open
arnabwithab wants to merge 1 commit into
Open
Conversation
arnabwithab
marked this pull request as ready for review
September 3, 2026 10:05
Member
|
Thanks for the contribution. Please split the WPT content into a separate PR and submit to https://github.com/web-platform-tests/wpt/tree/master/webmcp per https://web-platform-tests.org/writing-tests/index.html#submitting-tests The editors to review the spec content. |
Codify WebMCP JSON Schema subset (Draft 2020-12) per 2026-03-05 CG resolution.
Meta-validation in registerTool() (TypeError on invalid schema) and input
validation in executeTool() parallel block before tool execute steps
(DataError with {path,reason,schemaPath} for agent self-correction).
Spec-only per review; WPT split to web-platform-tests/wpt (tentative).
Coordinates with webmachinelearning#254 (outputSchema, same dictionaries).
arnabwithab
force-pushed
the
input-validation-92
branch
from
September 3, 2026 15:43
24425fb to
4ddaf46
Compare
Author
|
WPT split: web-platform-tests/wpt#62426 (tentative, 2 files — executeTool DataError + registerTool TypeError per #92). Spec PR is now spec-only per review. |
Author
|
@anssiko let me know if all looks good :) |
Author
|
@domfarolino let me know your thoughts! |
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.
Fixes #92.
Implements the 2026-03-05 resolution (https://www.w3.org/2026/03/05-webmachinelearning-minutes.html#f5bd) (browser validates on all three layers; codify a JSON Schema subset). Defines the subset, adds meta-validation in registerTool() and input validation in executeTool() before invoking the tool, rejecting with a structured DataError for agent self-correction. Coordinates with #254 (outputSchema touches the same dictionaries).
Spec-only per #289 (comment) — WPT split to web-platform-tests/wpt#62426 (tentative, 2 files: executeTool DataError + registerTool TypeError).
Checklist
type,properties,required,enum,minimum/maximum,exclusiveMinimum/exclusiveMaximum,minLength/maxLength,pattern,items,prefixItems,additionalProperties:false,default,description(Draft 2020-12[[!JSON-SCHEMA]])$ref/$defs(remote/DAG),unevaluatedProperties,format,contentEncoding/contentMediaType,dependentRequired/dependentSchemasetc. (only allowlist passes →TypeError)registerTool(): after stringify → parse →valid WebMCP input schemacheck; rejectTypeErrorexecuteTool(): in parallel block after serializinginputObject→ validate parsedinputArgumentsagainst storedtool definition/input schemabeforetool execute steps; on fail queuewebmcp task source→DataError{path,reason,schemaPath}JSON Pointer RFC 6901, no pending execution norexecuteinvocationindex.bsbuilds with no warnings (bikeshed --print=plain --dry-run --die-when=late)index.bschanged (spec-only); WPT in WebMCP: tentative input validation tests for #92 web-platform-tests/wpt#62426 per reviewoutputSchematoModelContextToolandRegisteredTool#254), @anssiko (chaired)