Repository navigation
Refuse and hide signup settings nothing reads in the MCP tools - #353
Merged
Merged
Conversation
update_signup accepted requireEmail, allowNotes, showWhoSignedUp and confirmationMessage, and stored them, but nothing reads any of them: every sign-up asks for an email, the notes box always shows, the public page shows how full each slot is and never who signed up, and no screen or email prints a confirmation message. An assistant could report a change that never happened, and get_signup read back values participants never meet (every row reported showWhoSignedUp: true while names are never public). These join maxCommitmentsPerParticipant in one UNREAD_SETTINGS list. update_signup's strict settings schema omits them, so a client that sends one gets invalid_input, and get_signup, create_signup and update_signup hide them from the settings they return. The update_signup description says these things have no setting instead of telling the model to clear confirmationMessage with null. create_signup takes no settings beyond groupBy, so it needs no change. The keys stay in SignupSettingsSchema: stored rows and the browser builder still carry them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012abFzQcchqTLVqcPV5fvof
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The shared filtering and strict validation are consistent across read and write tools with adequate unit and database coverage.
Review effort: Balanced
Findings: None
What changed in this PR
This PR prevents MCP tools from accepting or returning signup settings that the application does not implement.
Changes:
- Centralizes unread settings in
UNREAD_SETTINGS. - Strictly rejects unsupported settings in
update_signup. - Filters unsupported settings from MCP responses and expands coverage.
| File | Description |
|---|---|
src/mcp/tools/signups-write.ts |
Rejects unsupported settings and clarifies tool behavior. |
src/mcp/tools/signups-write.test.ts |
Tests schema omission, rejection, and response filtering. |
src/mcp/tools/signups-read.ts |
Defines and filters the shared unread-settings list. |
src/mcp/tools/read.test.ts |
Verifies unread settings are hidden. |
src/mcp/tools.db.test.ts |
Verifies rejection and storage integrity with Postgres. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Oct 30, 2026
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.
What this changes
update_signupaccepted four settings that nothing in the app reads, stored them, and reported success:requireEmail: the sign-up form andcommitToSlotalways require an email.allowNotes: the notes box always shows.showWhoSignedUp: the public page shows how full each slot is and never who signed up, whatever this says.confirmationMessage: nothing prints it, on the success screen or in the confirmation email.These now join
maxCommitmentsPerParticipantin a singleUNREAD_SETTINGSlist insrc/mcp/tools/signups-read.ts. That one list drives both sides:SparseSettingsSchemaomits every key in the list and stays.strict(), so a client that sends one getsinvalid_inputonsettingsand nothing is stored. TheconfirmationMessagenullable extension is gone.settingsOuthides the same keys from the settings thatget_signup,create_signupandupdate_signupreturn. Every stored row carries these keys, becausecreateSignupfills in the schema defaults, so before this change everyget_signupreportedshowWhoSignedUp: true. Names are never public, so that value was wrong.The
update_signupdescription no longer says to clearconfirmationMessagewith null. It now says there is no setting to limit spots per person, make the email address optional, turn off notes, list who signed up on the public page, or add a confirmation message. It says what the tool does, and theregistry.test.tswording check passes.instructions.tsdoesn't mention settings, so it's unchanged.Re-checked before changing anything
A fresh grep of
src/(leaving out tests,src/schemas/signups.tsand the MCP tool) still finds no reader for any of the four. Issue #347 (optional email) is still open with no linked PR, sorequireEmailis still unread.One correction to the original report: the public page does not show participants' names. It only gets per-slot counts (
committedBySlot) plus the visitor's own sign-ups from their cookie. So the risk withshowWhoSignedUpwas the other way round. An assistant asked to show who signed up would have reported success while names stayed hidden. It was still a setting that did nothing, and the read side was reporting a falsetrue.Other places that take settings
create_signup: not affected. Its input isFullDraftSchema, which has no settings object, onlygroupBy, andpersistDraftpasses nothing else through.POST /api/signupsandPATCH /api/signups/[id]: not changed. They parse with the fullSignupSettingsSchemaand still accept these keys. They are cookie-only (the browser's own backend), and the builder round-trips the whole settings object: the build page parses it withSignupSettingsSchema.parse, which fills in the defaults, anduseBuildStatesends it all back on every group-by or reminder save. Refusing the keys there would break those saves. Fixing REST properly means taking the keys out ofSignupSettingsSchemafirst (see below).Should the keys leave
SignupSettingsSchema?I left them in, as asked. Neither check clearly calls for removal:
settingsis a column the app reads.Still, I think they should go in a follow-up. Removing them looks low-risk. Zod objects drop unknown keys when parsing, so the build page would stop carrying them and the next builder save would drop them from the row. The fixtures in
BuildWysiwyg.test.tsxanduseBuildState.test.tswould need trimming. One catch: once removed, the REST routes would silently drop these keys rather than refuse them, unless the REST settings schema is also made strict.Small note
updateSignup'smergeSettingspath still turnsnullinto "clear this key", butupdate_signupcan no longer send a null setting, because none of the settings it accepts can be null. I left that service code alone. It's harmless, and it'll be needed again if an optional setting comes back.Tests
signups-write.test.ts: the sparse-merge test uses settings that are still accepted and checks that the storedrequireEmailis hidden from the result. A new parameterised test covers each unread key (with both a value and a null forconfirmationMessage). For each one it checks that the key is missing from the advertised schema and description, that sending it returnsinvalid_inputonsettings, and that the service is never called. I confirmed these tests fail against the old code.read.test.ts:get_signuphides all five keys from a stored row.tools.db.test.ts: the old set-then-clear test forconfirmationMessagenow only coversclosesAt. Each unread key is refused against Postgres and the stored settings stay byte-for-byte the same. The defaults stored for these keys are not shown.Run locally:
pnpm lint && pnpm typecheck && pnpm knip && pnpm test: clean, 982 unit tests passedpnpm test:db: 352 tests passed🤖 Generated with Claude Code
https://claude.ai/code/session_012abFzQcchqTLVqcPV5fvof
Generated by Claude Code