Part of #935 . Depends on #937 (all handlers must route through respond* first).
Goal
Make an unclassified error a compile error — closes P4. This is the structural guarantee that distinguishes Option F from a plain helper.
Scope
Brand the constructor output in src/utils/mcp.ts:
declare const wireBrand : unique symbol ;
export type ToolResponse = MCPWireShape & { readonly [ wireBrand ] ?: never } ;
The respond* functions return ToolResponse; raw object literals don't carry the brand.
Narrow the handler signature in src/types.ts (currently call: (args) => Promise<object>):
call: ( args : InternalToolArgs ) => Promise < ToolResponse > ;
Fix whatever the compiler flags — those are the spots refactor: Adopt respond* response constructors across tools #937 missed (hand-rolled shapes or stray isError).
Acceptance
A hand-rolled { content: [...] } or bare isError: true in a handler does not compile.
pnpm run type-check, pnpm run lint, pnpm run test:unit clean.
Part of #935. Depends on #937 (all handlers must route through
respond*first).Goal
Make an unclassified error a compile error — closes P4. This is the structural guarantee that distinguishes Option F from a plain helper.
Scope
Brand the constructor output in
src/utils/mcp.ts:The
respond*functions returnToolResponse; raw object literals don't carry the brand.Narrow the handler signature in
src/types.ts(currentlycall: (args) => Promise<object>):Fix whatever the compiler flags — those are the spots refactor: Adopt respond* response constructors across tools #937 missed (hand-rolled shapes or stray
isError).Acceptance
{ content: [...] }or bareisError: truein a handler does not compile.pnpm run type-check,pnpm run lint,pnpm run test:unitclean.