MCP: fix tool output schema
Description
Use com.fasterxml.jackson.module.jsonSchema.jakarta.JsonSchemaGenerator instead of com.github.victools.jsonschema.generator to generate the tool output schema in Tool.java.
Motivation and Context
This addresses issue https://github.com/Graylog2/graylog2-server/issues/23980 where the wrong type description is generated for a serialized DateTime object in the output schema generated for the SearchMessagesTool. The generated type is "object" but the actual serialized object type is string.
The victools schema generator must be configured to pick up all members annotated with @JsonProperty that end up in the actual response (e.g. name() in ResponseSchemaEntry for TabularResponse), with their corresponding values, as well as all the correct types for the serialized object schema (e.g. DateTime in AbsoluteRange for Metadata in TabularResponse). By using Jackson module, no additional configuration or type patching is required.
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Refactoring (non-breaking change)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have requested a documentation update.
- [ ] I have read the CONTRIBUTING document.
- [ ] I have added tests to cover my changes.
Hi @monrax,
eventually may i kindly ask to also try to have a look on:
Graylog MCP tool 'list_streams' is always returning null, only more smarter AI providers CLI tool such as auggie-cli (augmentcode) is able to resolve this (automatically no intervention is needed), most of rest are failing and just sharing observation (independently of used model) - bug in Graylog MCP tool.
The streams are available. The initial list_streams call failed (returned null), but using the list_resource tool with resource_type=stream successfully retrieved the streams.
Thank you.