@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/README.md +10 -9
- package/dist/tools/dataroom.js +630 -458
- package/dist/types.js +11 -0
- package/package.json +1 -1
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,
|