refactor(dtos): drop noise fields from MCP tool response records#132
Open
adityamparikh wants to merge 1 commit into
Open
refactor(dtos): drop noise fields from MCP tool response records#132adityamparikh wants to merge 1 commit into
adityamparikh wants to merge 1 commit into
Conversation
Three MCP tool response records carried fields that conveyed no real
information to the LLM client:
- SolrMetrics.timestamp (Date) — always "now" since metrics are
collected synchronously per call. The MCP host already records
call timing.
- SolrHealthStatus.lastChecked (Date) — same: always "now".
- SolrHealthStatus.solrVersion (String) — always null in every code
path. @JsonInclude(NON_NULL) was hiding it from the wire anyway.
- SolrHealthStatus.status (String) — same: always null.
- CollectionCreationResult.success (boolean) — always true on return;
failures throw before reaching the result.
- CollectionCreationResult.message (String) — always the same literal
"Collection created successfully".
- CollectionCreationResult.createdAt (Date) — always "now".
After this change, CollectionCreationResult is just (name), which is
the only useful piece of information (echoes back what the LLM sent so
it can confirm the operation applied to the expected collection). The
choice to keep it as a record vs returning a bare String preserves
symmetry with other tool result types and gives the LLM a parseable
JSON object `{"name":"shows"}` instead of a bare string.
This drops the java.util.Date and com.fasterxml.jackson.annotation
.JsonFormat imports from Dtos.java entirely — no remaining DTO needs
either. There was no need to migrate Date → Instant: every Date field
turned out to be cargo-culted noise rather than load-bearing state.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Signed-off-by: adityamparikh <[email protected]>
adityamparikh
added a commit
to adityamparikh/solr-mcp
that referenced
this pull request
May 18, 2026
Apply the same drop-noise treatment to SchemaUpdateResult that PR apache#132 applies to Dtos.java records: - success (boolean) — always true on return; failures throw before reaching the result. - timestamp (Date) — always "now"; sub-second operation, MCP host records call timing already. After this change, SchemaUpdateResult is just (collection, addedNames): both fields carry real information. addedNames echoes the field names back so the LLM can confirm what landed. java.util.Date and com.fasterxml.jackson.annotation.JsonFormat imports drop from the record entirely. Test assertions referencing the dropped fields are removed. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: adityamparikh <[email protected]>
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.
Summary
Three MCP tool response records in `Dtos.java` carried fields that conveyed no real information to the LLM client. Removing them simplifies the JSON wire format and eliminates legacy `java.util.Date` usage entirely.
Fields removed
After this change:
Date → Instant migration: not needed
The original motivation was "why are we using `java.util.Date` instead of `java.time.Instant`?" — once every `Date` field turned out to be cargo-culted noise rather than load-bearing state, the migration is moot. Both `java.util.Date` and `com.fasterxml.jackson.annotation.JsonFormat` imports drop from `Dtos.java` entirely.
Wire format impact
For LLM clients consuming the existing JSON, the change is purely subtractive — three keys disappear from each affected response. Any code that depended on those values (none in this repo) would break, but since `@JsonInclude(NON_NULL)` was already dropping `solrVersion` and `status` from the wire, only `timestamp` / `lastChecked` / `success` / `message` / `createdAt` are visible behavioral changes.
Test plan
Related
This addresses a sub-thread of review on #131 (schema modification PR), where the new `SchemaUpdateResult` followed the same convention and the reviewer asked why we used `Date`. After this PR merges, #131 will pick up the same treatment for `SchemaUpdateResult` via rebase.
🤖 Generated with Claude Code