@apex-inc/mcp-server 0.33.0 → 0.34.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.
Files changed (66) hide show
  1. package/README.md +19 -18
  2. package/dist/api-client.d.ts +5 -0
  3. package/dist/api-client.d.ts.map +1 -1
  4. package/dist/api-client.js +40 -24
  5. package/dist/api-client.js.map +1 -1
  6. package/dist/index.js +7 -4
  7. package/dist/index.js.map +1 -1
  8. package/dist/prompts.d.ts.map +1 -1
  9. package/dist/prompts.js +5 -7
  10. package/dist/prompts.js.map +1 -1
  11. package/dist/setup-catchup-tools.d.ts.map +1 -1
  12. package/dist/setup-catchup-tools.js +15 -3
  13. package/dist/setup-catchup-tools.js.map +1 -1
  14. package/dist/smoke-tools.d.ts +56 -0
  15. package/dist/smoke-tools.d.ts.map +1 -0
  16. package/dist/smoke-tools.js +261 -0
  17. package/dist/smoke-tools.js.map +1 -0
  18. package/dist/tool-catalog.d.ts +10 -0
  19. package/dist/tool-catalog.d.ts.map +1 -0
  20. package/dist/tool-catalog.js +36 -0
  21. package/dist/tool-catalog.js.map +1 -0
  22. package/dist/tool-groups.d.ts +5 -0
  23. package/dist/tool-groups.d.ts.map +1 -0
  24. package/dist/tool-groups.js +206 -0
  25. package/dist/tool-groups.js.map +1 -0
  26. package/dist/tool-shared.d.ts +300 -0
  27. package/dist/tool-shared.d.ts.map +1 -0
  28. package/dist/tool-shared.js +319 -0
  29. package/dist/tool-shared.js.map +1 -0
  30. package/dist/tools/accounts.d.ts +124 -0
  31. package/dist/tools/accounts.d.ts.map +1 -0
  32. package/dist/tools/accounts.js +99 -0
  33. package/dist/tools/accounts.js.map +1 -0
  34. package/dist/tools/adoption.d.ts +499 -0
  35. package/dist/tools/adoption.d.ts.map +1 -0
  36. package/dist/tools/adoption.js +447 -0
  37. package/dist/tools/adoption.js.map +1 -0
  38. package/dist/tools/context.d.ts +216 -0
  39. package/dist/tools/context.d.ts.map +1 -0
  40. package/dist/tools/context.js +328 -0
  41. package/dist/tools/context.js.map +1 -0
  42. package/dist/tools/experiments.d.ts +1066 -0
  43. package/dist/tools/experiments.d.ts.map +1 -0
  44. package/dist/tools/experiments.js +2090 -0
  45. package/dist/tools/experiments.js.map +1 -0
  46. package/dist/tools/letters.d.ts +1107 -0
  47. package/dist/tools/letters.d.ts.map +1 -0
  48. package/dist/tools/letters.js +1324 -0
  49. package/dist/tools/letters.js.map +1 -0
  50. package/dist/tools/measurement.d.ts +886 -0
  51. package/dist/tools/measurement.d.ts.map +1 -0
  52. package/dist/tools/measurement.js +1353 -0
  53. package/dist/tools/measurement.js.map +1 -0
  54. package/dist/tools/partners.d.ts +364 -0
  55. package/dist/tools/partners.d.ts.map +1 -0
  56. package/dist/tools/partners.js +199 -0
  57. package/dist/tools/partners.js.map +1 -0
  58. package/dist/tools.d.ts +3161 -2826
  59. package/dist/tools.d.ts.map +1 -1
  60. package/dist/tools.js +26 -6112
  61. package/dist/tools.js.map +1 -1
  62. package/package.json +3 -2
  63. package/skills/apex-communications/SKILL.md +5 -5
  64. package/skills/apex-experimentation/SKILL.md +8 -11
  65. package/skills/apex-growth-intelligence/SKILL.md +1 -1
  66. package/skills/apex-integration-cookbook/SKILL.md +1 -1
@@ -0,0 +1,124 @@
1
+ import { z } from "zod";
2
+ export declare const accountTools: {
3
+ list_accounts: {
4
+ description: string;
5
+ schema: z.ZodObject<{
6
+ sort: z.ZodOptional<z.ZodEnum<["ltv", "name", "members", "pipeline"]>>;
7
+ search: z.ZodOptional<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ sort?: "name" | "pipeline" | "ltv" | "members" | undefined;
10
+ search?: string | undefined;
11
+ }, {
12
+ sort?: "name" | "pipeline" | "ltv" | "members" | undefined;
13
+ search?: string | undefined;
14
+ }>;
15
+ handler: ({ sort, search }: {
16
+ sort?: string;
17
+ search?: string;
18
+ }) => Promise<{
19
+ content: {
20
+ type: "text";
21
+ text: string;
22
+ }[];
23
+ }>;
24
+ };
25
+ get_account: {
26
+ description: string;
27
+ schema: z.ZodObject<{
28
+ accountId: z.ZodString;
29
+ }, "strip", z.ZodTypeAny, {
30
+ accountId: string;
31
+ }, {
32
+ accountId: string;
33
+ }>;
34
+ handler: ({ accountId }: {
35
+ accountId: string;
36
+ }) => Promise<{
37
+ content: {
38
+ type: "text";
39
+ text: string;
40
+ }[];
41
+ }>;
42
+ };
43
+ get_account_people: {
44
+ description: string;
45
+ schema: z.ZodObject<{
46
+ accountId: z.ZodString;
47
+ }, "strip", z.ZodTypeAny, {
48
+ accountId: string;
49
+ }, {
50
+ accountId: string;
51
+ }>;
52
+ handler: ({ accountId }: {
53
+ accountId: string;
54
+ }) => Promise<{
55
+ content: {
56
+ type: "text";
57
+ text: string;
58
+ }[];
59
+ }>;
60
+ };
61
+ list_sub_accounts: {
62
+ description: string;
63
+ schema: z.ZodObject<{
64
+ accountId: z.ZodString;
65
+ }, "strip", z.ZodTypeAny, {
66
+ accountId: string;
67
+ }, {
68
+ accountId: string;
69
+ }>;
70
+ handler: ({ accountId }: {
71
+ accountId: string;
72
+ }) => Promise<{
73
+ content: {
74
+ type: "text";
75
+ text: string;
76
+ }[];
77
+ }>;
78
+ };
79
+ get_contact_groups: {
80
+ description: string;
81
+ schema: z.ZodObject<{
82
+ contactId: z.ZodString;
83
+ }, "strip", z.ZodTypeAny, {
84
+ contactId: string;
85
+ }, {
86
+ contactId: string;
87
+ }>;
88
+ handler: ({ contactId }: {
89
+ contactId: string;
90
+ }) => Promise<{
91
+ content: {
92
+ type: "text";
93
+ text: string;
94
+ }[];
95
+ }>;
96
+ };
97
+ update_account_pipeline: {
98
+ description: string;
99
+ schema: z.ZodObject<{
100
+ accountId: z.ZodString;
101
+ pipelineValue: z.ZodNumber;
102
+ note: z.ZodOptional<z.ZodString>;
103
+ }, "strip", z.ZodTypeAny, {
104
+ accountId: string;
105
+ pipelineValue: number;
106
+ note?: string | undefined;
107
+ }, {
108
+ accountId: string;
109
+ pipelineValue: number;
110
+ note?: string | undefined;
111
+ }>;
112
+ handler: ({ accountId, pipelineValue, note, }: {
113
+ accountId: string;
114
+ pipelineValue: number;
115
+ note?: string;
116
+ }) => Promise<{
117
+ content: {
118
+ type: "text";
119
+ text: string;
120
+ }[];
121
+ }>;
122
+ };
123
+ };
124
+ //# sourceMappingURL=accounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;oCAUa;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;iCAkBrC;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;iCAiBrB;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;iCAiBrB;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;iCAiBrB;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;uDAuBjD;YACD,SAAS,EAAE,MAAM,CAAC;YAClB,aAAa,EAAE,MAAM,CAAC;YACtB,IAAI,CAAC,EAAE,MAAM,CAAC;SACf;;;;;;;CAYJ,CAAC"}
@@ -0,0 +1,99 @@
1
+ import { z } from "zod";
2
+ import { apiGet, apiPost } from "../api-client.js";
3
+ import { APEX } from "../tool-shared.js";
4
+ export const accountTools = {
5
+ list_accounts: {
6
+ description: `${APEX} — List B2B accounts (companies / clients) in the active workspace with rollup LTV, member count, and pipeline. Accounts aggregate every member's revenue into one company-level number. Default sort is by LTV.`,
7
+ schema: z.object({
8
+ sort: z
9
+ .enum(["ltv", "name", "members", "pipeline"])
10
+ .optional()
11
+ .describe("Sort order (default: ltv)."),
12
+ search: z.string().optional().describe("Filter by account name or domain."),
13
+ }),
14
+ handler: async ({ sort, search }) => {
15
+ const q = new URLSearchParams();
16
+ if (sort)
17
+ q.set("sort", sort);
18
+ if (search)
19
+ q.set("search", search);
20
+ const qs = q.toString();
21
+ const json = await apiGet(`/api/accounts${qs ? `?${qs}` : ""}`);
22
+ const data = Array.isArray(json) ? json : (json.data ?? []);
23
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
24
+ },
25
+ },
26
+ get_account: {
27
+ description: `${APEX} — Read one B2B account: rollup counters (account LTV, gross, refunds, purchases), member count, plan, seats, and traits. Account LTV is the sum of every member's directly-billed revenue with no double counting.`,
28
+ schema: z.object({
29
+ accountId: z.string().describe("Internal acct_ id from list_accounts."),
30
+ }),
31
+ handler: async ({ accountId }) => {
32
+ const json = await apiGet(`/api/accounts/${encodeURIComponent(accountId)}`);
33
+ return {
34
+ content: [
35
+ { type: "text", text: JSON.stringify(json.data ?? json, null, 2) },
36
+ ],
37
+ };
38
+ },
39
+ },
40
+ get_account_people: {
41
+ description: `${APEX} — The member roster for an account: every Contact linked to it (primary members plus sub-account members), with each member's directly-billed revenue, score, and last-active. Per-person dollars are what that member was billed — account LTV is never split across seats.`,
42
+ schema: z.object({
43
+ accountId: z.string().describe("Internal acct_ id (or a sub-account id)."),
44
+ }),
45
+ handler: async ({ accountId }) => {
46
+ const json = await apiGet(`/api/accounts/${encodeURIComponent(accountId)}/people`);
47
+ return {
48
+ content: [
49
+ { type: "text", text: JSON.stringify(json.data ?? [], null, 2) },
50
+ ],
51
+ };
52
+ },
53
+ },
54
+ list_sub_accounts: {
55
+ description: `${APEX} — List the sub-accounts (workspaces / teams / projects) that belong to a B2B account (B2B-001). Sub-accounts are the intermediate org-unit layer between an account and its people; each carries a kind label and its own member count.`,
56
+ schema: z.object({
57
+ accountId: z.string().describe("Parent account id from list_accounts."),
58
+ }),
59
+ handler: async ({ accountId }) => {
60
+ const json = await apiGet(`/api/accounts/${encodeURIComponent(accountId)}/subaccounts`);
61
+ return {
62
+ content: [
63
+ { type: "text", text: JSON.stringify(json.data ?? [], null, 2) },
64
+ ],
65
+ };
66
+ },
67
+ },
68
+ get_contact_groups: {
69
+ description: `${APEX} — The account groups (workspaces / teams) a contact belongs to (B2B-001) — the answer to "which workspaces is this user in?". Returns each group with its kind and the contact's role in it.`,
70
+ schema: z.object({
71
+ contactId: z.string().describe("Contact / customer id."),
72
+ }),
73
+ handler: async ({ contactId }) => {
74
+ const json = await apiGet(`/api/customers/${encodeURIComponent(contactId)}/groups`);
75
+ return {
76
+ content: [
77
+ { type: "text", text: JSON.stringify(json.data ?? [], null, 2) },
78
+ ],
79
+ };
80
+ },
81
+ },
82
+ update_account_pipeline: {
83
+ description: `${APEX} — Log an account-level pipeline (open-deal) value with a note (Sales-Led / Hybrid workspaces). The account number is canonical for reporting when both an account and a contact pipeline value exist.`,
84
+ schema: z.object({
85
+ accountId: z.string().describe("Internal acct_ id."),
86
+ pipelineValue: z.number().describe("Open-deal value in USD."),
87
+ note: z.string().optional().describe("Why the value changed."),
88
+ }),
89
+ handler: async ({ accountId, pipelineValue, note, }) => {
90
+ const json = await apiPost(`/api/accounts/${encodeURIComponent(accountId)}/pipeline`, { pipelineValue, note });
91
+ return {
92
+ content: [
93
+ { type: "text", text: JSON.stringify(json.data ?? json, null, 2) },
94
+ ],
95
+ };
96
+ },
97
+ },
98
+ };
99
+ //# sourceMappingURL=accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/tools/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,aAAa,EAAE;QACb,WAAW,EAAE,GAAG,IAAI,kNAAkN;QACtO,MAAM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