| 580 | // Answered after marking the connection stale so the next tools read re-lists; |
| 581 | // the message tells the caller to re-list instead of retrying blind. |
| 582 | const unknownToolFailure = ( |
| 583 | toolName: string, |
| 584 | credential: { readonly integration: unknown; readonly connection: unknown }, |
| 585 | ) => |
| 586 | ToolResult.fail({ |
| 587 | code: "mcp_tool_unknown", |
| 588 | message: `The MCP server no longer provides tool "${toolName}". Its tool catalog changed; list tools again for the current set.`, |
| 589 | details: { |
| 590 | integration: String(credential.integration), |
| 591 | connection: String(credential.connection), |
| 592 | }, |
| 593 | }); |
| 594 | |
| 595 | /** Match `token` as a separator-bounded run inside a URL hostname or path, |
| 596 | * used as a low-confidence detection hint when wire-shape detection fails. */ |