Skip to content

Add outputSchema to ModelContextTool and RegisteredTool - #254

Open
beaufortfrancois wants to merge 1 commit into
webmachinelearning:mainfrom
beaufortfrancois:outputSchema
Open

Add outputSchema to ModelContextTool and RegisteredTool#254
beaufortfrancois wants to merge 1 commit into
webmachinelearning:mainfrom
beaufortfrancois:outputSchema

Conversation

@beaufortfrancois

@beaufortfrancois beaufortfrancois commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

This PR adds an optional outputSchema member to the ModelContextTool and RegisteredTool dictionaries to enable browser agents and in-page agents to help LLMs reliably reason about the return values of tools.

While responseConstraint was previously discussed, that name is too specific to the Built-in AI / Prompt API. TheoutputSchema name aligns directly with the MCP Tools specification outputSchema used to define expected structured outputs with JSON Schema.

FIX #9


Preview | Diff

@arnabwithab arnabwithab mentioned this pull request Sep 3, 2026
7 tasks
arnabwithab added a commit to arnabwithab/webmcp that referenced this pull request Sep 3, 2026
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).
@volkandkaya

Copy link
Copy Markdown

Is this still planned on being added?

@beaufortfrancois

Copy link
Copy Markdown
Collaborator Author

Is this still planned on being added?

I hope so :) 馃

@domfarolino I've started experimenting with outputSchema in Chromium with https://chromium-review.googlesource.com/c/chromium/src/+/8398367 to test it out.

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.

Introduce outputSchema (was: Should output also have a schema?)

2 participants