MCPcopy Create free account
hub / github.com/cloudflare/mcp / validationError

Function validationError

src/tools/non-codemode.ts:121–128  ·  view source on GitHub ↗
(name: string, error: z.ZodError)

Source from the content-addressed store, hash-verified

119}
120
121function validationError(name: string, error: z.ZodError): CallToolResult {
122 const accountGuidance = error.issues.some((issue) => issue.path[0] === 'account_id')
123 ? ` ${NON_CODEMODE_ACCOUNT_DISCOVERY_GUIDANCE}`
124 : ''
125 return toolError(
126 `Input validation error: Invalid arguments for tool ${name}: ${error.message}${accountGuidance}`
127 )
128}
129
130function toolError(message: string): CallToolResult {
131 return { content: [{ type: 'text', text: message }], isError: true }

Callers 1

registerNonCodemodeToolsFunction · 0.85

Calls 1

toolErrorFunction · 0.85

Tested by

no test coverage detected