feat(schema): implement structured result wrapper for tool output schemas#304
Merged
Conversation
…emas Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
…ctured output Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
744ee01 to
5ba417b
Compare
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a structured result wrapper system for tool output schemas in the Wassette MCP server. The changes establish a consistent {"result": ...} envelope pattern for all component function returns, ensuring predictable schema representation and runtime value alignment between the component2json layer and the wassette schema utilities.
Key Changes
- Implements structured result wrapper in
component2jsonfor all non-empty function returns - Adds schema canonicalization utilities in
wassette::schemamodule - Updates MCP server components to use the new canonicalization pipeline
- Adds comprehensive documentation explaining the schema transformation pipeline
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
crates/component2json/src/lib.rs |
Implements result wrapper in vals_to_json and component_func_to_schema functions |
crates/wassette/src/schema.rs |
New module providing schema canonicalization and result normalization utilities |
crates/wassette/src/lib.rs |
Integrates schema canonicalization in lifecycle manager |
crates/mcp-server/src/components.rs |
Refactors component call handling to use new schema utilities |
tests/structured_output_integration_test.rs |
Updates test to handle new result wrapper pattern |
docs/design/component2json-structured-output.md |
Comprehensive documentation of the schema pipeline |
docs/SUMMARY.md |
Adds new documentation to table of contents |
crates/component2json/README.md |
Updates README with result wrapper information |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Signed-off-by: Jiaxiao Zhou duibao55328@gmail.com