Skip to content

feat: reshape the MCP tools around what agents need to do - #20

Merged
stphnwlsh merged 17 commits into
mainfrom
feature/mcp-intent-tools
Oct 28, 2026
Merged

stphnwlsh merged 17 commits into
mainfrom
feature/mcp-intent-tools

Conversation

@stphnwlsh

@stphnwlsh stphnwlsh commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

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
  • New feature
  • Breaking change (the generated solution or template parameters change in a way existing users will notice)
  • Refactoring or clean-up
  • Documentation
  • Build, pipeline or dependency update

The tool names, arguments and results all change.

Shared layers

  • 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

  • dotnet build and dotnet test pass locally with no warnings.
  • I added or updated tests, and coverage stays at or above 95%.
  • I updated the README or docs where behaviour changed.
  • I checked the template still installs and creates a working solution (see CONTRIBUTING.md).

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.
SearchMovies, SearchAuthors and SearchReviews return one page of results
with a total count and an opaque cursor for the next page. Movies and
authors match a case-insensitive search term, and reviews filter by
movie and author. Limits run from 1 to 50 with a default of 10, and
invalid cursors fail validation with a message that explains how to
get a valid one.
Replace the ten CRUD tools with six: movies_search, movies_get,
authors_search, reviews_list, reviews_write and reviews_delete. Searches
page through results ten at a time with a total count and a cursor,
return review counts and average stars instead of every nested review
unless asked, and put movie titles and author names next to their ids.
reviews_write creates a review, or replaces one when given its id, and
reviews_list can fetch a single review by id.
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.72727% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.43%. Comparing base (e7bfb4f) to head (68829e0).

Files with missing lines Patch % Lines
src/Presentation/Models/ResultMapper.cs 92.30% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
- Coverage   99.78%   99.43%   -0.36%     
==========================================
  Files          55       60       +5     
  Lines         466      527      +61     
  Branches       20       28       +8     
==========================================
+ Hits          465      524      +59     
- Partials        1        3       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

# Conflicts:
#	src/Presentation/Serialization/AppJsonSerializerContext.cs
#	src/Presentation/Tools/AuthorTools.cs
#	src/Presentation/Tools/MovieTools.cs
#	src/Presentation/Tools/ReviewTools.cs
#	tests/Presentation.Tests.Integration/Tools/ReviewToolTests.cs
#	tests/Presentation.Tests.Unit/Tools/AuthorToolTests.cs
#	tests/Presentation.Tests.Unit/Tools/MovieToolTests.cs
#	tests/Presentation.Tests.Unit/Tools/ReviewToolTests.cs
@stphnwlsh
stphnwlsh merged commit 43493da into main Oct 28, 2026
12 checks passed
@stphnwlsh
stphnwlsh deleted the feature/mcp-intent-tools branch October 28, 2026 17:06
stphnwlsh added a commit that referenced this pull request Oct 28, 2026
## Summary

Built on #20. Adds the other two MCP primitives so the server is more
than tools.

- **Resources**: `movies://{movieId}`, `authors://{authorId}` and
`reviews://{reviewId}` templates return the same JSON as the tools, and
`server://version` replaces the `server_get_version` tool.
- **Prompts**: `summarise_movie_reception`, `compare_movies` and
`review_movie`. The first two look the movie up and embed it as a
resource, and fall back to telling the agent which tools to use when the
title doesn't match.
- **Completions**: prompt arguments suggest movie titles and author
names as you type, using the search queries.
- Resource and prompt errors are mapped to MCP protocol errors (resource
not found, invalid params) by a shared request filter.
- JSON settings moved into `McpSerializer` so tools, resources and
prompts serialise the same way.
- Server instructions and README mention the resources.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants