Repository navigation
feat: return typed, structured results from every MCP tool - #18
Merged
Merged
Conversation
docker compose up now also starts the official MCP Inspector on localhost:6274, already configured for the server over Streamable HTTP, so the tools, their descriptions and input schemas can be browsed and run without installing anything.
Rename the tools by resource (authors_list, movies_get, reviews_create and so on), add titles and the read-only, destructive, idempotent and open-world hints, and rewrite the descriptions and parameter names for agents. The server instructions now describe the domain instead of output formatting, the server info has a proper title and an absolute icon URL, and not-found and validation errors tell the agent how to recover. The server now runs stateless at /mcp, and a tools/list test pins the names, titles and hints.
Tools now return Application entities instead of JSON strings, with UseStructuredContent so the SDK publishes an output schema and returns structuredContent alongside the JSON text. The tool serializer uses camelCase and the source-generated context, which was registered but never used. reviews_update returns the updated review, reviews_delete returns a small result object, and server_get_version returns an object instead of a markdown table.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18 +/- ##
==========================================
- Coverage 99.72% 99.72% -0.01%
==========================================
Files 42 43 +1
Lines 364 360 -4
Branches 13 13
==========================================
- Hits 363 359 -4
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
7 of 12 tasks
stphnwlsh
added a commit
that referenced
this pull request
Oct 28, 2026
## Summary The ten CRUD tools become six tools shaped around what someone asks an agent to do: find a movie, see what people thought of it, and write or remove a review. | Tool | Replaces | What it does | | --- | --- | --- | | `movies_search` | `movies_list` | Title search, 10 per page with a cursor, each with review count and average stars | | `movies_get` | `movies_get` | One movie with every review and each author's name | | `authors_search` | `authors_list`, `authors_get` | Name search (first, last or full), with review count and average stars | | `reviews_list` | `reviews_list`, `reviews_get` | Filter by movie, author or both, or fetch one review by id | | `reviews_write` | `reviews_create`, `reviews_update` | Creates a review, or replaces one when given its `reviewId` | | `reviews_delete` | `reviews_delete` | Unchanged | - Results are small by default. A first `movies_search` call is about 3 KB on the wire, where `GetAllMovies` returned about 70 KB. Nested reviews only come back when `includeReviews` is true or from `movies_get`. - New Presentation models (`MovieResult`, `AuthorResult`, `ReviewResult`, `ResultPage<T>`) put movie titles and author names next to their ids, and every property carries a description that shows up in the output schema. - The server instructions describe the new flow: search by name first, follow `nextCursor` instead of raising the limit, and confirm before deleting. - Not-found errors now point at `movies_search`, `authors_search` and `reviews_list`. - `server_get_version` stays as a tool for now and moves to a resource in the next PR. This is built on #17, #18 and #19, so their commits will drop out of the diff as they merge. ## Related issues None. ## Type of change - [ ] Bug fix - [x] New feature - [x] Breaking change (the generated solution or template parameters change in a way existing users will notice) - [ ] Refactoring or clean-up - [x] Documentation - [ ] Build, pipeline or dependency update The tool names, arguments and results all change. ## Shared layers - [x] This only touches the Presentation layer of this template. - [ ] This touches the Application or Infrastructure layers, tests, pipeline or repository setup, so it needs to be carried across all five templates. ## Checklist - [x] `dotnet build` and `dotnet test` pass locally with no warnings. - [x] I added or updated tests, and coverage stays at or above 95%. - [x] I updated the README or docs where behaviour changed. - [ ] I checked the template still installs and creates a working solution (see CONTRIBUTING.md).
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
Every tool now returns a typed result, so clients get an output schema and structured content instead of an opaque JSON string.
Author,Movie,Review,Version) rather thanJsonSerializer.Serialize(...)strings, withUseStructuredContent = true. The SDK publishes anoutputSchemafor each tool and returnsstructuredContentnext to the JSON text for older clients.AppJsonSerializerContext. That context was registered on the HTTP JSON options, which the MCP server never used, so results were going out in PascalCase.reviews_updatereturns the updated review instead of "Review updated successfully", so the agent sees the result without another call.reviews_deletereturns{ reviewId, deleted }instead of a sentence.server_get_versionreturns{ fileVersion, informationalVersion }instead of a markdown table.This is stacked on #17 (and #16), so their commits will drop out of the diff once they merge.
Related issues
None.
Type of change
The update, delete and version tools return objects instead of text.
Shared layers
Checklist
dotnet buildanddotnet testpass locally with no warnings.