@@ -91,7 +91,7 @@ import {
9191 computeToolResponseBytes ,
9292 getToolCallErrorUserText ,
9393} from '../utils/mcp.js' ;
94- import { isClientGatedTool , isToolBlockedForClient } from '../utils/mcp_clients.js' ;
94+ import { isReportProblemBlockedForClient } from '../utils/mcp_clients.js' ;
9595import { buildPaymentRequiredResponse , isX402PaymentRequiredError } from '../utils/payment_errors.js' ;
9696import { createProgressTracker } from '../utils/progress.js' ;
9797import { getServerInstructions } from '../utils/server-instructions/index.js' ;
@@ -369,32 +369,34 @@ export class ActorsMcpServer {
369369 }
370370
371371 /**
372- * Compose the tool list for the current connection: resolve mode-specific tools, then drop any
373- * not currently servable (see {@link isToolServable }). Client-agnostic tools compose eagerly, so
374- * a recovery/rehydration load without an initialize still restores them. Client-gated tools are
375- * withheld until the client is known and re-added by the initialize flush. Used by every
376- * input-driven load path and the flush. (loadActorsAsTools upserts actor tools directly; actor
377- * tools are never client- gated, so they need no filtering.)
372+ * Compose the tool list for the current connection: resolve mode-specific tools, then drop
373+ * report-problem unless it is currently servable (see {@link isReportProblemServable }). Every
374+ * other tool composes eagerly, so a recovery/rehydration load without an initialize still
375+ * restores them. report-problem is withheld until the client is known and re-added by the
376+ * initialize flush. Used by every input-driven load path and the flush. (loadActorsAsTools
377+ * upserts actor tools directly; actor tools are never gated, so they need no filtering.)
378378 */
379379 private composeToolsForClient ( input : Input , actorTools : ToolEntry [ ] ) : ToolEntry [ ] {
380- return getToolsForServerMode ( input , actorTools , this . serverMode ) . filter ( ( tool ) =>
381- this . isToolServable ( tool . name ) ,
380+ return getToolsForServerMode ( input , actorTools , this . serverMode ) . filter (
381+ ( tool ) => tool . name !== HELPER_TOOLS . PROBLEM_REPORT || this . isReportProblemServable ( ) ,
382382 ) ;
383383 }
384384
385385 /**
386- * Whether a tool may be served on this connection right now:
387- * - report-problem's only function is forwarding submissions via telemetry, so it is never
388- * servable when telemetry is disabled (it would just fake an acknowledgement into the void).
389- * - A client-gated tool (has a { @link TOOL_CLIENT_BLOCKLIST} rule) cannot be judged until the
390- * client is known, so it is withheld until then — the initialize flush re-composes and adds it
391- * if the client allows. Client-agnostic tools are always servable, so they compose eagerly and
392- * survive a recovery load that never sees an initialize.
386+ * Whether report-problem may be served on this connection right now:
387+ * - Its only function is forwarding submissions via telemetry, so it is never servable when
388+ * telemetry is disabled (it would just fake an acknowledgement into the void).
389+ * - It cannot be judged until the connecting client is known, so it is withheld until then;
390+ * the initialize flush re-composes and adds it if the client allows.
391+ * Every other tool is unconditionally servable, so recovery loads compose them eagerly and they
392+ * survive a load that never sees an initialize.
393393 */
394- private isToolServable ( toolName : string ) : boolean {
395- if ( toolName === HELPER_TOOLS . PROBLEM_REPORT && ! this . telemetryEnabled ) return false ;
396- if ( isClientGatedTool ( toolName ) && ! this . clientKnown ) return false ;
397- return ! isToolBlockedForClient ( toolName , this . options . initializeRequestData ) ;
394+ private isReportProblemServable ( ) : boolean {
395+ return (
396+ ! ! this . telemetryEnabled &&
397+ this . clientKnown &&
398+ ! isReportProblemBlockedForClient ( this . options . initializeRequestData )
399+ ) ;
398400 }
399401
400402 private composePendingToolsForClient ( ) : void {
@@ -896,7 +898,7 @@ export class ActorsMcpServer {
896898 const captureResult = < T > ( r : T ) : T => {
897899 // On a failed result, nudge the agent to report the blocker via report-problem at the
898900 // moment it decides what to do next. Gated on the tool actually being served (see
899- // isToolServable ), so clients where it is blocklisted or telemetry is off never see it.
901+ // isReportProblemServable ), so clients where it is blocklisted or telemetry is off never see it.
900902 const augmented = appendReportProblemNudge ( r , {
901903 failingToolName : resolvedToolName ,
902904 available : this . tools . has ( HELPER_TOOLS . PROBLEM_REPORT ) ,
0 commit comments