@sentientui/mcp 0.10.0 → 0.11.0

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 CHANGED
@@ -93,6 +93,7 @@ A sandboxed demo token is provisioned automatically — 10 calls/month, read-onl
93
93
  | `refresh_insights` | Trigger fresh AI insight generation |
94
94
  | `get_persona_breakdown` | Visitor cluster distribution with reliability scores |
95
95
  | `get_goal_funnel` | Goal hit counts and conversion rates per variant |
96
+ | `list_goals` | Defined goals (id, role, event, status) — includes goals with no conversions yet, so agents can wire a dashboard-defined goal into code |
96
97
  | `list_guardrail_events` | Variants auto-paused by the guardrail (last 24h) |
97
98
  | `get_layout_stats` | Per-persona section layout rankings and reward weights |
98
99
  | `get_integration_guide` | SentientUI adaptive-ladder setup guide (static — same for every project) |
@@ -787,6 +787,62 @@ function registerGoalTools(server, client) {
787
787
  return { content: [{ type: "text", text: lines.join("\n").trim() }], structuredContent, _meta: uiMeta("goal-funnel") };
788
788
  })
789
789
  );
790
+ server.registerTool(
791
+ "list_goals",
792
+ {
793
+ title: "List goal definitions",
794
+ description: `List the project's defined goals \u2014 including ones with no conversions yet, which get_goal_funnel cannot see. Returns each goal's stable id, display name, role (primary/secondary/guardrail), event type, and status. Reference a goalId verbatim from code: client.goal('<goalId>') or <Adaptive goal="<goalId>">.`,
795
+ inputSchema: { projectId: projectIdSchema },
796
+ outputSchema: {
797
+ goals: z6.array(
798
+ z6.object({
799
+ goalId: z6.string().describe("Stable id \u2014 use this exact string when firing the goal from code"),
800
+ displayName: z6.string(),
801
+ role: z6.string().describe("primary | secondary | guardrail"),
802
+ event: z6.string().describe("click | form_submit | url_reached"),
803
+ urlPattern: z6.string().nullable().describe("Only for url_reached goals"),
804
+ status: z6.string().describe("active | archived")
805
+ })
806
+ ).describe("Defined goals (empty if none)")
807
+ },
808
+ annotations: {
809
+ readOnlyHint: true,
810
+ idempotentHint: true,
811
+ openWorldHint: false
812
+ }
813
+ },
814
+ withApiErrorGuidance(async ({ projectId }) => {
815
+ const id = encodeURIComponent(projectId);
816
+ const data = await client.get(`/projects/${id}/goal-definitions`);
817
+ const structuredContent = {
818
+ goals: data.goals.map((g) => {
819
+ var _a;
820
+ return {
821
+ goalId: g.goal_id,
822
+ displayName: g.display_name,
823
+ role: g.role,
824
+ event: g.event,
825
+ urlPattern: (_a = g.url_pattern) != null ? _a : null,
826
+ status: g.status
827
+ };
828
+ })
829
+ };
830
+ if (!structuredContent.goals.length) {
831
+ return {
832
+ content: [{
833
+ type: "text",
834
+ text: "No goal definitions yet. Define one in the dashboard (Goals page or onboarding chat), or fire client.goal('<name>') from code and it will appear in get_goal_funnel once it converts."
835
+ }],
836
+ structuredContent
837
+ };
838
+ }
839
+ const lines = structuredContent.goals.map(
840
+ (g) => `${g.goalId} (${g.role}, ${g.event}${g.status === "archived" ? ", archived" : ""}) \u2014 ${g.displayName}`
841
+ );
842
+ lines.push("", `Reference a goalId verbatim from code: client.goal('<goalId>') or <Adaptive goal="<goalId>">.`);
843
+ return { content: [{ type: "text", text: lines.join("\n") }], structuredContent };
844
+ })
845
+ );
790
846
  }
791
847
 
792
848
  // src/tools/guardrails.ts
@@ -1520,7 +1576,7 @@ function registerAgentTrafficTools(server, client) {
1520
1576
  }
1521
1577
 
1522
1578
  // src/server.ts
1523
- var PKG_VERSION = true ? "0.10.0" : "0.0.0-dev";
1579
+ var PKG_VERSION = true ? "0.11.0" : "0.0.0-dev";
1524
1580
  function createMcpServer(client) {
1525
1581
  const server = new McpServer(
1526
1582
  {
package/dist/index.cjs CHANGED
@@ -791,6 +791,62 @@ function registerGoalTools(server, client) {
791
791
  return { content: [{ type: "text", text: lines.join("\n").trim() }], structuredContent, _meta: uiMeta("goal-funnel") };
792
792
  })
793
793
  );
794
+ server.registerTool(
795
+ "list_goals",
796
+ {
797
+ title: "List goal definitions",
798
+ description: `List the project's defined goals \u2014 including ones with no conversions yet, which get_goal_funnel cannot see. Returns each goal's stable id, display name, role (primary/secondary/guardrail), event type, and status. Reference a goalId verbatim from code: client.goal('<goalId>') or <Adaptive goal="<goalId>">.`,
799
+ inputSchema: { projectId: projectIdSchema },
800
+ outputSchema: {
801
+ goals: import_zod6.z.array(
802
+ import_zod6.z.object({
803
+ goalId: import_zod6.z.string().describe("Stable id \u2014 use this exact string when firing the goal from code"),
804
+ displayName: import_zod6.z.string(),
805
+ role: import_zod6.z.string().describe("primary | secondary | guardrail"),
806
+ event: import_zod6.z.string().describe("click | form_submit | url_reached"),
807
+ urlPattern: import_zod6.z.string().nullable().describe("Only for url_reached goals"),
808
+ status: import_zod6.z.string().describe("active | archived")
809
+ })
810
+ ).describe("Defined goals (empty if none)")
811
+ },
812
+ annotations: {
813
+ readOnlyHint: true,
814
+ idempotentHint: true,
815
+ openWorldHint: false
816
+ }
817
+ },
818
+ withApiErrorGuidance(async ({ projectId }) => {
819
+ const id = encodeURIComponent(projectId);
820
+ const data = await client.get(`/projects/${id}/goal-definitions`);
821
+ const structuredContent = {
822
+ goals: data.goals.map((g) => {
823
+ var _a2;
824
+ return {
825
+ goalId: g.goal_id,
826
+ displayName: g.display_name,
827
+ role: g.role,
828
+ event: g.event,
829
+ urlPattern: (_a2 = g.url_pattern) != null ? _a2 : null,
830
+ status: g.status
831
+ };
832
+ })
833
+ };
834
+ if (!structuredContent.goals.length) {
835
+ return {
836
+ content: [{
837
+ type: "text",
838
+ text: "No goal definitions yet. Define one in the dashboard (Goals page or onboarding chat), or fire client.goal('<name>') from code and it will appear in get_goal_funnel once it converts."
839
+ }],
840
+ structuredContent
841
+ };
842
+ }
843
+ const lines = structuredContent.goals.map(
844
+ (g) => `${g.goalId} (${g.role}, ${g.event}${g.status === "archived" ? ", archived" : ""}) \u2014 ${g.displayName}`
845
+ );
846
+ lines.push("", `Reference a goalId verbatim from code: client.goal('<goalId>') or <Adaptive goal="<goalId>">.`);
847
+ return { content: [{ type: "text", text: lines.join("\n") }], structuredContent };
848
+ })
849
+ );
794
850
  }
795
851
 
796
852
  // src/tools/guardrails.ts
@@ -1524,7 +1580,7 @@ function registerAgentTrafficTools(server, client) {
1524
1580
  }
1525
1581
 
1526
1582
  // src/server.ts
1527
- var PKG_VERSION = true ? "0.10.0" : "0.0.0-dev";
1583
+ var PKG_VERSION = true ? "0.11.0" : "0.0.0-dev";
1528
1584
  function createMcpServer(client) {
1529
1585
  const server = new import_mcp.McpServer(
1530
1586
  {
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ApiClient,
4
4
  createMcpServer
5
- } from "./chunk-ZH3EDKIT.js";
5
+ } from "./chunk-4TM3SCHF.js";
6
6
 
7
7
  // src/index.ts
8
8
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
package/dist/lib.cjs CHANGED
@@ -816,6 +816,62 @@ function registerGoalTools(server, client) {
816
816
  return { content: [{ type: "text", text: lines.join("\n").trim() }], structuredContent, _meta: uiMeta("goal-funnel") };
817
817
  })
818
818
  );
819
+ server.registerTool(
820
+ "list_goals",
821
+ {
822
+ title: "List goal definitions",
823
+ description: `List the project's defined goals \u2014 including ones with no conversions yet, which get_goal_funnel cannot see. Returns each goal's stable id, display name, role (primary/secondary/guardrail), event type, and status. Reference a goalId verbatim from code: client.goal('<goalId>') or <Adaptive goal="<goalId>">.`,
824
+ inputSchema: { projectId: projectIdSchema },
825
+ outputSchema: {
826
+ goals: import_zod6.z.array(
827
+ import_zod6.z.object({
828
+ goalId: import_zod6.z.string().describe("Stable id \u2014 use this exact string when firing the goal from code"),
829
+ displayName: import_zod6.z.string(),
830
+ role: import_zod6.z.string().describe("primary | secondary | guardrail"),
831
+ event: import_zod6.z.string().describe("click | form_submit | url_reached"),
832
+ urlPattern: import_zod6.z.string().nullable().describe("Only for url_reached goals"),
833
+ status: import_zod6.z.string().describe("active | archived")
834
+ })
835
+ ).describe("Defined goals (empty if none)")
836
+ },
837
+ annotations: {
838
+ readOnlyHint: true,
839
+ idempotentHint: true,
840
+ openWorldHint: false
841
+ }
842
+ },
843
+ withApiErrorGuidance(async ({ projectId }) => {
844
+ const id = encodeURIComponent(projectId);
845
+ const data = await client.get(`/projects/${id}/goal-definitions`);
846
+ const structuredContent = {
847
+ goals: data.goals.map((g) => {
848
+ var _a;
849
+ return {
850
+ goalId: g.goal_id,
851
+ displayName: g.display_name,
852
+ role: g.role,
853
+ event: g.event,
854
+ urlPattern: (_a = g.url_pattern) != null ? _a : null,
855
+ status: g.status
856
+ };
857
+ })
858
+ };
859
+ if (!structuredContent.goals.length) {
860
+ return {
861
+ content: [{
862
+ type: "text",
863
+ text: "No goal definitions yet. Define one in the dashboard (Goals page or onboarding chat), or fire client.goal('<name>') from code and it will appear in get_goal_funnel once it converts."
864
+ }],
865
+ structuredContent
866
+ };
867
+ }
868
+ const lines = structuredContent.goals.map(
869
+ (g) => `${g.goalId} (${g.role}, ${g.event}${g.status === "archived" ? ", archived" : ""}) \u2014 ${g.displayName}`
870
+ );
871
+ lines.push("", `Reference a goalId verbatim from code: client.goal('<goalId>') or <Adaptive goal="<goalId>">.`);
872
+ return { content: [{ type: "text", text: lines.join("\n") }], structuredContent };
873
+ })
874
+ );
819
875
  }
820
876
 
821
877
  // src/tools/guardrails.ts
@@ -1549,7 +1605,7 @@ function registerAgentTrafficTools(server, client) {
1549
1605
  }
1550
1606
 
1551
1607
  // src/server.ts
1552
- var PKG_VERSION = true ? "0.10.0" : "0.0.0-dev";
1608
+ var PKG_VERSION = true ? "0.11.0" : "0.0.0-dev";
1553
1609
  function createMcpServer(client) {
1554
1610
  const server = new import_mcp.McpServer(
1555
1611
  {
package/dist/lib.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  ApiClient,
4
4
  ApiError,
5
5
  createMcpServer
6
- } from "./chunk-ZH3EDKIT.js";
6
+ } from "./chunk-4TM3SCHF.js";
7
7
  export {
8
8
  ApiClient,
9
9
  ApiError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentientui/mcp",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "MCP server for SentientUI — exposes project data and actions to AI agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://sentient-ui.com",