@recapt/mcp 0.0.35 → 0.0.36
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/index.js +349 -597
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -679,7 +679,7 @@ var detectRegressionsTool = {
|
|
|
679
679
|
import { z as z7 } from "zod";
|
|
680
680
|
var runFullDiagnosticTool = {
|
|
681
681
|
name: "run_full_diagnostic",
|
|
682
|
-
description: "Get a quick site health overview with
|
|
682
|
+
description: "Get a quick site health overview with problem pages. This is a lightweight entry point \u2014 it does NOT include regression detection. For a complete analysis, call detect_regressions separately after this. Returns: health score, pages needing attention, and investigation order.",
|
|
683
683
|
inputSchema: z7.object({
|
|
684
684
|
days: z7.number().optional().default(7).describe("Number of days to analyze (default: 7)")
|
|
685
685
|
}),
|
|
@@ -697,48 +697,6 @@ var runFullDiagnosticTool = {
|
|
|
697
697
|
return successResult(data);
|
|
698
698
|
}
|
|
699
699
|
};
|
|
700
|
-
var investigateIssueTool = {
|
|
701
|
-
name: "investigate_issue",
|
|
702
|
-
description: "Deep-dive into a specific issue. Returns affected sessions, element friction data, related console errors, similar issues, and page context. Use after identifying an issue to understand root cause. NOTE: Free tier users get issue summary and page context only. Detailed investigation data (affected sessions, element friction, related errors) requires a paid plan (Starter+).",
|
|
703
|
-
inputSchema: z7.object({
|
|
704
|
-
issue_id: z7.string().describe("The ID of the issue to investigate"),
|
|
705
|
-
days: z7.number().optional().default(7).describe("Number of days to look back (default: 7)")
|
|
706
|
-
}),
|
|
707
|
-
handler: async (args) => {
|
|
708
|
-
const { issue_id, days } = args;
|
|
709
|
-
if (!isApiConfigured()) {
|
|
710
|
-
return apiNotConfiguredResult();
|
|
711
|
-
}
|
|
712
|
-
const { data, error } = await apiGet(`/issues/${issue_id}/investigate`, {
|
|
713
|
-
days: days ?? 7
|
|
714
|
-
});
|
|
715
|
-
if (error) {
|
|
716
|
-
return errorResult(error);
|
|
717
|
-
}
|
|
718
|
-
return successResult(data);
|
|
719
|
-
}
|
|
720
|
-
};
|
|
721
|
-
var validateIssueTool = {
|
|
722
|
-
name: "validate_issue",
|
|
723
|
-
description: "Check if an issue is still actively occurring. Returns staleness info and recommendation (investigate, dismiss_stale, or monitor). Use to filter out stale issues before proposing fixes.",
|
|
724
|
-
inputSchema: z7.object({
|
|
725
|
-
issue_id: z7.string().describe("The ID of the issue to validate"),
|
|
726
|
-
lookback_days: z7.number().optional().default(3).describe("Number of days to look back for recent occurrences (default: 3)")
|
|
727
|
-
}),
|
|
728
|
-
handler: async (args) => {
|
|
729
|
-
const { issue_id, lookback_days } = args;
|
|
730
|
-
if (!isApiConfigured()) {
|
|
731
|
-
return apiNotConfiguredResult();
|
|
732
|
-
}
|
|
733
|
-
const { data, error } = await apiPost(`/issues/${issue_id}/validate`, {
|
|
734
|
-
lookback_days: lookback_days ?? 3
|
|
735
|
-
});
|
|
736
|
-
if (error) {
|
|
737
|
-
return errorResult(error);
|
|
738
|
-
}
|
|
739
|
-
return successResult(data);
|
|
740
|
-
}
|
|
741
|
-
};
|
|
742
700
|
|
|
743
701
|
// ../../libraries/mcp-tools/dist/tools/discoverPersonas.js
|
|
744
702
|
import { z as z8 } from "zod";
|
|
@@ -765,42 +723,15 @@ var discoverPersonasTool = {
|
|
|
765
723
|
}
|
|
766
724
|
};
|
|
767
725
|
|
|
768
|
-
// ../../libraries/mcp-tools/dist/tools/getActionableIssues.js
|
|
769
|
-
import { z as z9 } from "zod";
|
|
770
|
-
var getActionableIssuesTool = {
|
|
771
|
-
name: "get_actionable_issues",
|
|
772
|
-
description: "Get UX issues with element context. Returns detected issues (rage clicks, dead clicks, errors, etc.) along with the most affected elements on each page. Use this when you want to understand and fix specific UX problems.",
|
|
773
|
-
inputSchema: z9.object({
|
|
774
|
-
page_path: z9.string().optional().describe("Filter to a specific page path (e.g., /checkout)"),
|
|
775
|
-
severity: z9.enum(["critical", "high", "medium", "low", "info"]).optional().describe("Minimum severity level to include"),
|
|
776
|
-
limit: z9.number().optional().default(10).describe("Maximum number of issues to return (default: 10)")
|
|
777
|
-
}),
|
|
778
|
-
handler: async (args) => {
|
|
779
|
-
const { page_path, severity, limit } = args;
|
|
780
|
-
if (!isApiConfigured()) {
|
|
781
|
-
return apiNotConfiguredResult();
|
|
782
|
-
}
|
|
783
|
-
const { data, error } = await apiGet("/actionable-issues", {
|
|
784
|
-
page_path,
|
|
785
|
-
severity,
|
|
786
|
-
limit: limit ?? 10
|
|
787
|
-
});
|
|
788
|
-
if (error) {
|
|
789
|
-
return errorResult(error);
|
|
790
|
-
}
|
|
791
|
-
return successResult(data);
|
|
792
|
-
}
|
|
793
|
-
};
|
|
794
|
-
|
|
795
726
|
// ../../libraries/mcp-tools/dist/tools/getAnomalies.js
|
|
796
|
-
import { z as
|
|
727
|
+
import { z as z9 } from "zod";
|
|
797
728
|
var getAnomaliesTool = {
|
|
798
729
|
name: "get_anomalies",
|
|
799
730
|
description: "Detect anomalous sessions and frustration spikes. Finds sessions that deviate from normal behavior patterns.",
|
|
800
|
-
inputSchema:
|
|
801
|
-
threshold:
|
|
802
|
-
days:
|
|
803
|
-
page_path:
|
|
731
|
+
inputSchema: z9.object({
|
|
732
|
+
threshold: z9.number().optional().default(0.35).describe("Anomaly threshold (0-1, default: 0.35)"),
|
|
733
|
+
days: z9.number().optional().default(7).describe("Days to analyze for frustration spikes (default: 7)"),
|
|
734
|
+
page_path: z9.string().optional().describe("Optional: filter to a specific page")
|
|
804
735
|
}),
|
|
805
736
|
handler: async (args) => {
|
|
806
737
|
const { threshold, days, page_path } = args;
|
|
@@ -820,15 +751,15 @@ var getAnomaliesTool = {
|
|
|
820
751
|
};
|
|
821
752
|
|
|
822
753
|
// ../../libraries/mcp-tools/dist/tools/getConsoleErrors.js
|
|
823
|
-
import { z as
|
|
754
|
+
import { z as z10 } from "zod";
|
|
824
755
|
var getConsoleErrorsTool = {
|
|
825
756
|
name: "get_console_errors",
|
|
826
757
|
description: "Query JavaScript console errors and warnings from user sessions. Use this when you suspect page unresponsiveness, broken buttons, or rendering issues. Returns the most common errors grouped by message, with session impact counts. High rage clicks on root/body elements often correlate with JS errors.",
|
|
827
|
-
inputSchema:
|
|
828
|
-
page_path:
|
|
829
|
-
session_id:
|
|
830
|
-
severity:
|
|
831
|
-
limit:
|
|
758
|
+
inputSchema: z10.object({
|
|
759
|
+
page_path: z10.string().optional().describe("Filter errors to a specific page path"),
|
|
760
|
+
session_id: z10.string().optional().describe("Filter errors to a specific session"),
|
|
761
|
+
severity: z10.enum(["error", "warn", "all"]).optional().default("error").describe('Filter by severity: "error" (default), "warn", or "all"'),
|
|
762
|
+
limit: z10.number().optional().default(200).describe("Max log documents to scan (default 200)")
|
|
832
763
|
}),
|
|
833
764
|
handler: async (args) => {
|
|
834
765
|
const { page_path, session_id, severity, limit } = args;
|
|
@@ -849,17 +780,17 @@ var getConsoleErrorsTool = {
|
|
|
849
780
|
};
|
|
850
781
|
|
|
851
782
|
// ../../libraries/mcp-tools/dist/tools/getCustomEvents.js
|
|
852
|
-
import { z as
|
|
783
|
+
import { z as z11 } from "zod";
|
|
853
784
|
var getCustomEventsTool = {
|
|
854
785
|
name: "get_custom_events",
|
|
855
786
|
description: "Query custom events tracked via Recapt.track(). Returns event occurrence counts, which pages they fire on, property distributions, and temporal patterns. Use to answer 'what custom events are being tracked?', 'how often does event X fire?', 'what properties does event Y have?', or 'which pages trigger the most events?'. These are app-specific events the developer explicitly tracks (purchases, signups, feature usage, etc.), not automatically captured behavioral data.",
|
|
856
|
-
inputSchema:
|
|
857
|
-
event_name:
|
|
858
|
-
page_path:
|
|
859
|
-
session_id:
|
|
860
|
-
property_filters:
|
|
861
|
-
days:
|
|
862
|
-
limit:
|
|
787
|
+
inputSchema: z11.object({
|
|
788
|
+
event_name: z11.string().optional().describe("Filter by event name (case-insensitive partial match). If omitted, returns all event types."),
|
|
789
|
+
page_path: z11.string().optional().describe("Filter events to a specific page path (partial match)"),
|
|
790
|
+
session_id: z11.string().optional().describe("Filter events to a specific session"),
|
|
791
|
+
property_filters: z11.record(z11.string(), z11.union([z11.string(), z11.number(), z11.boolean(), z11.null()])).optional().describe("Filter events by property values, e.g. { plan: 'pro', amount: 99 }"),
|
|
792
|
+
days: z11.number().optional().describe("Look back N days (default: 30)"),
|
|
793
|
+
limit: z11.number().optional().describe("Max documents to scan (default: 500, max: 2000)")
|
|
863
794
|
}),
|
|
864
795
|
handler: async (args) => {
|
|
865
796
|
const { event_name, page_path, session_id, property_filters, days, limit } = args;
|
|
@@ -886,8 +817,8 @@ var getCustomEventsTool = {
|
|
|
886
817
|
var listEventNamesTool = {
|
|
887
818
|
name: "list_event_names",
|
|
888
819
|
description: "List all unique custom event names tracked in the last N days. Use this to discover what events are available before querying specific events.",
|
|
889
|
-
inputSchema:
|
|
890
|
-
days:
|
|
820
|
+
inputSchema: z11.object({
|
|
821
|
+
days: z11.number().optional().describe("Look back N days (default: 30)")
|
|
891
822
|
}),
|
|
892
823
|
handler: async (args) => {
|
|
893
824
|
const { days } = args;
|
|
@@ -903,16 +834,16 @@ var listEventNamesTool = {
|
|
|
903
834
|
};
|
|
904
835
|
|
|
905
836
|
// ../../libraries/mcp-tools/dist/tools/getSessionComments.js
|
|
906
|
-
import { z as
|
|
837
|
+
import { z as z12 } from "zod";
|
|
907
838
|
var getSessionCommentsTool = {
|
|
908
839
|
name: "get_session_comments",
|
|
909
840
|
description: "Query user comments and feedback submitted during sessions. These are explicit comments users submit via the feedback widget or Recapt.comment() API - direct user voice about their experience. Use to find sessions where users reported issues, understand user sentiment, or identify pages generating the most feedback. Comments often contain valuable context about what frustrated or confused users.",
|
|
910
|
-
inputSchema:
|
|
911
|
-
session_id:
|
|
912
|
-
page_path:
|
|
913
|
-
search:
|
|
914
|
-
days:
|
|
915
|
-
limit:
|
|
841
|
+
inputSchema: z12.object({
|
|
842
|
+
session_id: z12.string().optional().describe("Filter comments to a specific session"),
|
|
843
|
+
page_path: z12.string().optional().describe("Filter comments to a specific page path (partial match)"),
|
|
844
|
+
search: z12.string().optional().describe("Search comments by text content (case-insensitive partial match)"),
|
|
845
|
+
days: z12.number().optional().describe("Look back N days (default: 30)"),
|
|
846
|
+
limit: z12.number().optional().describe("Max comments to return (default: 100, max: 500)")
|
|
916
847
|
}),
|
|
917
848
|
handler: async (args) => {
|
|
918
849
|
const { session_id, page_path, search, days, limit } = args;
|
|
@@ -935,8 +866,8 @@ var getSessionCommentsTool = {
|
|
|
935
866
|
var getCommentStatsTool = {
|
|
936
867
|
name: "get_comment_stats",
|
|
937
868
|
description: "Get statistics about user comments/feedback. Returns total comment count, which pages receive the most feedback, and daily trend. Use to understand feedback volume and identify pages where users are most vocal.",
|
|
938
|
-
inputSchema:
|
|
939
|
-
days:
|
|
869
|
+
inputSchema: z12.object({
|
|
870
|
+
days: z12.number().optional().describe("Look back N days (default: 30)")
|
|
940
871
|
}),
|
|
941
872
|
handler: async (args) => {
|
|
942
873
|
const { days } = args;
|
|
@@ -952,12 +883,12 @@ var getCommentStatsTool = {
|
|
|
952
883
|
};
|
|
953
884
|
|
|
954
885
|
// ../../libraries/mcp-tools/dist/tools/getDeadClicks.js
|
|
955
|
-
import { z as
|
|
886
|
+
import { z as z13 } from "zod";
|
|
956
887
|
var getDeadClicksTool = {
|
|
957
888
|
name: "get_dead_clicks",
|
|
958
889
|
description: "Find buttons and links that users click but nothing happens (dead clicks). These are interactive elements where the click produced no visible DOM change. Use this to identify BROKEN or UNRESPONSIVE UI elements that frustrate users.",
|
|
959
|
-
inputSchema:
|
|
960
|
-
page_path:
|
|
890
|
+
inputSchema: z13.object({
|
|
891
|
+
page_path: z13.string().describe("Page path to check for dead clicks (required)")
|
|
961
892
|
}),
|
|
962
893
|
handler: async (args) => {
|
|
963
894
|
const { page_path } = args;
|
|
@@ -975,11 +906,11 @@ var getDeadClicksTool = {
|
|
|
975
906
|
};
|
|
976
907
|
|
|
977
908
|
// ../../libraries/mcp-tools/dist/tools/getDomains.js
|
|
978
|
-
import { z as
|
|
909
|
+
import { z as z14 } from "zod";
|
|
979
910
|
var getDomainsTool = {
|
|
980
911
|
name: "get_domains",
|
|
981
912
|
description: "Get the list of domains configured for the organization. Domains represent different websites or applications being tracked.",
|
|
982
|
-
inputSchema:
|
|
913
|
+
inputSchema: z14.object({}),
|
|
983
914
|
handler: async () => {
|
|
984
915
|
if (!isApiConfigured()) {
|
|
985
916
|
return apiNotConfiguredResult();
|
|
@@ -993,13 +924,13 @@ var getDomainsTool = {
|
|
|
993
924
|
};
|
|
994
925
|
|
|
995
926
|
// ../../libraries/mcp-tools/dist/tools/getElementFriction.js
|
|
996
|
-
import { z as
|
|
927
|
+
import { z as z15 } from "zod";
|
|
997
928
|
var getElementFrictionTool = {
|
|
998
929
|
name: "get_element_friction",
|
|
999
930
|
description: "Get per-element friction data for a page. Shows which elements cause user frustration, with click counts and dominant frustration signals.",
|
|
1000
|
-
inputSchema:
|
|
1001
|
-
page_path:
|
|
1002
|
-
selector_filter:
|
|
931
|
+
inputSchema: z15.object({
|
|
932
|
+
page_path: z15.string().describe("Page path to analyze (e.g., /checkout)"),
|
|
933
|
+
selector_filter: z15.string().optional().describe("Optional: filter elements by selector substring")
|
|
1003
934
|
}),
|
|
1004
935
|
handler: async (args) => {
|
|
1005
936
|
const { page_path, selector_filter } = args;
|
|
@@ -1018,14 +949,14 @@ var getElementFrictionTool = {
|
|
|
1018
949
|
};
|
|
1019
950
|
|
|
1020
951
|
// ../../libraries/mcp-tools/dist/tools/getFlowFriction.js
|
|
1021
|
-
import { z as
|
|
952
|
+
import { z as z16 } from "zod";
|
|
1022
953
|
var getFlowFrictionTool = {
|
|
1023
954
|
name: "get_flow_friction",
|
|
1024
955
|
description: "Discover user flows with behavioral metrics. Returns navigation transitions with frustration, confusion, and health scores for each page in the flow. Also flags backtrack hotspots (pages users return to) and dropoff pages. Use this to find which flows need optimization.",
|
|
1025
|
-
inputSchema:
|
|
1026
|
-
page_path:
|
|
1027
|
-
days:
|
|
1028
|
-
limit:
|
|
956
|
+
inputSchema: z16.object({
|
|
957
|
+
page_path: z16.string().optional().describe("Focus on flows involving this page (e.g., /checkout)"),
|
|
958
|
+
days: z16.number().optional().default(7).describe("Number of days to analyze (default: 7)"),
|
|
959
|
+
limit: z16.number().optional().default(10).describe("Maximum number of flows to return (default: 10)")
|
|
1029
960
|
}),
|
|
1030
961
|
handler: async (args) => {
|
|
1031
962
|
const { page_path, days, limit } = args;
|
|
@@ -1045,12 +976,12 @@ var getFlowFrictionTool = {
|
|
|
1045
976
|
};
|
|
1046
977
|
|
|
1047
978
|
// ../../libraries/mcp-tools/dist/tools/getFormFriction.js
|
|
1048
|
-
import { z as
|
|
979
|
+
import { z as z17 } from "zod";
|
|
1049
980
|
var getFormFrictionTool = {
|
|
1050
981
|
name: "get_form_friction",
|
|
1051
982
|
description: "Analyze which form fields cause friction on a page. Returns per-field metrics including dwell time, correction rate, and abandonment rate. Use this to identify problematic form fields in checkout, signup, or other forms.",
|
|
1052
|
-
inputSchema:
|
|
1053
|
-
page_path:
|
|
983
|
+
inputSchema: z17.object({
|
|
984
|
+
page_path: z17.string().describe("Page path containing the form to analyze (required)")
|
|
1054
985
|
}),
|
|
1055
986
|
handler: async (args) => {
|
|
1056
987
|
const { page_path } = args;
|
|
@@ -1067,64 +998,14 @@ var getFormFrictionTool = {
|
|
|
1067
998
|
}
|
|
1068
999
|
};
|
|
1069
1000
|
|
|
1070
|
-
// ../../libraries/mcp-tools/dist/tools/getIssues.js
|
|
1071
|
-
import { z as z19 } from "zod";
|
|
1072
|
-
var VALID_CATEGORIES = [
|
|
1073
|
-
"code_error",
|
|
1074
|
-
"dead_click",
|
|
1075
|
-
"rage_click",
|
|
1076
|
-
"ux_friction",
|
|
1077
|
-
"performance",
|
|
1078
|
-
"form_issue",
|
|
1079
|
-
"behavioral_anomaly",
|
|
1080
|
-
"structural_issue"
|
|
1081
|
-
];
|
|
1082
|
-
var VALID_SEVERITIES = ["critical", "high", "medium", "low", "info"];
|
|
1083
|
-
var VALID_STATUSES = [
|
|
1084
|
-
"pending",
|
|
1085
|
-
"active",
|
|
1086
|
-
"escalated",
|
|
1087
|
-
"resolved",
|
|
1088
|
-
"dismissed",
|
|
1089
|
-
"expired"
|
|
1090
|
-
];
|
|
1091
|
-
var getIssuesTool = {
|
|
1092
|
-
name: "get_issues",
|
|
1093
|
-
description: "Get detected UX issues. Issues are automatically detected from session recordings and include rage clicks, dead clicks, form issues, and behavioral anomalies.",
|
|
1094
|
-
inputSchema: z19.object({
|
|
1095
|
-
page_path: z19.string().optional().describe("Filter issues to a specific page path"),
|
|
1096
|
-
category: z19.enum(VALID_CATEGORIES).optional().describe("Filter by issue category"),
|
|
1097
|
-
severity: z19.enum(VALID_SEVERITIES).optional().describe("Filter by severity level"),
|
|
1098
|
-
status: z19.enum(VALID_STATUSES).optional().default("active").describe("Filter by status (default: active)"),
|
|
1099
|
-
limit: z19.number().optional().default(20).describe("Maximum number of issues to return (default: 20)")
|
|
1100
|
-
}),
|
|
1101
|
-
handler: async (args) => {
|
|
1102
|
-
const { page_path, category, severity, status, limit } = args;
|
|
1103
|
-
if (!isApiConfigured()) {
|
|
1104
|
-
return apiNotConfiguredResult();
|
|
1105
|
-
}
|
|
1106
|
-
const { data, error } = await apiGet("/issues", {
|
|
1107
|
-
page_path,
|
|
1108
|
-
category,
|
|
1109
|
-
severity,
|
|
1110
|
-
status: status ?? "active",
|
|
1111
|
-
limit: limit ?? 20
|
|
1112
|
-
});
|
|
1113
|
-
if (error) {
|
|
1114
|
-
return errorResult(error);
|
|
1115
|
-
}
|
|
1116
|
-
return successResult(data);
|
|
1117
|
-
}
|
|
1118
|
-
};
|
|
1119
|
-
|
|
1120
1001
|
// ../../libraries/mcp-tools/dist/tools/getJourneyPatterns.js
|
|
1121
|
-
import { z as
|
|
1002
|
+
import { z as z18 } from "zod";
|
|
1122
1003
|
var getJourneyPatternsTool = {
|
|
1123
1004
|
name: "get_journey_patterns",
|
|
1124
1005
|
description: "Discover navigation patterns across sessions. Returns top page transitions, backtrack hotspots (pages users return to), and dropoff pages (where sessions end). Use this to understand organic user navigation.",
|
|
1125
|
-
inputSchema:
|
|
1126
|
-
page_path:
|
|
1127
|
-
days:
|
|
1006
|
+
inputSchema: z18.object({
|
|
1007
|
+
page_path: z18.string().optional().describe("Filter to transitions involving this page (e.g., /pricing)"),
|
|
1008
|
+
days: z18.number().optional().default(7).describe("Number of days to analyze (default: 7)")
|
|
1128
1009
|
}),
|
|
1129
1010
|
handler: async (args) => {
|
|
1130
1011
|
const { page_path, days } = args;
|
|
@@ -1143,13 +1024,13 @@ var getJourneyPatternsTool = {
|
|
|
1143
1024
|
};
|
|
1144
1025
|
|
|
1145
1026
|
// ../../libraries/mcp-tools/dist/tools/getPageMetrics.js
|
|
1146
|
-
import { z as
|
|
1027
|
+
import { z as z19 } from "zod";
|
|
1147
1028
|
var getPageMetricsTool = {
|
|
1148
1029
|
name: "get_page_metrics",
|
|
1149
1030
|
description: "Get aggregated behavioral metrics for a page. Returns frustration, confusion, confidence, energy scores, and health score. If page_path is omitted, returns metrics for all pages.",
|
|
1150
|
-
inputSchema:
|
|
1151
|
-
page_path:
|
|
1152
|
-
days:
|
|
1031
|
+
inputSchema: z19.object({
|
|
1032
|
+
page_path: z19.string().optional().describe("Page path to get metrics for (e.g., /checkout). Omit to get all pages."),
|
|
1033
|
+
days: z19.number().optional().default(7).describe("Number of days to look back (default: 7)")
|
|
1153
1034
|
}),
|
|
1154
1035
|
handler: async (args) => {
|
|
1155
1036
|
const { page_path, days } = args;
|
|
@@ -1168,13 +1049,13 @@ var getPageMetricsTool = {
|
|
|
1168
1049
|
};
|
|
1169
1050
|
|
|
1170
1051
|
// ../../libraries/mcp-tools/dist/tools/getPageTrends.js
|
|
1171
|
-
import { z as
|
|
1052
|
+
import { z as z20 } from "zod";
|
|
1172
1053
|
var getPageTrendsTool = {
|
|
1173
1054
|
name: "get_page_trends",
|
|
1174
1055
|
description: "Get daily behavioral trends for a page. Shows how frustration, confusion, and confidence change over time.",
|
|
1175
|
-
inputSchema:
|
|
1176
|
-
page_path:
|
|
1177
|
-
days:
|
|
1056
|
+
inputSchema: z20.object({
|
|
1057
|
+
page_path: z20.string().describe("Page path to analyze (e.g., /checkout)"),
|
|
1058
|
+
days: z20.number().optional().default(14).describe("Number of days to look back (default: 14)")
|
|
1178
1059
|
}),
|
|
1179
1060
|
handler: async (args) => {
|
|
1180
1061
|
const { page_path, days } = args;
|
|
@@ -1193,13 +1074,13 @@ var getPageTrendsTool = {
|
|
|
1193
1074
|
};
|
|
1194
1075
|
|
|
1195
1076
|
// ../../libraries/mcp-tools/dist/tools/getSessionDetails.js
|
|
1196
|
-
import { z as
|
|
1077
|
+
import { z as z21 } from "zod";
|
|
1197
1078
|
var getSessionDetailsTool = {
|
|
1198
1079
|
name: "get_session_details",
|
|
1199
1080
|
description: "Get behavioral timeline for one or more sessions. Shows how frustration, confusion, and confidence evolved over time. Accepts a single session_id or an array of session_ids (max 20).",
|
|
1200
|
-
inputSchema:
|
|
1201
|
-
session_id:
|
|
1202
|
-
session_ids:
|
|
1081
|
+
inputSchema: z21.object({
|
|
1082
|
+
session_id: z21.string().optional().describe("Single session ID to get details for"),
|
|
1083
|
+
session_ids: z21.array(z21.string()).max(20).optional().describe("Array of session IDs to get details for (max 20)")
|
|
1203
1084
|
}),
|
|
1204
1085
|
handler: async (args) => {
|
|
1205
1086
|
const { session_id, session_ids } = args;
|
|
@@ -1228,13 +1109,13 @@ var getSessionDetailsTool = {
|
|
|
1228
1109
|
};
|
|
1229
1110
|
|
|
1230
1111
|
// ../../libraries/mcp-tools/dist/tools/getSessionPages.js
|
|
1231
|
-
import { z as
|
|
1112
|
+
import { z as z22 } from "zod";
|
|
1232
1113
|
var getSessionPagesTool = {
|
|
1233
1114
|
name: "get_session_pages",
|
|
1234
1115
|
description: "Get the pages visited within one or more sessions. Returns navigation history with timestamps, source pages, and dwell times. Use this to understand the user's journey through the site during a session. Accepts a single session_id or an array of session_ids (max 20).",
|
|
1235
|
-
inputSchema:
|
|
1236
|
-
session_id:
|
|
1237
|
-
session_ids:
|
|
1116
|
+
inputSchema: z22.object({
|
|
1117
|
+
session_id: z22.string().optional().describe("Single session ID to get pages for"),
|
|
1118
|
+
session_ids: z22.array(z22.string()).max(20).optional().describe("Array of session IDs to get pages for (max 20)")
|
|
1238
1119
|
}),
|
|
1239
1120
|
handler: async (args) => {
|
|
1240
1121
|
const { session_id, session_ids } = args;
|
|
@@ -1263,13 +1144,13 @@ var getSessionPagesTool = {
|
|
|
1263
1144
|
};
|
|
1264
1145
|
|
|
1265
1146
|
// ../../libraries/mcp-tools/dist/tools/getUxHealthReport.js
|
|
1266
|
-
import { z as
|
|
1147
|
+
import { z as z23 } from "zod";
|
|
1267
1148
|
var getUxHealthReportTool = {
|
|
1268
1149
|
name: "get_ux_health_report",
|
|
1269
1150
|
description: "Get a comprehensive UX health report combining page metrics, issues, and anomalies. Returns overall health score, per-page breakdown, active issues, and frustration spikes. Use this as a starting point to understand overall UX state before diving deeper.",
|
|
1270
|
-
inputSchema:
|
|
1271
|
-
page_path:
|
|
1272
|
-
days:
|
|
1151
|
+
inputSchema: z23.object({
|
|
1152
|
+
page_path: z23.string().optional().describe("Focus on a specific page (omit for site-wide report)"),
|
|
1153
|
+
days: z23.number().optional().default(7).describe("Number of days to analyze (default: 7)")
|
|
1273
1154
|
}),
|
|
1274
1155
|
handler: async (args) => {
|
|
1275
1156
|
const { page_path, days } = args;
|
|
@@ -1288,7 +1169,7 @@ var getUxHealthReportTool = {
|
|
|
1288
1169
|
};
|
|
1289
1170
|
|
|
1290
1171
|
// ../../libraries/mcp-tools/dist/tools/upgradeOptions.js
|
|
1291
|
-
import { z as
|
|
1172
|
+
import { z as z24 } from "zod";
|
|
1292
1173
|
function formatUpgradeOptions(data) {
|
|
1293
1174
|
const lines = [];
|
|
1294
1175
|
lines.push("# UPGRADE OPTIONS\n");
|
|
@@ -1320,7 +1201,7 @@ function formatUpgradeOptions(data) {
|
|
|
1320
1201
|
var getUpgradeOptionsTool = {
|
|
1321
1202
|
name: "get_upgrade_options",
|
|
1322
1203
|
description: "Get available upgrade options for the current plan. Use this when a user hits a feature limit or when you need to explain what's available on higher tiers. Returns the current plan, available upgrades with their features and benefits, and a direct link to the billing page. Use this to help users understand the value of upgrading when they encounter gated features.",
|
|
1323
|
-
inputSchema:
|
|
1204
|
+
inputSchema: z24.object({}),
|
|
1324
1205
|
handler: async () => {
|
|
1325
1206
|
if (!isApiConfigured()) {
|
|
1326
1207
|
return apiNotConfiguredResult();
|
|
@@ -1335,16 +1216,16 @@ var getUpgradeOptionsTool = {
|
|
|
1335
1216
|
};
|
|
1336
1217
|
|
|
1337
1218
|
// ../../libraries/mcp-tools/dist/tools/improvementRun.js
|
|
1338
|
-
import { z as
|
|
1219
|
+
import { z as z25 } from "zod";
|
|
1339
1220
|
var startImprovementRunTool = {
|
|
1340
1221
|
name: "start_improvement_run",
|
|
1341
1222
|
description: "Register the start of a self-improvement workflow run. Call this at the beginning of an improvement session to track the run and its outcomes. Returns a run ID to use for subsequent updates.",
|
|
1342
|
-
inputSchema:
|
|
1343
|
-
trigger_type:
|
|
1344
|
-
trigger_metadata:
|
|
1345
|
-
phases:
|
|
1346
|
-
name:
|
|
1347
|
-
status:
|
|
1223
|
+
inputSchema: z25.object({
|
|
1224
|
+
trigger_type: z25.enum(["github_actions", "cron", "manual", "api"]).describe("What triggered this improvement run"),
|
|
1225
|
+
trigger_metadata: z25.record(z25.unknown()).optional().describe("Additional metadata about the trigger (e.g., GitHub run ID, branch, actor)"),
|
|
1226
|
+
phases: z25.array(z25.object({
|
|
1227
|
+
name: z25.string(),
|
|
1228
|
+
status: z25.enum(["pending", "running", "completed", "skipped", "failed"]).default("pending")
|
|
1348
1229
|
})).optional().describe("Initial phases to track (e.g., diagnose, investigate, fix)")
|
|
1349
1230
|
}),
|
|
1350
1231
|
handler: async (args) => {
|
|
@@ -1366,38 +1247,38 @@ var startImprovementRunTool = {
|
|
|
1366
1247
|
var updateImprovementRunTool = {
|
|
1367
1248
|
name: "update_improvement_run",
|
|
1368
1249
|
description: "Update an improvement run's status, phases, summary, or diagnostic data. Use to track progress through the workflow phases and record final outcomes.",
|
|
1369
|
-
inputSchema:
|
|
1370
|
-
run_id:
|
|
1371
|
-
status:
|
|
1372
|
-
title:
|
|
1373
|
-
phases:
|
|
1374
|
-
name:
|
|
1375
|
-
status:
|
|
1250
|
+
inputSchema: z25.object({
|
|
1251
|
+
run_id: z25.string().describe("The ID of the improvement run to update"),
|
|
1252
|
+
status: z25.enum(["running", "completed", "failed", "cancelled"]).optional().describe("New status for the run"),
|
|
1253
|
+
title: z25.string().optional().describe("A user-friendly title summarizing what was improved (e.g., 'Fixed checkout responsiveness, improved mobile navigation'). Avoid technical jargon - write for non-developers."),
|
|
1254
|
+
phases: z25.array(z25.object({
|
|
1255
|
+
name: z25.string(),
|
|
1256
|
+
status: z25.enum([
|
|
1376
1257
|
"pending",
|
|
1377
1258
|
"running",
|
|
1378
1259
|
"completed",
|
|
1379
1260
|
"skipped",
|
|
1380
1261
|
"failed"
|
|
1381
1262
|
]),
|
|
1382
|
-
startedAt:
|
|
1383
|
-
completedAt:
|
|
1384
|
-
output:
|
|
1263
|
+
startedAt: z25.string().nullable().optional(),
|
|
1264
|
+
completedAt: z25.string().nullable().optional(),
|
|
1265
|
+
output: z25.record(z25.unknown()).optional()
|
|
1385
1266
|
})).optional().describe("Updated phases array"),
|
|
1386
|
-
summary:
|
|
1387
|
-
issuesFound:
|
|
1388
|
-
issuesFixed:
|
|
1389
|
-
issuesDeferred:
|
|
1390
|
-
issuesDismissed:
|
|
1391
|
-
prsCreated:
|
|
1267
|
+
summary: z25.object({
|
|
1268
|
+
issuesFound: z25.number().optional(),
|
|
1269
|
+
issuesFixed: z25.number().optional(),
|
|
1270
|
+
issuesDeferred: z25.number().optional(),
|
|
1271
|
+
issuesDismissed: z25.number().optional(),
|
|
1272
|
+
prsCreated: z25.number().optional()
|
|
1392
1273
|
}).optional().describe("Updated summary counts"),
|
|
1393
|
-
diagnostic:
|
|
1394
|
-
healthScore:
|
|
1395
|
-
totalSessions:
|
|
1396
|
-
pagesAnalyzed:
|
|
1397
|
-
summary:
|
|
1274
|
+
diagnostic: z25.object({
|
|
1275
|
+
healthScore: z25.number().describe("Site health score (0-100)"),
|
|
1276
|
+
totalSessions: z25.number().describe("Number of sessions analyzed"),
|
|
1277
|
+
pagesAnalyzed: z25.number().describe("Number of pages with data"),
|
|
1278
|
+
summary: z25.string().nullable().optional().describe("1-2 sentence summary of the site's current state and key findings")
|
|
1398
1279
|
}).optional().describe("Diagnostic data from run_full_diagnostic. Set after diagnosis phase completes."),
|
|
1399
|
-
completed_at:
|
|
1400
|
-
duration_ms:
|
|
1280
|
+
completed_at: z25.string().optional().describe("ISO timestamp when the run completed"),
|
|
1281
|
+
duration_ms: z25.number().optional().describe("Total duration of the run in milliseconds")
|
|
1401
1282
|
}),
|
|
1402
1283
|
handler: async (args) => {
|
|
1403
1284
|
const { run_id, status, title, phases, summary, diagnostic, completed_at, duration_ms } = args;
|
|
@@ -1422,35 +1303,35 @@ var updateImprovementRunTool = {
|
|
|
1422
1303
|
var recordImprovementActionTool = {
|
|
1423
1304
|
name: "record_improvement_action",
|
|
1424
1305
|
description: "Record an action taken during an improvement run. REQUIRED: run_id, action_type, hypothesis, expected_improvement. For code_fix: include code_changes array with actual unified diff format (not descriptions). For needs_more_data: include deferral_reason. For dismissed: include dismissal_reason. Use expected_improvement='N/A' for non-fix actions.",
|
|
1425
|
-
inputSchema:
|
|
1426
|
-
run_id:
|
|
1427
|
-
issue_id:
|
|
1428
|
-
action_type:
|
|
1306
|
+
inputSchema: z25.object({
|
|
1307
|
+
run_id: z25.string().describe("REQUIRED. The ID of the improvement run"),
|
|
1308
|
+
issue_id: z25.string().optional().describe("The ID of the issue this action relates to (if any)"),
|
|
1309
|
+
action_type: z25.enum([
|
|
1429
1310
|
"code_fix",
|
|
1430
1311
|
"needs_more_data",
|
|
1431
1312
|
"dismissed",
|
|
1432
1313
|
"marked_intended",
|
|
1433
1314
|
"knowledge_added"
|
|
1434
1315
|
]).describe("REQUIRED. Type of action taken"),
|
|
1435
|
-
hypothesis:
|
|
1436
|
-
expected_improvement:
|
|
1437
|
-
code_changes:
|
|
1438
|
-
file:
|
|
1439
|
-
diff:
|
|
1440
|
-
startLine:
|
|
1441
|
-
linesAdded:
|
|
1442
|
-
linesRemoved:
|
|
1316
|
+
hypothesis: z25.string().describe("REQUIRED. AI's reasoning for this action"),
|
|
1317
|
+
expected_improvement: z25.string().describe("REQUIRED. What improvement is expected (use 'N/A' for non-fix actions)"),
|
|
1318
|
+
code_changes: z25.array(z25.object({
|
|
1319
|
+
file: z25.string().describe("Path to the changed file"),
|
|
1320
|
+
diff: z25.string().describe("Unified diff format code changes"),
|
|
1321
|
+
startLine: z25.number().describe("Line number where the diff begins"),
|
|
1322
|
+
linesAdded: z25.number().default(0).describe("Count of lines added"),
|
|
1323
|
+
linesRemoved: z25.number().default(0).describe("Count of lines removed")
|
|
1443
1324
|
})).optional().describe("Array of code changes with actual source code diffs"),
|
|
1444
|
-
pr_url:
|
|
1445
|
-
pr_number:
|
|
1446
|
-
remediation_id:
|
|
1447
|
-
deferral_reason:
|
|
1448
|
-
dismissal_reason:
|
|
1449
|
-
page_path:
|
|
1450
|
-
element_selector:
|
|
1451
|
-
diagnosis:
|
|
1452
|
-
proposed_fix:
|
|
1453
|
-
confidence:
|
|
1325
|
+
pr_url: z25.string().optional().describe("GitHub PR URL if a PR was created"),
|
|
1326
|
+
pr_number: z25.number().optional().describe("GitHub PR number"),
|
|
1327
|
+
remediation_id: z25.string().optional().describe("ID of the associated remediation record (if any)"),
|
|
1328
|
+
deferral_reason: z25.string().optional().describe("Explanation for why the issue was deferred (for needs_more_data actions)"),
|
|
1329
|
+
dismissal_reason: z25.string().optional().describe("Explanation for why the issue was dismissed (for dismissed/marked_intended actions)"),
|
|
1330
|
+
page_path: z25.string().optional().describe("Page path affected by the fix"),
|
|
1331
|
+
element_selector: z25.string().optional().describe("CSS selector of the affected element"),
|
|
1332
|
+
diagnosis: z25.string().optional().describe("Root cause analysis"),
|
|
1333
|
+
proposed_fix: z25.string().optional().describe("Fix description"),
|
|
1334
|
+
confidence: z25.number().min(0).max(1).optional().describe("Fix confidence 0-1")
|
|
1454
1335
|
}),
|
|
1455
1336
|
handler: async (args) => {
|
|
1456
1337
|
const { run_id, issue_id, action_type, hypothesis, expected_improvement, code_changes, pr_url, pr_number, remediation_id, deferral_reason, dismissal_reason, page_path, element_selector, diagnosis, proposed_fix, confidence } = args;
|
|
@@ -1489,11 +1370,11 @@ var recordImprovementActionTool = {
|
|
|
1489
1370
|
var updateImprovementActionTool = {
|
|
1490
1371
|
name: "update_improvement_action",
|
|
1491
1372
|
description: "Update an existing improvement run action with PR information. Use this after a PR has been created to link it to the action.",
|
|
1492
|
-
inputSchema:
|
|
1493
|
-
run_id:
|
|
1494
|
-
action_id:
|
|
1495
|
-
pr_url:
|
|
1496
|
-
pr_number:
|
|
1373
|
+
inputSchema: z25.object({
|
|
1374
|
+
run_id: z25.string().describe("The ID of the improvement run"),
|
|
1375
|
+
action_id: z25.string().describe("The ID of the action to update"),
|
|
1376
|
+
pr_url: z25.string().optional().describe("GitHub PR URL to link to this action"),
|
|
1377
|
+
pr_number: z25.number().optional().describe("GitHub PR number to link to this action")
|
|
1497
1378
|
}),
|
|
1498
1379
|
handler: async (args) => {
|
|
1499
1380
|
const { run_id, action_id, pr_url, pr_number } = args;
|
|
@@ -1513,8 +1394,8 @@ var updateImprovementActionTool = {
|
|
|
1513
1394
|
var getImprovementRunTool = {
|
|
1514
1395
|
name: "get_improvement_run",
|
|
1515
1396
|
description: "Get details of a specific improvement run including all actions taken. Use to review what happened during a run.",
|
|
1516
|
-
inputSchema:
|
|
1517
|
-
run_id:
|
|
1397
|
+
inputSchema: z25.object({
|
|
1398
|
+
run_id: z25.string().describe("The ID of the improvement run to retrieve")
|
|
1518
1399
|
}),
|
|
1519
1400
|
handler: async (args) => {
|
|
1520
1401
|
const { run_id } = args;
|
|
@@ -1531,11 +1412,11 @@ var getImprovementRunTool = {
|
|
|
1531
1412
|
var listImprovementRunsTool = {
|
|
1532
1413
|
name: "list_improvement_runs",
|
|
1533
1414
|
description: "List recent improvement runs with optional filters. Use to review past runs and their outcomes.",
|
|
1534
|
-
inputSchema:
|
|
1535
|
-
status:
|
|
1536
|
-
trigger_type:
|
|
1537
|
-
limit:
|
|
1538
|
-
offset:
|
|
1415
|
+
inputSchema: z25.object({
|
|
1416
|
+
status: z25.enum(["running", "completed", "failed", "cancelled"]).optional().describe("Filter by run status"),
|
|
1417
|
+
trigger_type: z25.enum(["github_actions", "cron", "manual", "api"]).optional().describe("Filter by trigger type"),
|
|
1418
|
+
limit: z25.number().optional().default(20).describe("Maximum number of results (default: 20)"),
|
|
1419
|
+
offset: z25.number().optional().default(0).describe("Offset for pagination")
|
|
1539
1420
|
}),
|
|
1540
1421
|
handler: async (args) => {
|
|
1541
1422
|
const { status, trigger_type, limit, offset } = args;
|
|
@@ -1556,7 +1437,7 @@ var listImprovementRunsTool = {
|
|
|
1556
1437
|
};
|
|
1557
1438
|
|
|
1558
1439
|
// ../../libraries/mcp-tools/dist/tools/knowledge.js
|
|
1559
|
-
import { z as
|
|
1440
|
+
import { z as z26 } from "zod";
|
|
1560
1441
|
var KNOWLEDGE_CATEGORIES = [
|
|
1561
1442
|
"false_positive",
|
|
1562
1443
|
"intended_behavior",
|
|
@@ -1576,11 +1457,11 @@ var ISSUE_CATEGORIES = [
|
|
|
1576
1457
|
var getSiteKnowledgeTool = {
|
|
1577
1458
|
name: "get_site_knowledge",
|
|
1578
1459
|
description: "Retrieve site-specific learnings including known false positives, intended behaviors, and successful fix patterns. Use at the start of a self-improvement workflow to avoid re-flagging known issues.",
|
|
1579
|
-
inputSchema:
|
|
1580
|
-
category:
|
|
1581
|
-
page_path:
|
|
1582
|
-
issue_category:
|
|
1583
|
-
limit:
|
|
1460
|
+
inputSchema: z26.object({
|
|
1461
|
+
category: z26.enum(KNOWLEDGE_CATEGORIES).optional().describe("Filter by knowledge category"),
|
|
1462
|
+
page_path: z26.string().optional().describe("Filter by page path"),
|
|
1463
|
+
issue_category: z26.enum(ISSUE_CATEGORIES).optional().describe("Filter by issue category"),
|
|
1464
|
+
limit: z26.number().optional().default(50).describe("Maximum number of entries to return (default: 50)")
|
|
1584
1465
|
}),
|
|
1585
1466
|
handler: async (args) => {
|
|
1586
1467
|
const { category, page_path, issue_category, limit } = args;
|
|
@@ -1602,13 +1483,13 @@ var getSiteKnowledgeTool = {
|
|
|
1602
1483
|
var addSiteKnowledgeTool = {
|
|
1603
1484
|
name: "add_site_knowledge",
|
|
1604
1485
|
description: "Store a site-specific learning. Use to record false positives, intended behaviors, successful fix patterns, or important context about the site.",
|
|
1605
|
-
inputSchema:
|
|
1606
|
-
category:
|
|
1607
|
-
subject:
|
|
1608
|
-
content:
|
|
1609
|
-
page_path:
|
|
1610
|
-
element_selector:
|
|
1611
|
-
issue_category:
|
|
1486
|
+
inputSchema: z26.object({
|
|
1487
|
+
category: z26.enum(KNOWLEDGE_CATEGORIES).describe("Category of knowledge: false_positive, intended_behavior, fix_pattern, or context"),
|
|
1488
|
+
subject: z26.string().describe("Unique identifier/title for this knowledge entry"),
|
|
1489
|
+
content: z26.string().describe("Detailed description of the learning"),
|
|
1490
|
+
page_path: z26.string().optional().describe("Associated page path (if applicable)"),
|
|
1491
|
+
element_selector: z26.string().optional().describe("Associated element selector (if applicable)"),
|
|
1492
|
+
issue_category: z26.enum(ISSUE_CATEGORIES).optional().describe("Associated issue category (if applicable)")
|
|
1612
1493
|
}),
|
|
1613
1494
|
handler: async (args) => {
|
|
1614
1495
|
const { category, subject, content, page_path, element_selector, issue_category } = args;
|
|
@@ -1633,8 +1514,8 @@ var addSiteKnowledgeTool = {
|
|
|
1633
1514
|
var deleteSiteKnowledgeTool = {
|
|
1634
1515
|
name: "delete_site_knowledge",
|
|
1635
1516
|
description: "Delete a site knowledge entry. Use when a learning is no longer valid or was created in error.",
|
|
1636
|
-
inputSchema:
|
|
1637
|
-
knowledge_id:
|
|
1517
|
+
inputSchema: z26.object({
|
|
1518
|
+
knowledge_id: z26.string().describe("The ID of the knowledge entry to delete")
|
|
1638
1519
|
}),
|
|
1639
1520
|
handler: async (args) => {
|
|
1640
1521
|
const { knowledge_id } = args;
|
|
@@ -1648,37 +1529,15 @@ var deleteSiteKnowledgeTool = {
|
|
|
1648
1529
|
return successResult(data);
|
|
1649
1530
|
}
|
|
1650
1531
|
};
|
|
1651
|
-
var getSimilarFixesTool = {
|
|
1652
|
-
name: "get_similar_fixes",
|
|
1653
|
-
description: "Find past fixes for similar issues. Returns successful and failed remediation attempts for issues with the same category, page, or element. Use before proposing a fix to learn from past attempts.",
|
|
1654
|
-
inputSchema: z28.object({
|
|
1655
|
-
issue_id: z28.string().describe("The ID of the issue to find similar fixes for"),
|
|
1656
|
-
limit: z28.number().optional().default(5).describe("Maximum number of similar fixes to return (default: 5)")
|
|
1657
|
-
}),
|
|
1658
|
-
handler: async (args) => {
|
|
1659
|
-
const { issue_id, limit } = args;
|
|
1660
|
-
if (!isApiConfigured()) {
|
|
1661
|
-
return apiNotConfiguredResult();
|
|
1662
|
-
}
|
|
1663
|
-
const { data, error } = await apiGet("/knowledge/similar-fixes", {
|
|
1664
|
-
issue_id,
|
|
1665
|
-
limit: limit ?? 5
|
|
1666
|
-
});
|
|
1667
|
-
if (error) {
|
|
1668
|
-
return errorResult(error);
|
|
1669
|
-
}
|
|
1670
|
-
return successResult(data);
|
|
1671
|
-
}
|
|
1672
|
-
};
|
|
1673
1532
|
|
|
1674
1533
|
// ../../libraries/mcp-tools/dist/tools/listPages.js
|
|
1675
|
-
import { z as
|
|
1534
|
+
import { z as z27 } from "zod";
|
|
1676
1535
|
var listPagesTool = {
|
|
1677
1536
|
name: "list_pages",
|
|
1678
1537
|
description: "List all tracked pages with basic metrics. Returns page paths sorted by session count with frustration and health grade. Use this to discover what pages are being tracked before diving into specific pages.",
|
|
1679
|
-
inputSchema:
|
|
1680
|
-
days:
|
|
1681
|
-
limit:
|
|
1538
|
+
inputSchema: z27.object({
|
|
1539
|
+
days: z27.number().optional().default(7).describe("Number of days to look back (default 7)"),
|
|
1540
|
+
limit: z27.number().optional().default(50).describe("Maximum number of pages to return (default 50)")
|
|
1682
1541
|
}),
|
|
1683
1542
|
handler: async (args) => {
|
|
1684
1543
|
const { days, limit } = args;
|
|
@@ -1697,16 +1556,16 @@ var listPagesTool = {
|
|
|
1697
1556
|
};
|
|
1698
1557
|
|
|
1699
1558
|
// ../../libraries/mcp-tools/dist/tools/listSessions.js
|
|
1700
|
-
import { z as
|
|
1559
|
+
import { z as z28 } from "zod";
|
|
1701
1560
|
var listSessionsTool = {
|
|
1702
1561
|
name: "list_sessions",
|
|
1703
1562
|
description: "List and filter recorded sessions. Returns session metadata including status, duration, device, browser, and domains. Use to find sessions for a domain, check for active sessions, or browse by device type.",
|
|
1704
|
-
inputSchema:
|
|
1705
|
-
domain:
|
|
1706
|
-
status:
|
|
1707
|
-
device:
|
|
1708
|
-
days:
|
|
1709
|
-
limit:
|
|
1563
|
+
inputSchema: z28.object({
|
|
1564
|
+
domain: z28.string().optional().describe("Filter by domain name (partial match supported)"),
|
|
1565
|
+
status: z28.enum(["active", "terminated", "all"]).optional().default("all").describe("Filter by session status"),
|
|
1566
|
+
device: z28.enum(["desktop", "mobile", "tablet"]).optional().describe("Filter by device type"),
|
|
1567
|
+
days: z28.number().optional().default(7).describe("Number of days to look back (default: 7)"),
|
|
1568
|
+
limit: z28.number().optional().default(20).describe("Maximum sessions to return (default: 20, max: 200)")
|
|
1710
1569
|
}),
|
|
1711
1570
|
handler: async (args) => {
|
|
1712
1571
|
const { domain, status, device, days, limit } = args;
|
|
@@ -1728,16 +1587,16 @@ var listSessionsTool = {
|
|
|
1728
1587
|
};
|
|
1729
1588
|
|
|
1730
1589
|
// ../../libraries/mcp-tools/dist/tools/predictOutcomes.js
|
|
1731
|
-
import { z as
|
|
1590
|
+
import { z as z29 } from "zod";
|
|
1732
1591
|
var predictOutcomesTool = {
|
|
1733
1592
|
name: "predict_outcomes",
|
|
1734
1593
|
description: "Predict session outcomes based on early behavioral signals. Provide either a session_id to analyze an existing session, or behavioral_features to predict outcomes for hypothetical scenarios. Returns predicted outcome (COMPLETED, STRUGGLED, BLOCKED, DISENGAGED) with confidence.",
|
|
1735
|
-
inputSchema:
|
|
1736
|
-
session_id:
|
|
1737
|
-
behavioral_features:
|
|
1738
|
-
frustration:
|
|
1739
|
-
confusion:
|
|
1740
|
-
confidence:
|
|
1594
|
+
inputSchema: z29.object({
|
|
1595
|
+
session_id: z29.string().optional().describe("Session ID to analyze and predict outcome for"),
|
|
1596
|
+
behavioral_features: z29.object({
|
|
1597
|
+
frustration: z29.number().describe("Frustration score (0-1)"),
|
|
1598
|
+
confusion: z29.number().describe("Confusion score (0-1)"),
|
|
1599
|
+
confidence: z29.number().describe("Confidence score (0-1)")
|
|
1741
1600
|
}).optional().describe("Behavioral features to use for prediction")
|
|
1742
1601
|
}),
|
|
1743
1602
|
handler: async (args) => {
|
|
@@ -1760,36 +1619,49 @@ var predictOutcomesTool = {
|
|
|
1760
1619
|
};
|
|
1761
1620
|
|
|
1762
1621
|
// ../../libraries/mcp-tools/dist/tools/remediation.js
|
|
1763
|
-
import { z as
|
|
1622
|
+
import { z as z30 } from "zod";
|
|
1764
1623
|
var proposeFixTool = {
|
|
1765
1624
|
name: "propose_fix",
|
|
1766
|
-
description: "Propose a fix for
|
|
1767
|
-
inputSchema:
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1625
|
+
description: "Propose a fix for a UX issue. REQUIRED: page_path, diagnosis, proposed_fix, confidence. Creates a remediation record with baseline metrics for later evaluation. Returns remediation_id for tracking.",
|
|
1626
|
+
inputSchema: z30.object({
|
|
1627
|
+
page_path: z30.string().describe("REQUIRED. The page path where the issue occurs"),
|
|
1628
|
+
category: z30.enum([
|
|
1629
|
+
"code_error",
|
|
1630
|
+
"dead_click",
|
|
1631
|
+
"rage_click",
|
|
1632
|
+
"ux_friction",
|
|
1633
|
+
"performance",
|
|
1634
|
+
"form_issue",
|
|
1635
|
+
"behavioral_anomaly",
|
|
1636
|
+
"structural_issue"
|
|
1637
|
+
]).optional().describe("The issue category"),
|
|
1638
|
+
severity: z30.enum(["critical", "high", "medium", "low", "info"]).optional().describe("The issue severity"),
|
|
1639
|
+
diagnosis: z30.string().describe("REQUIRED. Detailed analysis of the root cause of the issue"),
|
|
1640
|
+
proposed_fix: z30.string().describe("REQUIRED. Description of the proposed fix and how it addresses the root cause"),
|
|
1641
|
+
code_snippet: z30.string().optional().describe("Suggested code changes (if applicable)"),
|
|
1642
|
+
affected_files: z30.array(z30.string()).optional().describe("List of files that need to be modified"),
|
|
1643
|
+
confidence: z30.number().min(0).max(1).describe("REQUIRED. Confidence level in the fix (0-1). Use <0.7 when uncertain."),
|
|
1644
|
+
title: z30.string().optional().describe("User-friendly title describing the issue from the user's perspective"),
|
|
1645
|
+
execution_metadata: z30.object({
|
|
1646
|
+
difficulty_class: z30.enum(["trivial", "light", "heavy"]),
|
|
1647
|
+
difficulty_reasoning: z30.string(),
|
|
1648
|
+
model_used: z30.string(),
|
|
1649
|
+
was_escalated: z30.boolean().optional(),
|
|
1650
|
+
escalation_reason: z30.string().optional(),
|
|
1651
|
+
iterations: z30.number().optional(),
|
|
1652
|
+
credits_used: z30.number().optional(),
|
|
1653
|
+
duration_ms: z30.number().optional()
|
|
1784
1654
|
}).optional().describe("AI execution metadata for tracking model selection and performance")
|
|
1785
1655
|
}),
|
|
1786
1656
|
handler: async (args) => {
|
|
1787
|
-
const {
|
|
1657
|
+
const { page_path, category, severity, diagnosis, proposed_fix, code_snippet, affected_files, confidence, title, execution_metadata } = args;
|
|
1788
1658
|
if (!isApiConfigured()) {
|
|
1789
1659
|
return apiNotConfiguredResult();
|
|
1790
1660
|
}
|
|
1791
1661
|
const { data, error } = await apiPost("/remediations", {
|
|
1792
|
-
|
|
1662
|
+
page_path,
|
|
1663
|
+
category,
|
|
1664
|
+
severity,
|
|
1793
1665
|
diagnosis,
|
|
1794
1666
|
proposed_fix,
|
|
1795
1667
|
code_snippet,
|
|
@@ -1807,7 +1679,7 @@ var proposeFixTool = {
|
|
|
1807
1679
|
var listPendingFixesTool = {
|
|
1808
1680
|
name: "list_pending_fixes",
|
|
1809
1681
|
description: "List all proposed fixes awaiting deployment. Use to show the user what fixes are ready to be deployed.",
|
|
1810
|
-
inputSchema:
|
|
1682
|
+
inputSchema: z30.object({}),
|
|
1811
1683
|
handler: async () => {
|
|
1812
1684
|
if (!isApiConfigured()) {
|
|
1813
1685
|
return apiNotConfiguredResult();
|
|
@@ -1822,8 +1694,8 @@ var listPendingFixesTool = {
|
|
|
1822
1694
|
var listRemediationsTool = {
|
|
1823
1695
|
name: "list_remediations",
|
|
1824
1696
|
description: "List remediation records with optional filters. Use to review past and current fix attempts.",
|
|
1825
|
-
inputSchema:
|
|
1826
|
-
status:
|
|
1697
|
+
inputSchema: z30.object({
|
|
1698
|
+
status: z30.enum([
|
|
1827
1699
|
"proposed",
|
|
1828
1700
|
"waiting",
|
|
1829
1701
|
"dismissed",
|
|
@@ -1834,19 +1706,28 @@ var listRemediationsTool = {
|
|
|
1834
1706
|
"reverted",
|
|
1835
1707
|
"deferred"
|
|
1836
1708
|
]).optional().describe("Filter by remediation status"),
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1709
|
+
page_path: z30.string().optional().describe("Filter by page path"),
|
|
1710
|
+
category: z30.enum([
|
|
1711
|
+
"code_error",
|
|
1712
|
+
"dead_click",
|
|
1713
|
+
"rage_click",
|
|
1714
|
+
"ux_friction",
|
|
1715
|
+
"performance",
|
|
1716
|
+
"form_issue",
|
|
1717
|
+
"behavioral_anomaly",
|
|
1718
|
+
"structural_issue"
|
|
1719
|
+
]).optional().describe("Filter by issue category"),
|
|
1720
|
+
limit: z30.number().optional().default(20).describe("Maximum number of results (default: 20)")
|
|
1840
1721
|
}),
|
|
1841
1722
|
handler: async (args) => {
|
|
1842
|
-
const { status,
|
|
1723
|
+
const { status, page_path, category, limit } = args;
|
|
1843
1724
|
if (!isApiConfigured()) {
|
|
1844
1725
|
return apiNotConfiguredResult();
|
|
1845
1726
|
}
|
|
1846
1727
|
const { data, error } = await apiGet("/remediations", {
|
|
1847
1728
|
status,
|
|
1848
|
-
issue_id,
|
|
1849
1729
|
page_path,
|
|
1730
|
+
category,
|
|
1850
1731
|
limit: limit ?? 20
|
|
1851
1732
|
});
|
|
1852
1733
|
if (error) {
|
|
@@ -1858,8 +1739,8 @@ var listRemediationsTool = {
|
|
|
1858
1739
|
var confirmDeploymentTool = {
|
|
1859
1740
|
name: "confirm_deployment",
|
|
1860
1741
|
description: "Confirm that a proposed fix has been deployed to production. This starts the evaluation timer. Call this when the user confirms they have deployed the fix.",
|
|
1861
|
-
inputSchema:
|
|
1862
|
-
remediation_id:
|
|
1742
|
+
inputSchema: z30.object({
|
|
1743
|
+
remediation_id: z30.string().describe("The ID of the remediation to mark as deployed")
|
|
1863
1744
|
}),
|
|
1864
1745
|
handler: async (args) => {
|
|
1865
1746
|
const { remediation_id } = args;
|
|
@@ -1876,9 +1757,9 @@ var confirmDeploymentTool = {
|
|
|
1876
1757
|
var evaluateFixTool = {
|
|
1877
1758
|
name: "evaluate_fix",
|
|
1878
1759
|
description: "Evaluate if a deployed fix improved metrics. Compares post-deployment metrics to baseline. Returns success/partial/failed outcome with detailed verdict. Wait at least 24 hours after deployment for reliable results.",
|
|
1879
|
-
inputSchema:
|
|
1880
|
-
remediation_id:
|
|
1881
|
-
min_hours:
|
|
1760
|
+
inputSchema: z30.object({
|
|
1761
|
+
remediation_id: z30.string().describe("The ID of the remediation to evaluate"),
|
|
1762
|
+
min_hours: z30.number().optional().default(24).describe("Minimum hours since deployment required (default: 24)")
|
|
1882
1763
|
}),
|
|
1883
1764
|
handler: async (args) => {
|
|
1884
1765
|
const { remediation_id, min_hours } = args;
|
|
@@ -1892,34 +1773,16 @@ var evaluateFixTool = {
|
|
|
1892
1773
|
return successResult(data);
|
|
1893
1774
|
}
|
|
1894
1775
|
};
|
|
1895
|
-
var getFixHistoryTool = {
|
|
1896
|
-
name: "get_fix_history",
|
|
1897
|
-
description: "Get the full remediation history for an issue. Shows all fix attempts, their outcomes, and current status. Use before proposing a new fix to learn from past attempts.",
|
|
1898
|
-
inputSchema: z32.object({
|
|
1899
|
-
issue_id: z32.string().describe("The ID of the issue to get fix history for")
|
|
1900
|
-
}),
|
|
1901
|
-
handler: async (args) => {
|
|
1902
|
-
const { issue_id } = args;
|
|
1903
|
-
if (!isApiConfigured()) {
|
|
1904
|
-
return apiNotConfiguredResult();
|
|
1905
|
-
}
|
|
1906
|
-
const { data, error } = await apiGet(`/remediations/history/${issue_id}`);
|
|
1907
|
-
if (error) {
|
|
1908
|
-
return errorResult(error);
|
|
1909
|
-
}
|
|
1910
|
-
return successResult(data);
|
|
1911
|
-
}
|
|
1912
|
-
};
|
|
1913
1776
|
var updateRemediationStatusTool = {
|
|
1914
1777
|
name: "update_remediation_status",
|
|
1915
1778
|
description: "Update remediation status based on PR events. REQUIRED: remediation_id, status. Status values: 'waiting' (PR created), 'deployed' (PR merged), 'dismissed' (PR closed without merge).",
|
|
1916
|
-
inputSchema:
|
|
1917
|
-
remediation_id:
|
|
1918
|
-
status:
|
|
1919
|
-
pr_url:
|
|
1920
|
-
pr_number:
|
|
1921
|
-
pr_merged_at:
|
|
1922
|
-
pr_closed_at:
|
|
1779
|
+
inputSchema: z30.object({
|
|
1780
|
+
remediation_id: z30.string().describe("REQUIRED. The ID of the remediation to update"),
|
|
1781
|
+
status: z30.enum(["waiting", "deployed", "dismissed"]).describe("REQUIRED. One of: waiting, deployed, dismissed"),
|
|
1782
|
+
pr_url: z30.string().optional().describe("URL of the pull request"),
|
|
1783
|
+
pr_number: z30.number().optional().describe("PR number"),
|
|
1784
|
+
pr_merged_at: z30.string().optional().describe("ISO timestamp when PR was merged"),
|
|
1785
|
+
pr_closed_at: z30.string().optional().describe("ISO timestamp when PR was closed")
|
|
1923
1786
|
}),
|
|
1924
1787
|
handler: async (args) => {
|
|
1925
1788
|
const { remediation_id, status, pr_url, pr_number, pr_merged_at, pr_closed_at } = args;
|
|
@@ -1942,8 +1805,8 @@ var updateRemediationStatusTool = {
|
|
|
1942
1805
|
var listRemediationsByStatusTool = {
|
|
1943
1806
|
name: "list_remediations_by_status",
|
|
1944
1807
|
description: "List remediations filtered by one or more statuses. Use to find all 'waiting' PRs or 'deployed' fixes ready for evaluation. Set include_execution to get difficulty classification for model selection.",
|
|
1945
|
-
inputSchema:
|
|
1946
|
-
statuses:
|
|
1808
|
+
inputSchema: z30.object({
|
|
1809
|
+
statuses: z30.array(z30.enum([
|
|
1947
1810
|
"proposed",
|
|
1948
1811
|
"waiting",
|
|
1949
1812
|
"dismissed",
|
|
@@ -1954,7 +1817,7 @@ var listRemediationsByStatusTool = {
|
|
|
1954
1817
|
"reverted",
|
|
1955
1818
|
"deferred"
|
|
1956
1819
|
])).describe("List of statuses to filter by"),
|
|
1957
|
-
include_execution:
|
|
1820
|
+
include_execution: z30.boolean().optional().describe("Include execution metadata (difficulty class, model used) for each remediation")
|
|
1958
1821
|
}),
|
|
1959
1822
|
handler: async (args) => {
|
|
1960
1823
|
const { statuses, include_execution } = args;
|
|
@@ -1974,8 +1837,8 @@ var listRemediationsByStatusTool = {
|
|
|
1974
1837
|
var getRemediationByPrTool = {
|
|
1975
1838
|
name: "get_remediation_by_pr",
|
|
1976
1839
|
description: "Get a remediation by its PR number. Use to look up fix details when processing PR events.",
|
|
1977
|
-
inputSchema:
|
|
1978
|
-
pr_number:
|
|
1840
|
+
inputSchema: z30.object({
|
|
1841
|
+
pr_number: z30.number().describe("The PR number to look up")
|
|
1979
1842
|
}),
|
|
1980
1843
|
handler: async (args) => {
|
|
1981
1844
|
const { pr_number } = args;
|
|
@@ -1989,43 +1852,15 @@ var getRemediationByPrTool = {
|
|
|
1989
1852
|
return successResult(data);
|
|
1990
1853
|
}
|
|
1991
1854
|
};
|
|
1992
|
-
var deferIssueTool = {
|
|
1993
|
-
name: "defer_issue",
|
|
1994
|
-
description: "Defer an issue that needs more data. REQUIRED: issue_id, diagnosis, deferral_reason, confidence. Creates a remediation record with 'deferred' status. Returns remediation_id for tracking.",
|
|
1995
|
-
inputSchema: z32.object({
|
|
1996
|
-
issue_id: z32.string().describe("REQUIRED. The ID of the issue to defer"),
|
|
1997
|
-
diagnosis: z32.string().describe("REQUIRED. Analysis of what you think the problem might be"),
|
|
1998
|
-
deferral_reason: z32.string().describe("REQUIRED. Explanation of why the issue cannot be fixed yet"),
|
|
1999
|
-
confidence: z32.number().min(0).max(1).describe("REQUIRED. Confidence level in the diagnosis (0-1). Typically low for deferred issues."),
|
|
2000
|
-
affected_files: z32.array(z32.string()).optional().describe("List of files that might need to be modified")
|
|
2001
|
-
}),
|
|
2002
|
-
handler: async (args) => {
|
|
2003
|
-
const { issue_id, diagnosis, deferral_reason, confidence, affected_files } = args;
|
|
2004
|
-
if (!isApiConfigured()) {
|
|
2005
|
-
return apiNotConfiguredResult();
|
|
2006
|
-
}
|
|
2007
|
-
const { data, error } = await apiPost("/remediations/defer", {
|
|
2008
|
-
issue_id,
|
|
2009
|
-
diagnosis,
|
|
2010
|
-
deferral_reason,
|
|
2011
|
-
confidence,
|
|
2012
|
-
affected_files
|
|
2013
|
-
});
|
|
2014
|
-
if (error) {
|
|
2015
|
-
return errorResult(error);
|
|
2016
|
-
}
|
|
2017
|
-
return successResult(data);
|
|
2018
|
-
}
|
|
2019
|
-
};
|
|
2020
1855
|
|
|
2021
1856
|
// ../../libraries/mcp-tools/dist/tools/scanSite.js
|
|
2022
|
-
import { z as
|
|
1857
|
+
import { z as z31 } from "zod";
|
|
2023
1858
|
var scanSiteTool = {
|
|
2024
1859
|
name: "scan_site",
|
|
2025
1860
|
description: "One-shot site health scan. Lists all pages and computes aggregate metrics for the top-N pages (default 10) sorted by session count. Returns a ranked table with frustration and health grade per page. Use this as the FIRST tool when the user asks a broad question without naming a specific page.",
|
|
2026
|
-
inputSchema:
|
|
2027
|
-
top_n:
|
|
2028
|
-
offset:
|
|
1861
|
+
inputSchema: z31.object({
|
|
1862
|
+
top_n: z31.number().optional().default(10).describe("Number of top pages to analyze (default 10)"),
|
|
1863
|
+
offset: z31.number().optional().default(0).describe("Skip first N pages for pagination (default 0)")
|
|
2029
1864
|
}),
|
|
2030
1865
|
handler: async (args) => {
|
|
2031
1866
|
const { top_n, offset } = args;
|
|
@@ -2044,14 +1879,14 @@ var scanSiteTool = {
|
|
|
2044
1879
|
};
|
|
2045
1880
|
|
|
2046
1881
|
// ../../libraries/mcp-tools/dist/tools/searchSessions.js
|
|
2047
|
-
import { z as
|
|
1882
|
+
import { z as z32 } from "zod";
|
|
2048
1883
|
var searchSessionsTool = {
|
|
2049
1884
|
name: "search_sessions",
|
|
2050
1885
|
description: 'Search sessions by natural language query. Examples: "frustrated users on checkout", "rage clicks on pricing page", "confused users who abandoned cart".',
|
|
2051
|
-
inputSchema:
|
|
2052
|
-
query:
|
|
2053
|
-
page_path:
|
|
2054
|
-
limit:
|
|
1886
|
+
inputSchema: z32.object({
|
|
1887
|
+
query: z32.string().describe("Natural language search query describing the sessions you want to find"),
|
|
1888
|
+
page_path: z32.string().optional().describe("Optional: filter to a specific page path"),
|
|
1889
|
+
limit: z32.number().optional().default(10).describe("Maximum number of sessions to return (default: 10)")
|
|
2055
1890
|
}),
|
|
2056
1891
|
handler: async (args) => {
|
|
2057
1892
|
const { query, page_path, limit } = args;
|
|
@@ -2070,81 +1905,8 @@ var searchSessionsTool = {
|
|
|
2070
1905
|
}
|
|
2071
1906
|
};
|
|
2072
1907
|
|
|
2073
|
-
// ../../libraries/mcp-tools/dist/tools/triage.js
|
|
2074
|
-
import { z as z35 } from "zod";
|
|
2075
|
-
var DISMISS_REASONS = [
|
|
2076
|
-
"stale",
|
|
2077
|
-
"intended",
|
|
2078
|
-
"duplicate",
|
|
2079
|
-
"false_positive"
|
|
2080
|
-
];
|
|
2081
|
-
var dismissIssueTool = {
|
|
2082
|
-
name: "dismiss_issue",
|
|
2083
|
-
description: "Dismiss an issue as a false positive. REQUIRED: issue_id, reason (enum), explanation. Creates site knowledge to prevent re-flagging. Confirm with user before dismissing in interactive mode.",
|
|
2084
|
-
inputSchema: z35.object({
|
|
2085
|
-
issue_id: z35.string().describe("REQUIRED. The ID of the issue to dismiss"),
|
|
2086
|
-
reason: z35.enum(DISMISS_REASONS).describe("REQUIRED. One of: stale, intended, duplicate, false_positive"),
|
|
2087
|
-
explanation: z35.string().describe("REQUIRED. Detailed explanation of why this issue is being dismissed"),
|
|
2088
|
-
create_knowledge: z35.boolean().optional().default(true).describe("Whether to create site knowledge entry (default: true)")
|
|
2089
|
-
}),
|
|
2090
|
-
handler: async (args) => {
|
|
2091
|
-
const { issue_id, reason, explanation, create_knowledge } = args;
|
|
2092
|
-
if (!isApiConfigured()) {
|
|
2093
|
-
return apiNotConfiguredResult();
|
|
2094
|
-
}
|
|
2095
|
-
const { data, error } = await apiPost(`/issues/${issue_id}/dismiss`, {
|
|
2096
|
-
reason,
|
|
2097
|
-
explanation,
|
|
2098
|
-
create_knowledge: create_knowledge ?? true
|
|
2099
|
-
});
|
|
2100
|
-
if (error) {
|
|
2101
|
-
return errorResult(error);
|
|
2102
|
-
}
|
|
2103
|
-
return successResult(data);
|
|
2104
|
-
}
|
|
2105
|
-
};
|
|
2106
|
-
var markIntendedBehaviorTool = {
|
|
2107
|
-
name: "mark_intended_behavior",
|
|
2108
|
-
description: "Mark an issue as intended behavior. This is a shortcut for dismissing with reason 'intended' and always creates site knowledge. Use when the detected behavior is by design (e.g., disabled button clicks are expected).",
|
|
2109
|
-
inputSchema: z35.object({
|
|
2110
|
-
issue_id: z35.string().describe("The ID of the issue to mark as intended"),
|
|
2111
|
-
explanation: z35.string().describe("Explanation of why this behavior is intended")
|
|
2112
|
-
}),
|
|
2113
|
-
handler: async (args) => {
|
|
2114
|
-
const { issue_id, explanation } = args;
|
|
2115
|
-
if (!isApiConfigured()) {
|
|
2116
|
-
return apiNotConfiguredResult();
|
|
2117
|
-
}
|
|
2118
|
-
const { data, error } = await apiPost(`/issues/${issue_id}/mark-intended`, {
|
|
2119
|
-
explanation
|
|
2120
|
-
});
|
|
2121
|
-
if (error) {
|
|
2122
|
-
return errorResult(error);
|
|
2123
|
-
}
|
|
2124
|
-
return successResult(data);
|
|
2125
|
-
}
|
|
2126
|
-
};
|
|
2127
|
-
var getIssueHistoryTool = {
|
|
2128
|
-
name: "get_issue_history",
|
|
2129
|
-
description: "Get the full history of an issue including status changes, remediation attempts, and outcomes. Use to understand past fix attempts before proposing new ones.",
|
|
2130
|
-
inputSchema: z35.object({
|
|
2131
|
-
issue_id: z35.string().describe("The ID of the issue to get history for")
|
|
2132
|
-
}),
|
|
2133
|
-
handler: async (args) => {
|
|
2134
|
-
const { issue_id } = args;
|
|
2135
|
-
if (!isApiConfigured()) {
|
|
2136
|
-
return apiNotConfiguredResult();
|
|
2137
|
-
}
|
|
2138
|
-
const { data, error } = await apiGet(`/issues/${issue_id}/history`);
|
|
2139
|
-
if (error) {
|
|
2140
|
-
return errorResult(error);
|
|
2141
|
-
}
|
|
2142
|
-
return successResult(data);
|
|
2143
|
-
}
|
|
2144
|
-
};
|
|
2145
|
-
|
|
2146
1908
|
// ../../libraries/mcp-tools/dist/tools/triageSessions.js
|
|
2147
|
-
import { z as
|
|
1909
|
+
import { z as z33 } from "zod";
|
|
2148
1910
|
function formatDuration(seconds) {
|
|
2149
1911
|
if (!seconds)
|
|
2150
1912
|
return "unknown";
|
|
@@ -2267,12 +2029,12 @@ function formatTriageOutput(data) {
|
|
|
2267
2029
|
var triageSessionsTool = {
|
|
2268
2030
|
name: "triage_sessions",
|
|
2269
2031
|
description: "Automatically triage sessions to find compromised user experiences. Analyzes user comments, frustration signals, rage clicks, and console errors. Returns flagged sessions with evidence and replay links. Use this to identify sessions that need attention without manually reviewing every recording. Can triage specific sessions by ID(s) or scan for problematic sessions. NOTE: Session replay URLs require a paid plan (Starter+). Free tier users can see session summaries and triage scores but not watch replays.",
|
|
2270
|
-
inputSchema:
|
|
2271
|
-
session_ids:
|
|
2272
|
-
days:
|
|
2273
|
-
page_path:
|
|
2274
|
-
min_severity:
|
|
2275
|
-
limit:
|
|
2032
|
+
inputSchema: z33.object({
|
|
2033
|
+
session_ids: z33.array(z33.string()).optional().describe("Triage specific sessions by ID. If provided, other filters are ignored."),
|
|
2034
|
+
days: z33.number().optional().default(7).describe("Lookback period in days (default: 7). Ignored if session_ids is provided."),
|
|
2035
|
+
page_path: z33.string().optional().describe("Filter to sessions that visited a specific page"),
|
|
2036
|
+
min_severity: z33.enum(["critical", "high", "medium", "low"]).optional().describe("Minimum severity to include in results"),
|
|
2037
|
+
limit: z33.number().optional().default(20).describe("Maximum sessions to return (default: 20, max: 100)")
|
|
2276
2038
|
}),
|
|
2277
2039
|
handler: async (args) => {
|
|
2278
2040
|
const { session_ids, days, page_path, min_severity, limit } = args;
|
|
@@ -2295,7 +2057,7 @@ var triageSessionsTool = {
|
|
|
2295
2057
|
};
|
|
2296
2058
|
|
|
2297
2059
|
// ../../libraries/mcp-tools/dist/tools/proposal.js
|
|
2298
|
-
import { z as
|
|
2060
|
+
import { z as z34 } from "zod";
|
|
2299
2061
|
var ISSUE_CATEGORIES2 = [
|
|
2300
2062
|
"code_error",
|
|
2301
2063
|
"dead_click",
|
|
@@ -2318,27 +2080,27 @@ var PROPOSAL_STATUSES = [
|
|
|
2318
2080
|
var createProposalTool = {
|
|
2319
2081
|
name: "create_proposal",
|
|
2320
2082
|
description: "AUDIT MODE ONLY. Create a fix proposal. REQUIRED: title, diagnosis, proposed_fix, confidence, page_path, category, severity. Proposals are suggestions that developers review and implement manually. Do NOT use in fix mode - use propose_fix instead.",
|
|
2321
|
-
inputSchema:
|
|
2322
|
-
issue_id:
|
|
2323
|
-
improvement_run_id:
|
|
2324
|
-
title:
|
|
2325
|
-
diagnosis:
|
|
2326
|
-
proposed_fix:
|
|
2327
|
-
affected_files:
|
|
2328
|
-
confidence:
|
|
2329
|
-
page_path:
|
|
2330
|
-
element_selector:
|
|
2331
|
-
category:
|
|
2332
|
-
severity:
|
|
2333
|
-
execution_metadata:
|
|
2334
|
-
difficulty_class:
|
|
2335
|
-
difficulty_reasoning:
|
|
2336
|
-
model_used:
|
|
2337
|
-
was_escalated:
|
|
2338
|
-
escalation_reason:
|
|
2339
|
-
iterations:
|
|
2340
|
-
credits_used:
|
|
2341
|
-
duration_ms:
|
|
2083
|
+
inputSchema: z34.object({
|
|
2084
|
+
issue_id: z34.string().optional().describe("The ID of the related issue (if any)"),
|
|
2085
|
+
improvement_run_id: z34.string().optional().describe("The ID of the improvement run creating this proposal"),
|
|
2086
|
+
title: z34.string().describe("REQUIRED. Short user-friendly title describing the issue from the user's perspective"),
|
|
2087
|
+
diagnosis: z34.string().describe("REQUIRED. Detailed analysis of the root cause of the issue"),
|
|
2088
|
+
proposed_fix: z34.string().describe("REQUIRED. Description of the proposed fix and how it addresses the root cause"),
|
|
2089
|
+
affected_files: z34.array(z34.string()).optional().describe("List of files that likely need to be modified"),
|
|
2090
|
+
confidence: z34.number().min(0).max(1).describe("REQUIRED. Confidence level in the fix (0-1). Use <0.7 when uncertain."),
|
|
2091
|
+
page_path: z34.string().describe("REQUIRED. The page path where the issue occurs"),
|
|
2092
|
+
element_selector: z34.string().optional().describe("CSS selector of the affected element (if applicable)"),
|
|
2093
|
+
category: z34.enum(ISSUE_CATEGORIES2).describe("REQUIRED. Category: code_error, dead_click, rage_click, ux_friction, performance, form_issue, behavioral_anomaly, structural_issue"),
|
|
2094
|
+
severity: z34.enum(ISSUE_SEVERITIES).describe("REQUIRED. Severity: critical, high, medium, low, info"),
|
|
2095
|
+
execution_metadata: z34.object({
|
|
2096
|
+
difficulty_class: z34.enum(["trivial", "light", "heavy"]),
|
|
2097
|
+
difficulty_reasoning: z34.string(),
|
|
2098
|
+
model_used: z34.string(),
|
|
2099
|
+
was_escalated: z34.boolean().optional(),
|
|
2100
|
+
escalation_reason: z34.string().optional(),
|
|
2101
|
+
iterations: z34.number().optional(),
|
|
2102
|
+
credits_used: z34.number().optional(),
|
|
2103
|
+
duration_ms: z34.number().optional()
|
|
2342
2104
|
}).optional().describe("AI execution metadata for tracking model selection and performance")
|
|
2343
2105
|
}),
|
|
2344
2106
|
handler: async (args) => {
|
|
@@ -2369,14 +2131,14 @@ var createProposalTool = {
|
|
|
2369
2131
|
var listProposalsTool = {
|
|
2370
2132
|
name: "list_proposals",
|
|
2371
2133
|
description: "List proposals with optional filters. Use to review pending proposals, check resolved proposals, or filter by page/category/severity.",
|
|
2372
|
-
inputSchema:
|
|
2373
|
-
status:
|
|
2374
|
-
statuses:
|
|
2375
|
-
issue_id:
|
|
2376
|
-
page_path:
|
|
2377
|
-
category:
|
|
2378
|
-
severity:
|
|
2379
|
-
limit:
|
|
2134
|
+
inputSchema: z34.object({
|
|
2135
|
+
status: z34.enum(PROPOSAL_STATUSES).optional().describe("Filter by single status"),
|
|
2136
|
+
statuses: z34.array(z34.enum(PROPOSAL_STATUSES)).optional().describe("Filter by multiple statuses"),
|
|
2137
|
+
issue_id: z34.string().optional().describe("Filter by related issue ID"),
|
|
2138
|
+
page_path: z34.string().optional().describe("Filter by page path"),
|
|
2139
|
+
category: z34.enum(ISSUE_CATEGORIES2).optional().describe("Filter by category"),
|
|
2140
|
+
severity: z34.enum(ISSUE_SEVERITIES).optional().describe("Filter by severity"),
|
|
2141
|
+
limit: z34.number().optional().default(20).describe("Maximum number of results (default: 20)")
|
|
2380
2142
|
}),
|
|
2381
2143
|
handler: async (args) => {
|
|
2382
2144
|
const { status, statuses, issue_id, page_path, category, severity, limit } = args;
|
|
@@ -2408,8 +2170,8 @@ var listProposalsTool = {
|
|
|
2408
2170
|
var getProposalTool = {
|
|
2409
2171
|
name: "get_proposal",
|
|
2410
2172
|
description: "Get details of a specific proposal by ID. Use to review the full diagnosis and proposed fix before implementing.",
|
|
2411
|
-
inputSchema:
|
|
2412
|
-
proposal_id:
|
|
2173
|
+
inputSchema: z34.object({
|
|
2174
|
+
proposal_id: z34.string().describe("The ID of the proposal to retrieve")
|
|
2413
2175
|
}),
|
|
2414
2176
|
handler: async (args) => {
|
|
2415
2177
|
const { proposal_id } = args;
|
|
@@ -2426,9 +2188,9 @@ var getProposalTool = {
|
|
|
2426
2188
|
var resolveProposalTool = {
|
|
2427
2189
|
name: "resolve_proposal",
|
|
2428
2190
|
description: "Mark a proposal as resolved after implementing the fix. This captures baseline metrics for later evaluation. Call this after you have implemented the proposed fix in code.",
|
|
2429
|
-
inputSchema:
|
|
2430
|
-
proposal_id:
|
|
2431
|
-
member_id:
|
|
2191
|
+
inputSchema: z34.object({
|
|
2192
|
+
proposal_id: z34.string().describe("The ID of the proposal to mark as resolved"),
|
|
2193
|
+
member_id: z34.string().optional().describe("The ID of the member who resolved it (optional)")
|
|
2432
2194
|
}),
|
|
2433
2195
|
handler: async (args) => {
|
|
2434
2196
|
const { proposal_id, member_id } = args;
|
|
@@ -2445,10 +2207,10 @@ var resolveProposalTool = {
|
|
|
2445
2207
|
var dismissProposalTool = {
|
|
2446
2208
|
name: "dismiss_proposal",
|
|
2447
2209
|
description: "Dismiss a proposal that won't be implemented. REQUIRED: proposal_id, reason. Use when the proposal is not applicable, the issue is intended behavior, or a different approach is preferred.",
|
|
2448
|
-
inputSchema:
|
|
2449
|
-
proposal_id:
|
|
2450
|
-
reason:
|
|
2451
|
-
member_id:
|
|
2210
|
+
inputSchema: z34.object({
|
|
2211
|
+
proposal_id: z34.string().describe("REQUIRED. The ID of the proposal to dismiss"),
|
|
2212
|
+
reason: z34.string().describe("REQUIRED. Explanation of why the proposal is being dismissed"),
|
|
2213
|
+
member_id: z34.string().optional().describe("The ID of the member who dismissed it")
|
|
2452
2214
|
}),
|
|
2453
2215
|
handler: async (args) => {
|
|
2454
2216
|
const { proposal_id, reason, member_id } = args;
|
|
@@ -2465,9 +2227,9 @@ var dismissProposalTool = {
|
|
|
2465
2227
|
var evaluateProposalTool = {
|
|
2466
2228
|
name: "evaluate_proposal",
|
|
2467
2229
|
description: "Evaluate if a resolved proposal improved metrics. Compares post-resolution metrics to baseline. Returns success/partial/failed outcome with detailed verdict. Wait at least 24 hours after resolution for reliable results.",
|
|
2468
|
-
inputSchema:
|
|
2469
|
-
proposal_id:
|
|
2470
|
-
min_hours:
|
|
2230
|
+
inputSchema: z34.object({
|
|
2231
|
+
proposal_id: z34.string().describe("The ID of the proposal to evaluate"),
|
|
2232
|
+
min_hours: z34.number().optional().default(24).describe("Minimum hours since resolution required (default: 24)")
|
|
2471
2233
|
}),
|
|
2472
2234
|
handler: async (args) => {
|
|
2473
2235
|
const { proposal_id, min_hours } = args;
|
|
@@ -2485,7 +2247,7 @@ var evaluateProposalTool = {
|
|
|
2485
2247
|
var listPendingProposalsTool = {
|
|
2486
2248
|
name: "list_pending_proposals",
|
|
2487
2249
|
description: "List all pending proposals awaiting review. Use to see what fix suggestions are available for implementation.",
|
|
2488
|
-
inputSchema:
|
|
2250
|
+
inputSchema: z34.object({}),
|
|
2489
2251
|
handler: async () => {
|
|
2490
2252
|
if (!isApiConfigured()) {
|
|
2491
2253
|
return apiNotConfiguredResult();
|
|
@@ -2500,8 +2262,8 @@ var listPendingProposalsTool = {
|
|
|
2500
2262
|
var listProposalsForEvaluationTool = {
|
|
2501
2263
|
name: "list_proposals_for_evaluation",
|
|
2502
2264
|
description: "List resolved proposals that are ready for evaluation (24+ hours since resolution). Use during audit runs to check outcomes of previously resolved proposals.",
|
|
2503
|
-
inputSchema:
|
|
2504
|
-
min_hours:
|
|
2265
|
+
inputSchema: z34.object({
|
|
2266
|
+
min_hours: z34.number().optional().default(24).describe("Minimum hours since resolution (default: 24)")
|
|
2505
2267
|
}),
|
|
2506
2268
|
handler: async (args) => {
|
|
2507
2269
|
const { min_hours } = args;
|
|
@@ -2517,7 +2279,7 @@ var listProposalsForEvaluationTool = {
|
|
|
2517
2279
|
};
|
|
2518
2280
|
|
|
2519
2281
|
// ../../libraries/mcp-tools/dist/tools/git.js
|
|
2520
|
-
import { z as
|
|
2282
|
+
import { z as z35 } from "zod";
|
|
2521
2283
|
var gitContext = null;
|
|
2522
2284
|
function getGitContext() {
|
|
2523
2285
|
if (!gitContext) {
|
|
@@ -2556,9 +2318,9 @@ async function gitlabRequest(endpoint, options = {}) {
|
|
|
2556
2318
|
var createBranchTool = {
|
|
2557
2319
|
name: "create_branch",
|
|
2558
2320
|
description: "Create a new branch from the default branch. Works with both GitHub and GitLab.",
|
|
2559
|
-
inputSchema:
|
|
2560
|
-
branch_name:
|
|
2561
|
-
from_branch:
|
|
2321
|
+
inputSchema: z35.object({
|
|
2322
|
+
branch_name: z35.string().describe("Name of the new branch to create"),
|
|
2323
|
+
from_branch: z35.string().optional().default("main").describe("Base branch to create from (default: main)")
|
|
2562
2324
|
}),
|
|
2563
2325
|
handler: async (args) => {
|
|
2564
2326
|
try {
|
|
@@ -2617,9 +2379,9 @@ var createBranchTool = {
|
|
|
2617
2379
|
var getFileContentTool = {
|
|
2618
2380
|
name: "get_file_content",
|
|
2619
2381
|
description: "Get the content of a file from the repository. Works with both GitHub and GitLab.",
|
|
2620
|
-
inputSchema:
|
|
2621
|
-
path:
|
|
2622
|
-
branch:
|
|
2382
|
+
inputSchema: z35.object({
|
|
2383
|
+
path: z35.string().describe("Path to the file in the repository"),
|
|
2384
|
+
branch: z35.string().optional().describe("Branch to read from (default: main)")
|
|
2623
2385
|
}),
|
|
2624
2386
|
handler: async (args) => {
|
|
2625
2387
|
try {
|
|
@@ -2669,12 +2431,12 @@ var getFileContentTool = {
|
|
|
2669
2431
|
var updateFileTool = {
|
|
2670
2432
|
name: "update_file",
|
|
2671
2433
|
description: "Update or create a file in the repository. Works with both GitHub and GitLab. SHA is auto-fetched for existing files.",
|
|
2672
|
-
inputSchema:
|
|
2673
|
-
path:
|
|
2674
|
-
content:
|
|
2675
|
-
message:
|
|
2676
|
-
branch:
|
|
2677
|
-
sha:
|
|
2434
|
+
inputSchema: z35.object({
|
|
2435
|
+
path: z35.string().describe("Path to the file in the repository"),
|
|
2436
|
+
content: z35.string().describe("New content for the file"),
|
|
2437
|
+
message: z35.string().describe("Commit message"),
|
|
2438
|
+
branch: z35.string().describe("Branch to commit to"),
|
|
2439
|
+
sha: z35.string().optional().describe("SHA of the file being replaced (auto-fetched if not provided)")
|
|
2678
2440
|
}),
|
|
2679
2441
|
handler: async (args) => {
|
|
2680
2442
|
try {
|
|
@@ -2757,11 +2519,11 @@ var updateFileTool = {
|
|
|
2757
2519
|
var createMergeRequestTool = {
|
|
2758
2520
|
name: "create_merge_request",
|
|
2759
2521
|
description: "Create a merge request (GitHub: Pull Request, GitLab: Merge Request). Works with both providers.",
|
|
2760
|
-
inputSchema:
|
|
2761
|
-
title:
|
|
2762
|
-
description:
|
|
2763
|
-
source_branch:
|
|
2764
|
-
target_branch:
|
|
2522
|
+
inputSchema: z35.object({
|
|
2523
|
+
title: z35.string().describe("Title of the merge request"),
|
|
2524
|
+
description: z35.string().describe("Description/body of the merge request"),
|
|
2525
|
+
source_branch: z35.string().describe("Branch containing the changes"),
|
|
2526
|
+
target_branch: z35.string().optional().default("main").describe("Branch to merge into (default: main)")
|
|
2765
2527
|
}),
|
|
2766
2528
|
handler: async (args) => {
|
|
2767
2529
|
try {
|
|
@@ -2826,8 +2588,8 @@ var createMergeRequestTool = {
|
|
|
2826
2588
|
var checkMrStatusTool = {
|
|
2827
2589
|
name: "check_mr_status",
|
|
2828
2590
|
description: "Check the status of a merge request. Works with both GitHub and GitLab.",
|
|
2829
|
-
inputSchema:
|
|
2830
|
-
mr_number:
|
|
2591
|
+
inputSchema: z35.object({
|
|
2592
|
+
mr_number: z35.number().describe("The merge request number")
|
|
2831
2593
|
}),
|
|
2832
2594
|
handler: async (args) => {
|
|
2833
2595
|
try {
|
|
@@ -2901,8 +2663,8 @@ var checkMrStatusTool = {
|
|
|
2901
2663
|
var listOpenMrsTool = {
|
|
2902
2664
|
name: "list_open_mrs",
|
|
2903
2665
|
description: "List open merge requests for the repository. Works with both GitHub and GitLab.",
|
|
2904
|
-
inputSchema:
|
|
2905
|
-
limit:
|
|
2666
|
+
inputSchema: z35.object({
|
|
2667
|
+
limit: z35.number().optional().default(10).describe("Maximum number of MRs to return (default: 10)")
|
|
2906
2668
|
}),
|
|
2907
2669
|
handler: async (args) => {
|
|
2908
2670
|
try {
|
|
@@ -2956,10 +2718,10 @@ var listOpenMrsTool = {
|
|
|
2956
2718
|
var listRepositoryFilesTool = {
|
|
2957
2719
|
name: "list_repository_files",
|
|
2958
2720
|
description: "List files and directories in the repository. Use this to discover the file structure before reading or modifying files. Works with both GitHub and GitLab.",
|
|
2959
|
-
inputSchema:
|
|
2960
|
-
path:
|
|
2961
|
-
branch:
|
|
2962
|
-
recursive:
|
|
2721
|
+
inputSchema: z35.object({
|
|
2722
|
+
path: z35.string().optional().default("").describe("Directory path to list (empty for root)"),
|
|
2723
|
+
branch: z35.string().optional().describe("Branch to list from (default: main)"),
|
|
2724
|
+
recursive: z35.boolean().optional().default(false).describe("If true, list all files recursively (may be slow for large repos)")
|
|
2963
2725
|
}),
|
|
2964
2726
|
handler: async (args) => {
|
|
2965
2727
|
try {
|
|
@@ -3073,12 +2835,9 @@ var allTools = [
|
|
|
3073
2835
|
detectRegressionsTool,
|
|
3074
2836
|
// Diagnostic
|
|
3075
2837
|
runFullDiagnosticTool,
|
|
3076
|
-
investigateIssueTool,
|
|
3077
|
-
validateIssueTool,
|
|
3078
2838
|
// Discovery
|
|
3079
2839
|
discoverPersonasTool,
|
|
3080
2840
|
// Get tools
|
|
3081
|
-
getActionableIssuesTool,
|
|
3082
2841
|
getAnomaliesTool,
|
|
3083
2842
|
getConsoleErrorsTool,
|
|
3084
2843
|
getCustomEventsTool,
|
|
@@ -3090,7 +2849,6 @@ var allTools = [
|
|
|
3090
2849
|
getElementFrictionTool,
|
|
3091
2850
|
getFlowFrictionTool,
|
|
3092
2851
|
getFormFrictionTool,
|
|
3093
|
-
getIssuesTool,
|
|
3094
2852
|
getJourneyPatternsTool,
|
|
3095
2853
|
getPageMetricsTool,
|
|
3096
2854
|
getPageTrendsTool,
|
|
@@ -3109,7 +2867,6 @@ var allTools = [
|
|
|
3109
2867
|
getSiteKnowledgeTool,
|
|
3110
2868
|
addSiteKnowledgeTool,
|
|
3111
2869
|
deleteSiteKnowledgeTool,
|
|
3112
|
-
getSimilarFixesTool,
|
|
3113
2870
|
// List
|
|
3114
2871
|
listPagesTool,
|
|
3115
2872
|
listSessionsTool,
|
|
@@ -3121,19 +2878,14 @@ var allTools = [
|
|
|
3121
2878
|
listRemediationsTool,
|
|
3122
2879
|
confirmDeploymentTool,
|
|
3123
2880
|
evaluateFixTool,
|
|
3124
|
-
getFixHistoryTool,
|
|
3125
2881
|
updateRemediationStatusTool,
|
|
3126
2882
|
listRemediationsByStatusTool,
|
|
3127
2883
|
getRemediationByPrTool,
|
|
3128
|
-
deferIssueTool,
|
|
3129
2884
|
// Scan
|
|
3130
2885
|
scanSiteTool,
|
|
3131
2886
|
// Search
|
|
3132
2887
|
searchSessionsTool,
|
|
3133
2888
|
// Triage
|
|
3134
|
-
dismissIssueTool,
|
|
3135
|
-
markIntendedBehaviorTool,
|
|
3136
|
-
getIssueHistoryTool,
|
|
3137
2889
|
triageSessionsTool,
|
|
3138
2890
|
// Proposal (audit mode)
|
|
3139
2891
|
createProposalTool,
|
|
@@ -3768,7 +3520,7 @@ function detectArrayPaths(data) {
|
|
|
3768
3520
|
}
|
|
3769
3521
|
|
|
3770
3522
|
// src/tools/catalog/searchTools.ts
|
|
3771
|
-
import { z as
|
|
3523
|
+
import { z as z36 } from "zod";
|
|
3772
3524
|
import { readFileSync } from "fs";
|
|
3773
3525
|
import { fileURLToPath } from "url";
|
|
3774
3526
|
import { dirname, join } from "path";
|
|
@@ -3800,11 +3552,11 @@ function getToolByName3(name) {
|
|
|
3800
3552
|
return loadCatalog2().find((t) => t.name === name);
|
|
3801
3553
|
}
|
|
3802
3554
|
var DEFAULT_TOOL_LIMIT = 5;
|
|
3803
|
-
var searchToolsSchema =
|
|
3804
|
-
query:
|
|
3555
|
+
var searchToolsSchema = z36.object({
|
|
3556
|
+
query: z36.string().describe(
|
|
3805
3557
|
"Natural language description of what data or analysis capability you need. Describe what you want to learn or investigate."
|
|
3806
3558
|
),
|
|
3807
|
-
limit:
|
|
3559
|
+
limit: z36.number().optional().describe("Maximum number of tools to return (default 5)")
|
|
3808
3560
|
});
|
|
3809
3561
|
function registerSearchTools(server) {
|
|
3810
3562
|
server.registerTool(
|
|
@@ -3856,10 +3608,10 @@ function registerSearchTools(server) {
|
|
|
3856
3608
|
}
|
|
3857
3609
|
|
|
3858
3610
|
// src/tools/catalog/callTool.ts
|
|
3859
|
-
import { z as
|
|
3611
|
+
import { z as z38 } from "zod";
|
|
3860
3612
|
|
|
3861
3613
|
// src/tools/memory.ts
|
|
3862
|
-
import { z as
|
|
3614
|
+
import { z as z37 } from "zod";
|
|
3863
3615
|
var memoryStore = null;
|
|
3864
3616
|
function getMemoryStore() {
|
|
3865
3617
|
if (!memoryStore) {
|
|
@@ -3876,10 +3628,10 @@ function registerMemoryTools(server) {
|
|
|
3876
3628
|
"memory_save",
|
|
3877
3629
|
{
|
|
3878
3630
|
description: "Save a value to working memory for later retrieval. Use this to store intermediate results from tool calls that you want to reference later.",
|
|
3879
|
-
inputSchema:
|
|
3880
|
-
key:
|
|
3881
|
-
value:
|
|
3882
|
-
annotation:
|
|
3631
|
+
inputSchema: z37.object({
|
|
3632
|
+
key: z37.string().describe("Unique key to store the value under"),
|
|
3633
|
+
value: z37.string().describe("Value to store (will be stored as string)"),
|
|
3634
|
+
annotation: z37.string().optional().describe("Optional note about what this data represents")
|
|
3883
3635
|
})
|
|
3884
3636
|
},
|
|
3885
3637
|
async ({
|
|
@@ -3894,14 +3646,14 @@ function registerMemoryTools(server) {
|
|
|
3894
3646
|
"memory_recall",
|
|
3895
3647
|
{
|
|
3896
3648
|
description: "Retrieve a value from working memory by key. Supports optional filtering and selection for querying stored data. Use this to access data you previously stored or that was auto-saved from tool responses.",
|
|
3897
|
-
inputSchema:
|
|
3898
|
-
key:
|
|
3899
|
-
where:
|
|
3649
|
+
inputSchema: z37.object({
|
|
3650
|
+
key: z37.string().describe("Key to retrieve"),
|
|
3651
|
+
where: z37.array(z37.string()).optional().describe(
|
|
3900
3652
|
'Filter conditions like ["frustration > 0.3", "status = active"]'
|
|
3901
3653
|
),
|
|
3902
|
-
select:
|
|
3903
|
-
limit:
|
|
3904
|
-
offset:
|
|
3654
|
+
select: z37.array(z37.string()).optional().describe("Fields to include in results"),
|
|
3655
|
+
limit: z37.number().optional().describe("Maximum number of items to return"),
|
|
3656
|
+
offset: z37.number().optional().describe("Number of items to skip")
|
|
3905
3657
|
})
|
|
3906
3658
|
},
|
|
3907
3659
|
async ({
|
|
@@ -3918,7 +3670,7 @@ function registerMemoryTools(server) {
|
|
|
3918
3670
|
"memory_list",
|
|
3919
3671
|
{
|
|
3920
3672
|
description: "List all keys currently stored in working memory. Returns key names, sizes, timestamps, annotations, and access counts.",
|
|
3921
|
-
inputSchema:
|
|
3673
|
+
inputSchema: z37.object({})
|
|
3922
3674
|
},
|
|
3923
3675
|
async () => {
|
|
3924
3676
|
return memory.list();
|
|
@@ -3928,8 +3680,8 @@ function registerMemoryTools(server) {
|
|
|
3928
3680
|
"memory_delete",
|
|
3929
3681
|
{
|
|
3930
3682
|
description: "Delete a value from working memory by key.",
|
|
3931
|
-
inputSchema:
|
|
3932
|
-
key:
|
|
3683
|
+
inputSchema: z37.object({
|
|
3684
|
+
key: z37.string().describe("Key to delete")
|
|
3933
3685
|
})
|
|
3934
3686
|
},
|
|
3935
3687
|
async ({ key }) => {
|
|
@@ -3940,7 +3692,7 @@ function registerMemoryTools(server) {
|
|
|
3940
3692
|
"memory_clear",
|
|
3941
3693
|
{
|
|
3942
3694
|
description: "Clear all values from working memory. Use with caution.",
|
|
3943
|
-
inputSchema:
|
|
3695
|
+
inputSchema: z37.object({})
|
|
3944
3696
|
},
|
|
3945
3697
|
async () => {
|
|
3946
3698
|
return memory.clear();
|
|
@@ -3953,11 +3705,11 @@ var toolRegistry = /* @__PURE__ */ new Map();
|
|
|
3953
3705
|
function registerToolHandler(name, handler) {
|
|
3954
3706
|
toolRegistry.set(name, handler);
|
|
3955
3707
|
}
|
|
3956
|
-
var callToolSchema =
|
|
3957
|
-
tool_name:
|
|
3708
|
+
var callToolSchema = z38.object({
|
|
3709
|
+
tool_name: z38.string().describe(
|
|
3958
3710
|
"The exact name of the tool to call (e.g., 'get_page_metrics', 'analyze_flow', 'compare_cohorts')"
|
|
3959
3711
|
),
|
|
3960
|
-
arguments:
|
|
3712
|
+
arguments: z38.record(z38.string(), z38.unknown()).describe(
|
|
3961
3713
|
"The arguments to pass to the tool as a JSON object. Check the tool description from search_tools for required parameters."
|
|
3962
3714
|
)
|
|
3963
3715
|
});
|