MCPcopy Create free account
hub / github.com/modelcontextprotocol/typescript-sdk / createToolError

Method createToolError

src/server/mcp.ts:243–253  ·  view source on GitHub ↗

* Creates a tool error result. * * @param errorMessage - The error message. * @returns The tool error result.

(errorMessage: string)

Source from the content-addressed store, hash-verified

241 * @returns The tool error result.
242 */
243 private createToolError(errorMessage: string): CallToolResult {
244 return {
245 content: [
246 {
247 type: 'text',
248 text: errorMessage
249 }
250 ],
251 isError: true
252 };
253 }
254
255 /**
256 * Validates tool input arguments against the tool's input schema.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected