memories/mcp: generate tool schemas with schemars#21012
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1353ca3a97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 613f90fc64
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let schema = SchemaSettings::draft2019_09() | ||
| .with(|settings| { | ||
| settings.inline_subschemas = true; | ||
| settings.option_add_null_type = option_add_null_type; | ||
| }) |
There was a problem hiding this comment.
Generate output schemas with serialize contract
Switching to SchemaSettings::draft2019_09() keeps the default Deserialize contract. output_schema_for reuses this path, so output Option fields (e.g. ListMemoriesResponse.path/next_cursor, SearchMemoriesResponse.path/next_cursor) become optional-in-object instead of required-but-nullable. That changes the published tool contract and conflicts with the stated intent to preserve existing output wire shape.
Useful? React with 👍 / 👎.
Why
The memories MCP server currently keeps handwritten JSON Schema beside the Rust types that actually serialize and deserialize the tool payloads:
schema.rs,server.rs, andbackend.rs. That duplicates the tool contract and makes schema drift easier as the API evolves.What changed
JsonSchemafor the memories tool arguments, responses, and nested response typesschemarsgenerationOptionfields and non-nullable optional input fieldslist,read, andsearchtools to the generated schemasVerification