asErrorResult() — mcp Function Reference
Architecture documentation for the asErrorResult() function in types.ts from the mcp codebase.
Entity Profile
Dependency Diagram
graph TD 05b504b7_268e_7c49_d109_73f7c3744be0["asErrorResult()"] 1767161e_720a_f6c8_bf00_3dc68740b823["handler()"] 1767161e_720a_f6c8_bf00_3dc68740b823 -->|calls| 05b504b7_268e_7c49_d109_73f7c3744be0 37989e20_855d_701d_ca13_a196d7d4a37e["handler()"] 37989e20_855d_701d_ca13_a196d7d4a37e -->|calls| 05b504b7_268e_7c49_d109_73f7c3744be0 7623ea08_e684_62f6_f74f_3b1d646a26f5["handler()"] 7623ea08_e684_62f6_f74f_3b1d646a26f5 -->|calls| 05b504b7_268e_7c49_d109_73f7c3744be0 e5737e93_21e3_4389_2f31_c2c4b7b9ef6c["handler()"] e5737e93_21e3_4389_2f31_c2c4b7b9ef6c -->|calls| 05b504b7_268e_7c49_d109_73f7c3744be0 0c9ec015_a9a0_5ced_2032_d9aa5a5efa81["searchSymbolHandler()"] 0c9ec015_a9a0_5ced_2032_d9aa5a5efa81 -->|calls| 05b504b7_268e_7c49_d109_73f7c3744be0 211e0c66_321b_c05c_6d2c_3b3009df3949["findDefinitionHandler()"] 211e0c66_321b_c05c_6d2c_3b3009df3949 -->|calls| 05b504b7_268e_7c49_d109_73f7c3744be0 21066345_5e12_0bc2_9825_2a3d68bcb1b7["traceCallsHandler()"] 21066345_5e12_0bc2_9825_2a3d68bcb1b7 -->|calls| 05b504b7_268e_7c49_d109_73f7c3744be0 0dc81adb_6983_30fe_6ae1_4620d20c0ff0["annotateHandler()"] 0dc81adb_6983_30fe_6ae1_4620d20c0ff0 -->|calls| 05b504b7_268e_7c49_d109_73f7c3744be0 style 05b504b7_268e_7c49_d109_73f7c3744be0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/types.ts lines 69–83
export function asErrorResult(error: string | StructuredError): ToolCallResult {
const text = typeof error === 'string'
? error
: JSON.stringify({ error }, null, 2);
return {
content: [
{
type: 'text',
text,
},
],
isError: true,
};
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does asErrorResult() do?
asErrorResult() is a function in the mcp codebase.
What calls asErrorResult()?
asErrorResult() is called by 8 function(s): annotateHandler, findDefinitionHandler, handler, handler, handler, handler, searchSymbolHandler, traceCallsHandler.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free