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