@agifyai/leadify-mcp 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.js CHANGED
@@ -29,6 +29,17 @@ export function toolError(message, details) {
29
29
  }
30
30
  export function handleToolError(error) {
31
31
  if (error instanceof LeadifyApiError) {
32
+ // If the backend returned a cumulative ZodIssue list (formatZodError now
33
+ // emits `issues[]` on every 422), surface the count up-front in the
34
+ // message so the caller can fix every field in a single retry instead
35
+ // of looping one-error-at-a-time on the legacy `error` field.
36
+ const body = error.responseBody;
37
+ if (body && typeof body === "object" && !Array.isArray(body) && "issues" in body) {
38
+ const issues = body.issues;
39
+ if (Array.isArray(issues) && issues.length > 1) {
40
+ return toolError(`Validation failed: ${issues.length} issues. See details.response.issues[] for every path that needs fixing.`, { statusCode: error.statusCode, response: body });
41
+ }
42
+ }
32
43
  return toolError(error.message, {
33
44
  statusCode: error.statusCode,
34
45
  response: error.responseBody,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agifyai/leadify-mcp",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "MCP server for Leadify lead management API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",