[{"data":1,"prerenderedAt":591,"buildId":592},["ShallowReactive",2],{"navigation_docs":3,"rule-content-\u002Fmcp\u002Frules\u002Ftools\u002Fno-http-error-in-tool":104},[4,32,36,40,44,48,52,64,68,92,96,100],{"title":5,"path":6,"stem":7,"children":8,"icon":31},"CLI","\u002Fcli","1.cli\u002F1.index",[9,11,15,19,23,27],{"title":10,"path":6,"stem":7},"Run Doctor",{"title":12,"path":13,"stem":14},"Reports","\u002Fcli\u002Freports","1.cli\u002F2.reports",{"title":16,"path":17,"stem":18},"Configuration","\u002Fcli\u002Fconfiguration","1.cli\u002F3.configuration",{"title":20,"path":21,"stem":22},"CI and changed files","\u002Fcli\u002Fci","1.cli\u002F4.ci",{"title":24,"path":25,"stem":26},"Workspaces","\u002Fcli\u002Fworkspaces","1.cli\u002F5.workspaces",{"title":28,"path":29,"stem":30},"Cache and speed","\u002Fcli\u002Fcache","1.cli\u002F6.cache","i-lucide-terminal",{"title":33,"path":34,"stem":35},"Nuxt","\u002Fnuxt","2.nuxt",{"title":37,"path":38,"stem":39},"Vue","\u002Fvue","3.vue",{"title":41,"path":42,"stem":43},"Vite","\u002Fvite","4.vite",{"title":45,"path":46,"stem":47},"Nitro","\u002Fnitro","5.nitro",{"title":49,"path":50,"stem":51},"TypeScript","\u002Ftypescript","6.typescript",{"title":53,"path":54,"stem":55,"children":56,"icon":63},"Design system","\u002Fdesign-system","7.design-system\u002F1.index",[57,59],{"title":58,"path":54,"stem":55},"Overview",{"title":60,"path":61,"stem":62},"Classes and styles","\u002Fdesign-system\u002Fclasses","7.design-system\u002F2.classes","i-lucide-swatch-book",{"title":65,"path":66,"stem":67},"Package","\u002Fpackage","8.package",{"title":69,"path":70,"stem":71,"children":72,"icon":91},"Extending Doctor","\u002Fextending","9.extending\u002F1.index",[73,75,79,83,87],{"title":74,"path":70,"stem":71},"Write an extension",{"title":76,"path":77,"stem":78},"Visitors","\u002Fextending\u002Fvisitors","9.extending\u002F2.visitors",{"title":80,"path":81,"stem":82},"Ship with a library","\u002Fextending\u002Fshipping","9.extending\u002F3.shipping",{"title":84,"path":85,"stem":86},"Test a Rule","\u002Fextending\u002Ftesting","9.extending\u002F4.testing",{"title":88,"path":89,"stem":90},"Rule inputs","\u002Fextending\u002Frule-inputs","9.extending\u002F5.rule-inputs","i-lucide-puzzle",{"title":93,"path":94,"stem":95},"H3","\u002Fh3","9.h3",{"title":97,"path":98,"stem":99},"MCP","\u002Fmodel-context-protocol","9.model-context-protocol",{"title":101,"path":102,"stem":103},"Pinia","\u002Fpinia","9.pinia",{"id":105,"title":106,"body":107,"category":113,"description":578,"diagnosticCodes":579,"docsUrl":115,"extension":580,"fix":116,"framework":581,"meta":582,"navigation":583,"pack":117,"path":585,"recommendedReplacement":586,"ruleId":118,"seo":587,"severity":119,"source":120,"sourceUrl":121,"stem":588,"why":589,"__hash__":590},"rules\u002Fmcp\u002Frules\u002Ftools\u002Fno-http-error-in-tool.md","Report MCP tool failures as tool results, not h3 HTTP errors",{"type":108,"value":109,"toc":569},"minimark",[110,122,127,159,163,186,190,200,204,216,220,225,228,433,436,565],[111,112],"rule-metadata",{"category":113,"diagnosticCodes":114,"docsUrl":115,"fix":116,"pack":117,"ruleId":118,"severity":119,"source":120,"sourceUrl":121},"tools","MCP0015","https:\u002F\u002Fmodelcontextprotocol.io\u002Fspecification\u002F2025-11-25\u002Fserver\u002Ftools#error-handling","suggestion","vite-doctor\u002Fmcp","mcp\u002Ftools\u002Fno-http-error-in-tool","warn","src\u002Frule-packs\u002Fmcp\u002Frules\u002Fno-http-error-in-tool.ts","https:\u002F\u002Fgithub.com\u002Fwords-with-agents\u002Fvite-doctor\u002Fblob\u002Fmain\u002Fsrc\u002Frule-packs\u002Fmcp\u002Frules\u002Fno-http-error-in-tool.ts",[123,124,126],"h2",{"id":125},"run-this-rule","Run this rule",[128,129,134],"pre",{"className":130,"code":131,"language":132,"meta":133,"style":133},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm vite-doctor . --rules mcp\u002Ftools\u002Fno-http-error-in-tool\n","bash","",[135,136,137],"code",{"__ignoreMap":133},[138,139,142,146,150,153,156],"span",{"class":140,"line":141},"line",1,[138,143,145],{"class":144},"sBMFI","pnpm",[138,147,149],{"class":148},"sfazB"," vite-doctor",[138,151,152],{"class":148}," .",[138,154,155],{"class":148}," --rules",[138,157,158],{"class":148}," mcp\u002Ftools\u002Fno-http-error-in-tool\n",[123,160,162],{"id":161},"why-it-matters","Why it matters",[164,165,166,167,170,171,174,175,178,179,182,183,185],"p",{},"h3-mcp (okmcp) turns a plain thrown ",[135,168,169],{},"Error"," into an ",[135,172,173],{},"isError"," tool result the model can read and react to, but it lets an h3 ",[135,176,177],{},"HTTPError"," through as a JSON-RPC protocol error. Clients treat that as a broken server rather than a failed tool call, and on the 2026-07-28 revision h3-mcp answers HTTP 500 with ",[135,180,181],{},"-32603 Internal error"," and drops the message. nitro-mcp-toolkit and @nuxtjs\u002Fmcp-toolkit convert ",[135,184,177],{}," themselves, so this applies to h3-mcp only.",[123,187,189],{"id":188},"recommended-fix","Recommended fix",[164,191,192,193,195,196,199],{},"Throw a plain ",[135,194,169],{}," with the message the model should see, or return ",[135,197,198],{},"{ content: [...], isError: true }",".",[123,201,203],{"id":202},"useful-links","Useful links",[205,206,207],"ul",{},[208,209,210],"li",{},[211,212,215],"a",{"href":115,"rel":213},[214],"nofollow","Rule reference",[123,217,219],{"id":218},"example","Example",[221,222,224],"h3",{"id":223},"return-the-failure-as-a-tool-result","Return the failure as a tool result",[164,226,227],{},"Before",[128,229,233],{"className":230,"code":231,"language":232,"meta":133,"style":133},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","defineTool({\n  name: 'get_order',\n  inputSchema,\n  handler: async ({ id }) => {\n    const order = await findOrder(id)\n    if (!order) throw createError({ status: 404, message: `Order ${id} not found` })\n    return orderResult(order)\n  },\n})\n","ts",[135,234,235,249,271,279,307,334,405,420,426],{"__ignoreMap":133},[138,236,237,241,245],{"class":140,"line":141},[138,238,240],{"class":239},"s2Zo4","defineTool",[138,242,244],{"class":243},"sTEyZ","(",[138,246,248],{"class":247},"sMK4o","{\n",[138,250,252,256,259,262,265,268],{"class":140,"line":251},2,[138,253,255],{"class":254},"swJcz","  name",[138,257,258],{"class":247},":",[138,260,261],{"class":247}," '",[138,263,264],{"class":148},"get_order",[138,266,267],{"class":247},"'",[138,269,270],{"class":247},",\n",[138,272,274,277],{"class":140,"line":273},3,[138,275,276],{"class":243},"  inputSchema",[138,278,270],{"class":247},[138,280,282,285,287,291,294,298,301,304],{"class":140,"line":281},4,[138,283,284],{"class":239},"  handler",[138,286,258],{"class":247},[138,288,290],{"class":289},"spNyl"," async",[138,292,293],{"class":247}," ({",[138,295,297],{"class":296},"sHdIc"," id",[138,299,300],{"class":247}," })",[138,302,303],{"class":289}," =>",[138,305,306],{"class":247}," {\n",[138,308,310,313,316,319,323,326,328,331],{"class":140,"line":309},5,[138,311,312],{"class":289},"    const",[138,314,315],{"class":243}," order",[138,317,318],{"class":247}," =",[138,320,322],{"class":321},"s7zQu"," await",[138,324,325],{"class":239}," findOrder",[138,327,244],{"class":254},[138,329,330],{"class":243},"id",[138,332,333],{"class":254},")\n",[138,335,337,340,343,346,349,352,355,358,360,363,366,368,372,375,378,380,383,386,389,391,394,397,400,403],{"class":140,"line":336},6,[138,338,339],{"class":321},"    if",[138,341,342],{"class":254}," (",[138,344,345],{"class":247},"!",[138,347,348],{"class":243},"order",[138,350,351],{"class":254},") ",[138,353,354],{"class":321},"throw",[138,356,357],{"class":239}," createError",[138,359,244],{"class":254},[138,361,362],{"class":247},"{",[138,364,365],{"class":254}," status",[138,367,258],{"class":247},[138,369,371],{"class":370},"sbssI"," 404",[138,373,374],{"class":247},",",[138,376,377],{"class":254}," message",[138,379,258],{"class":247},[138,381,382],{"class":247}," `",[138,384,385],{"class":148},"Order ",[138,387,388],{"class":247},"${",[138,390,330],{"class":243},[138,392,393],{"class":247},"}",[138,395,396],{"class":148}," not found",[138,398,399],{"class":247},"`",[138,401,402],{"class":247}," }",[138,404,333],{"class":254},[138,406,408,411,414,416,418],{"class":140,"line":407},7,[138,409,410],{"class":321},"    return",[138,412,413],{"class":239}," orderResult",[138,415,244],{"class":254},[138,417,348],{"class":243},[138,419,333],{"class":254},[138,421,423],{"class":140,"line":422},8,[138,424,425],{"class":247},"  },\n",[138,427,429,431],{"class":140,"line":428},9,[138,430,393],{"class":247},[138,432,333],{"class":243},[164,434,435],{},"After",[128,437,439],{"className":230,"code":438,"language":232,"meta":133,"style":133},"defineTool({\n  name: 'get_order',\n  inputSchema,\n  handler: async ({ id }) => {\n    const order = await findOrder(id)\n    if (!order) throw new Error(`Order ${id} not found`)\n    return orderResult(order)\n  },\n})\n",[135,440,441,449,463,469,487,505,543,555,559],{"__ignoreMap":133},[138,442,443,445,447],{"class":140,"line":141},[138,444,240],{"class":239},[138,446,244],{"class":243},[138,448,248],{"class":247},[138,450,451,453,455,457,459,461],{"class":140,"line":251},[138,452,255],{"class":254},[138,454,258],{"class":247},[138,456,261],{"class":247},[138,458,264],{"class":148},[138,460,267],{"class":247},[138,462,270],{"class":247},[138,464,465,467],{"class":140,"line":273},[138,466,276],{"class":243},[138,468,270],{"class":247},[138,470,471,473,475,477,479,481,483,485],{"class":140,"line":281},[138,472,284],{"class":239},[138,474,258],{"class":247},[138,476,290],{"class":289},[138,478,293],{"class":247},[138,480,297],{"class":296},[138,482,300],{"class":247},[138,484,303],{"class":289},[138,486,306],{"class":247},[138,488,489,491,493,495,497,499,501,503],{"class":140,"line":309},[138,490,312],{"class":289},[138,492,315],{"class":243},[138,494,318],{"class":247},[138,496,322],{"class":321},[138,498,325],{"class":239},[138,500,244],{"class":254},[138,502,330],{"class":243},[138,504,333],{"class":254},[138,506,507,509,511,513,515,517,519,522,525,527,529,531,533,535,537,539,541],{"class":140,"line":336},[138,508,339],{"class":321},[138,510,342],{"class":254},[138,512,345],{"class":247},[138,514,348],{"class":243},[138,516,351],{"class":254},[138,518,354],{"class":321},[138,520,521],{"class":247}," new",[138,523,524],{"class":239}," Error",[138,526,244],{"class":254},[138,528,399],{"class":247},[138,530,385],{"class":148},[138,532,388],{"class":247},[138,534,330],{"class":243},[138,536,393],{"class":247},[138,538,396],{"class":148},[138,540,399],{"class":247},[138,542,333],{"class":254},[138,544,545,547,549,551,553],{"class":140,"line":407},[138,546,410],{"class":321},[138,548,413],{"class":239},[138,550,244],{"class":254},[138,552,348],{"class":243},[138,554,333],{"class":254},[138,556,557],{"class":140,"line":422},[138,558,425],{"class":247},[138,560,561,563],{"class":140,"line":428},[138,562,393],{"class":247},[138,564,333],{"class":243},[566,567,568],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":133,"searchDepth":251,"depth":251,"links":570},[571,572,573,574,575],{"id":125,"depth":251,"text":126},{"id":161,"depth":251,"text":162},{"id":188,"depth":251,"text":189},{"id":202,"depth":251,"text":203},{"id":218,"depth":251,"text":219,"children":576},[577],{"id":223,"depth":273,"text":224},"Report `throw createError()` and `throw new HTTPError()` in an h3-mcp tool handler, outside a `try` that catches them.",[114],"md","mcp",{},{"title":584},"HTTP errors in tools","\u002Fmcp\u002Frules\u002Ftools\u002Fno-http-error-in-tool","Throw a plain `Error` with the message the model should see, or return `{ content: [...], isError: true }`.",{"title":106,"description":578},"mcp\u002Frules\u002Ftools\u002Fno-http-error-in-tool","h3-mcp (okmcp) turns a plain thrown `Error` into an `isError` tool result the model can read and react to, but it lets an h3 `HTTPError` through as a JSON-RPC protocol error. Clients treat that as a broken server rather than a failed tool call, and on the 2026-07-28 revision h3-mcp answers HTTP 500 with `-32603 Internal error` and drops the message. nitro-mcp-toolkit and @nuxtjs\u002Fmcp-toolkit convert `HTTPError` themselves, so this applies to h3-mcp only.","PoMtXRYvQM3jPmhvzpcQCXUTuW5VXXdT9Sh0P954QeE",1796502548122,"459135de-a4df-4ea8-9b4b-cb70e139bb1e"]