@qikdev/mcp 6.7.1 → 6.7.5
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/build/src/tools/campaign.d.ts.map +1 -1
- package/build/src/tools/campaign.js +9 -76
- package/build/src/tools/campaign.js.map +1 -1
- package/build/src/tools/checkin.d.ts.map +1 -1
- package/build/src/tools/checkin.js +6 -34
- package/build/src/tools/checkin.js.map +1 -1
- package/build/src/tools/content.d.ts +29 -0
- package/build/src/tools/content.d.ts.map +1 -0
- package/build/src/tools/content.js +153 -0
- package/build/src/tools/content.js.map +1 -0
- package/build/src/tools/create.d.ts.map +1 -1
- package/build/src/tools/create.js +108 -158
- package/build/src/tools/create.js.map +1 -1
- package/build/src/tools/duplicates.d.ts +27 -0
- package/build/src/tools/duplicates.d.ts.map +1 -0
- package/build/src/tools/duplicates.js +142 -0
- package/build/src/tools/duplicates.js.map +1 -0
- package/build/src/tools/filters.d.ts.map +1 -1
- package/build/src/tools/filters.js +5 -29
- package/build/src/tools/filters.js.map +1 -1
- package/build/src/tools/glossary.d.ts.map +1 -1
- package/build/src/tools/glossary.js +7 -161
- package/build/src/tools/glossary.js.map +1 -1
- package/build/src/tools/index.d.ts.map +1 -1
- package/build/src/tools/index.js +66 -0
- package/build/src/tools/index.js.map +1 -1
- package/build/src/tools/list.js +2 -53
- package/build/src/tools/list.js.map +1 -1
- package/build/src/tools/merge.d.ts +34 -0
- package/build/src/tools/merge.d.ts.map +1 -0
- package/build/src/tools/merge.js +192 -0
- package/build/src/tools/merge.js.map +1 -0
- package/build/src/tools/profile-access.d.ts +47 -0
- package/build/src/tools/profile-access.d.ts.map +1 -0
- package/build/src/tools/profile-access.js +264 -0
- package/build/src/tools/profile-access.js.map +1 -0
- package/build/src/tools/profile-relationships.d.ts +43 -0
- package/build/src/tools/profile-relationships.d.ts.map +1 -0
- package/build/src/tools/profile-relationships.js +270 -0
- package/build/src/tools/profile-relationships.js.map +1 -0
- package/build/src/tools/profile.d.ts.map +1 -1
- package/build/src/tools/profile.js +2 -41
- package/build/src/tools/profile.js.map +1 -1
- package/build/src/tools/relationships.d.ts.map +1 -1
- package/build/src/tools/relationships.js +3 -61
- package/build/src/tools/relationships.js.map +1 -1
- package/build/src/tools/reporting.d.ts.map +1 -1
- package/build/src/tools/reporting.js +10 -63
- package/build/src/tools/reporting.js.map +1 -1
- package/build/src/tools/scope.d.ts +47 -0
- package/build/src/tools/scope.d.ts.map +1 -0
- package/build/src/tools/scope.js +263 -0
- package/build/src/tools/scope.js.map +1 -0
- package/build/src/tools/search.d.ts +19 -0
- package/build/src/tools/search.d.ts.map +1 -0
- package/build/src/tools/search.js +84 -0
- package/build/src/tools/search.js.map +1 -0
- package/build/src/tools/smartlist.d.ts +26 -0
- package/build/src/tools/smartlist.d.ts.map +1 -0
- package/build/src/tools/smartlist.js +126 -0
- package/build/src/tools/smartlist.js.map +1 -0
- package/build/src/tools/sms.d.ts.map +1 -1
- package/build/src/tools/sms.js +4 -35
- package/build/src/tools/sms.js.map +1 -1
- package/build/src/tools/update.d.ts.map +1 -1
- package/build/src/tools/update.js +59 -70
- package/build/src/tools/update.js.map +1 -1
- package/build/src/tools/user.js +1 -1
- package/build/src/tools/user.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Scope Tools
|
|
4
|
+
*
|
|
5
|
+
* Manage organisational scopes (groups, departments, locations).
|
|
6
|
+
* Scopes are hierarchical containers for organising content and permissions.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getScopeTreeTool: Tool;
|
|
9
|
+
export declare const getActionableScopesTool: Tool;
|
|
10
|
+
export declare const addProfileToScopeTool: Tool;
|
|
11
|
+
export declare const removeProfileFromScopeTool: Tool;
|
|
12
|
+
export declare function handleGetScopeTree(args: {}): Promise<{
|
|
13
|
+
content: Array<{
|
|
14
|
+
type: string;
|
|
15
|
+
text: string;
|
|
16
|
+
}>;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function handleGetActionableScopes(args: {
|
|
19
|
+
type: string;
|
|
20
|
+
action: string;
|
|
21
|
+
}): Promise<{
|
|
22
|
+
content: Array<{
|
|
23
|
+
type: string;
|
|
24
|
+
text: string;
|
|
25
|
+
}>;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function handleAddProfileToScope(args: {
|
|
28
|
+
scopeId: string;
|
|
29
|
+
profileId: string;
|
|
30
|
+
positionTitle?: string;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
content: Array<{
|
|
33
|
+
type: string;
|
|
34
|
+
text: string;
|
|
35
|
+
}>;
|
|
36
|
+
}>;
|
|
37
|
+
export declare function handleRemoveProfileFromScope(args: {
|
|
38
|
+
scopeId: string;
|
|
39
|
+
profileId: string;
|
|
40
|
+
positionKey?: string;
|
|
41
|
+
}): Promise<{
|
|
42
|
+
content: Array<{
|
|
43
|
+
type: string;
|
|
44
|
+
text: string;
|
|
45
|
+
}>;
|
|
46
|
+
}>;
|
|
47
|
+
//# sourceMappingURL=scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/tools/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG1D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,IAU9B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,IA4BrC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,IAgCnC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,IA8BxC,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAsC9G;AAED,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA2C9D;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA2C9D;AAED,wBAAsB,4BAA4B,CAAC,IAAI,EAAE;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA2C9D"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { ConfigManager } from "../config.js";
|
|
2
|
+
/**
|
|
3
|
+
* Scope Tools
|
|
4
|
+
*
|
|
5
|
+
* Manage organisational scopes (groups, departments, locations).
|
|
6
|
+
* Scopes are hierarchical containers for organising content and permissions.
|
|
7
|
+
*/
|
|
8
|
+
export const getScopeTreeTool = {
|
|
9
|
+
name: "get_scope_tree",
|
|
10
|
+
description: `Get the full hierarchical tree of scopes the user can access.
|
|
11
|
+
|
|
12
|
+
Returns nested structure showing the organisation's scope hierarchy.
|
|
13
|
+
Useful for understanding the organisation structure.`,
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {}
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export const getActionableScopesTool = {
|
|
20
|
+
name: "get_actionable_scopes",
|
|
21
|
+
description: `Get scopes where the user can perform a specific action on a content type.
|
|
22
|
+
|
|
23
|
+
Useful for determining where content can be created, edited, or deleted.
|
|
24
|
+
|
|
25
|
+
**Example:**
|
|
26
|
+
\`\`\`json
|
|
27
|
+
{
|
|
28
|
+
"type": "profile",
|
|
29
|
+
"action": "create"
|
|
30
|
+
}
|
|
31
|
+
\`\`\``,
|
|
32
|
+
inputSchema: {
|
|
33
|
+
type: "object",
|
|
34
|
+
properties: {
|
|
35
|
+
type: {
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "Content type key (e.g., 'profile', 'article')"
|
|
38
|
+
},
|
|
39
|
+
action: {
|
|
40
|
+
type: "string",
|
|
41
|
+
enum: ["create", "edit", "delete", "view"],
|
|
42
|
+
description: "The action to check permissions for"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
required: ["type", "action"]
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
export const addProfileToScopeTool = {
|
|
49
|
+
name: "add_profile_to_scope",
|
|
50
|
+
description: `Add a profile to a position within a scope.
|
|
51
|
+
|
|
52
|
+
Positions are roles like "Member", "Leader", "Volunteer", etc.
|
|
53
|
+
|
|
54
|
+
**Example:**
|
|
55
|
+
\`\`\`json
|
|
56
|
+
{
|
|
57
|
+
"scopeId": "scopeId123",
|
|
58
|
+
"profileId": "profileId456",
|
|
59
|
+
"positionTitle": "Member"
|
|
60
|
+
}
|
|
61
|
+
\`\`\``,
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: "object",
|
|
64
|
+
properties: {
|
|
65
|
+
scopeId: {
|
|
66
|
+
type: "string",
|
|
67
|
+
description: "The scope ID"
|
|
68
|
+
},
|
|
69
|
+
profileId: {
|
|
70
|
+
type: "string",
|
|
71
|
+
description: "The profile ID to add"
|
|
72
|
+
},
|
|
73
|
+
positionTitle: {
|
|
74
|
+
type: "string",
|
|
75
|
+
description: "Position title (default: 'Member')"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
required: ["scopeId", "profileId"]
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
export const removeProfileFromScopeTool = {
|
|
82
|
+
name: "remove_profile_from_scope",
|
|
83
|
+
description: `Remove a profile from a position within a scope.
|
|
84
|
+
|
|
85
|
+
**Example:**
|
|
86
|
+
\`\`\`json
|
|
87
|
+
{
|
|
88
|
+
"scopeId": "scopeId123",
|
|
89
|
+
"profileId": "profileId456",
|
|
90
|
+
"positionKey": "member"
|
|
91
|
+
}
|
|
92
|
+
\`\`\``,
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
scopeId: {
|
|
97
|
+
type: "string",
|
|
98
|
+
description: "The scope ID"
|
|
99
|
+
},
|
|
100
|
+
profileId: {
|
|
101
|
+
type: "string",
|
|
102
|
+
description: "The profile ID to remove"
|
|
103
|
+
},
|
|
104
|
+
positionKey: {
|
|
105
|
+
type: "string",
|
|
106
|
+
description: "Position key (optional, removes from all if not specified)"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
required: ["scopeId", "profileId"]
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
export async function handleGetScopeTree(args) {
|
|
113
|
+
try {
|
|
114
|
+
const configManager = new ConfigManager();
|
|
115
|
+
const config = await configManager.loadConfig();
|
|
116
|
+
if (!config) {
|
|
117
|
+
throw new Error('Qik MCP server not configured. Run setup first.');
|
|
118
|
+
}
|
|
119
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/scope/tree`, {
|
|
120
|
+
headers: {
|
|
121
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
122
|
+
'Content-Type': 'application/json',
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
if (!response.ok) {
|
|
126
|
+
const errorText = await response.text();
|
|
127
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
128
|
+
}
|
|
129
|
+
const data = await response.json();
|
|
130
|
+
return {
|
|
131
|
+
content: [{
|
|
132
|
+
type: "text",
|
|
133
|
+
text: JSON.stringify(data, null, 2)
|
|
134
|
+
}]
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
return {
|
|
139
|
+
content: [{
|
|
140
|
+
type: "text",
|
|
141
|
+
text: JSON.stringify({ error: error.message }, null, 2)
|
|
142
|
+
}]
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
export async function handleGetActionableScopes(args) {
|
|
147
|
+
try {
|
|
148
|
+
const configManager = new ConfigManager();
|
|
149
|
+
const config = await configManager.loadConfig();
|
|
150
|
+
if (!config) {
|
|
151
|
+
throw new Error('Qik MCP server not configured. Run setup first.');
|
|
152
|
+
}
|
|
153
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/scope/actionable`, {
|
|
154
|
+
method: 'POST',
|
|
155
|
+
headers: {
|
|
156
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
157
|
+
'Content-Type': 'application/json',
|
|
158
|
+
},
|
|
159
|
+
body: JSON.stringify({
|
|
160
|
+
type: args.type,
|
|
161
|
+
action: args.action
|
|
162
|
+
})
|
|
163
|
+
});
|
|
164
|
+
if (!response.ok) {
|
|
165
|
+
const errorText = await response.text();
|
|
166
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
167
|
+
}
|
|
168
|
+
const data = await response.json();
|
|
169
|
+
return {
|
|
170
|
+
content: [{
|
|
171
|
+
type: "text",
|
|
172
|
+
text: JSON.stringify(data, null, 2)
|
|
173
|
+
}]
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
return {
|
|
178
|
+
content: [{
|
|
179
|
+
type: "text",
|
|
180
|
+
text: JSON.stringify({ error: error.message }, null, 2)
|
|
181
|
+
}]
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
export async function handleAddProfileToScope(args) {
|
|
186
|
+
try {
|
|
187
|
+
const configManager = new ConfigManager();
|
|
188
|
+
const config = await configManager.loadConfig();
|
|
189
|
+
if (!config) {
|
|
190
|
+
throw new Error('Qik MCP server not configured. Run setup first.');
|
|
191
|
+
}
|
|
192
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/scope/${args.scopeId}/profile/add`, {
|
|
193
|
+
method: 'POST',
|
|
194
|
+
headers: {
|
|
195
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
196
|
+
'Content-Type': 'application/json',
|
|
197
|
+
},
|
|
198
|
+
body: JSON.stringify({
|
|
199
|
+
profile: args.profileId,
|
|
200
|
+
title: args.positionTitle || 'Member'
|
|
201
|
+
})
|
|
202
|
+
});
|
|
203
|
+
if (!response.ok) {
|
|
204
|
+
const errorText = await response.text();
|
|
205
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
206
|
+
}
|
|
207
|
+
const data = await response.json();
|
|
208
|
+
return {
|
|
209
|
+
content: [{
|
|
210
|
+
type: "text",
|
|
211
|
+
text: JSON.stringify(data, null, 2)
|
|
212
|
+
}]
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
return {
|
|
217
|
+
content: [{
|
|
218
|
+
type: "text",
|
|
219
|
+
text: JSON.stringify({ error: error.message }, null, 2)
|
|
220
|
+
}]
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
export async function handleRemoveProfileFromScope(args) {
|
|
225
|
+
try {
|
|
226
|
+
const configManager = new ConfigManager();
|
|
227
|
+
const config = await configManager.loadConfig();
|
|
228
|
+
if (!config) {
|
|
229
|
+
throw new Error('Qik MCP server not configured. Run setup first.');
|
|
230
|
+
}
|
|
231
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/scope/${args.scopeId}/profile/remove`, {
|
|
232
|
+
method: 'PUT',
|
|
233
|
+
headers: {
|
|
234
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
235
|
+
'Content-Type': 'application/json',
|
|
236
|
+
},
|
|
237
|
+
body: JSON.stringify({
|
|
238
|
+
profile: args.profileId,
|
|
239
|
+
key: args.positionKey
|
|
240
|
+
})
|
|
241
|
+
});
|
|
242
|
+
if (!response.ok) {
|
|
243
|
+
const errorText = await response.text();
|
|
244
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
245
|
+
}
|
|
246
|
+
const data = await response.json();
|
|
247
|
+
return {
|
|
248
|
+
content: [{
|
|
249
|
+
type: "text",
|
|
250
|
+
text: JSON.stringify(data, null, 2)
|
|
251
|
+
}]
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
return {
|
|
256
|
+
content: [{
|
|
257
|
+
type: "text",
|
|
258
|
+
text: JSON.stringify({ error: error.message }, null, 2)
|
|
259
|
+
}]
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
//# sourceMappingURL=scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../src/tools/scope.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE;;;qDAGsC;IACnD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,EAAE;KACf;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAS;IAC3C,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE;;;;;;;;;;OAUR;IACL,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,U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AE,IAAI,EAAE,CAAC,CAAC;iBACpC,CAAC;SACH,CAAC;IAEJ,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACxD,CAAC;SACH,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Global Search Tool
|
|
4
|
+
*
|
|
5
|
+
* Search across multiple content types simultaneously.
|
|
6
|
+
* Returns results grouped by content type.
|
|
7
|
+
*/
|
|
8
|
+
export declare const globalSearchTool: Tool;
|
|
9
|
+
export declare function handleGlobalSearch(args: {
|
|
10
|
+
keywords: string;
|
|
11
|
+
types?: string[];
|
|
12
|
+
limit?: number;
|
|
13
|
+
}): Promise<{
|
|
14
|
+
content: Array<{
|
|
15
|
+
type: string;
|
|
16
|
+
text: string;
|
|
17
|
+
}>;
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/tools/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG1D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,IAmC9B,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA4C9D"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ConfigManager } from "../config.js";
|
|
2
|
+
/**
|
|
3
|
+
* Global Search Tool
|
|
4
|
+
*
|
|
5
|
+
* Search across multiple content types simultaneously.
|
|
6
|
+
* Returns results grouped by content type.
|
|
7
|
+
*/
|
|
8
|
+
export const globalSearchTool = {
|
|
9
|
+
name: "global_search",
|
|
10
|
+
description: `Search across multiple content types simultaneously.
|
|
11
|
+
|
|
12
|
+
Returns results grouped by content type. Useful for finding any content when you don't know the exact type.
|
|
13
|
+
|
|
14
|
+
**Example:**
|
|
15
|
+
\`\`\`json
|
|
16
|
+
{
|
|
17
|
+
"keywords": "john smith",
|
|
18
|
+
"types": ["profile", "article"],
|
|
19
|
+
"limit": 10
|
|
20
|
+
}
|
|
21
|
+
\`\`\`
|
|
22
|
+
|
|
23
|
+
If types is not provided, searches common types: profile, article, event, campaign, etc.`,
|
|
24
|
+
inputSchema: {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
keywords: {
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "Search terms"
|
|
30
|
+
},
|
|
31
|
+
types: {
|
|
32
|
+
type: "array",
|
|
33
|
+
items: { type: "string" },
|
|
34
|
+
description: "Content types to search (defaults to common types if empty)"
|
|
35
|
+
},
|
|
36
|
+
limit: {
|
|
37
|
+
type: "number",
|
|
38
|
+
description: "Max results per type (default: 10)"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
required: ["keywords"]
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export async function handleGlobalSearch(args) {
|
|
45
|
+
try {
|
|
46
|
+
const configManager = new ConfigManager();
|
|
47
|
+
const config = await configManager.loadConfig();
|
|
48
|
+
if (!config) {
|
|
49
|
+
throw new Error('Qik MCP server not configured. Run setup first.');
|
|
50
|
+
}
|
|
51
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/search`, {
|
|
52
|
+
method: 'POST',
|
|
53
|
+
headers: {
|
|
54
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
55
|
+
'Content-Type': 'application/json',
|
|
56
|
+
},
|
|
57
|
+
body: JSON.stringify({
|
|
58
|
+
keywords: args.keywords,
|
|
59
|
+
types: args.types || [],
|
|
60
|
+
limit: args.limit || 10
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
if (!response.ok) {
|
|
64
|
+
const errorText = await response.text();
|
|
65
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
66
|
+
}
|
|
67
|
+
const data = await response.json();
|
|
68
|
+
return {
|
|
69
|
+
content: [{
|
|
70
|
+
type: "text",
|
|
71
|
+
text: JSON.stringify(data, null, 2)
|
|
72
|
+
}]
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
return {
|
|
77
|
+
content: [{
|
|
78
|
+
type: "text",
|
|
79
|
+
text: JSON.stringify({ error: error.message }, null, 2)
|
|
80
|
+
}]
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/tools/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE;;;;;;;;;;;;;yFAa0E;IACvF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,cAAc;aAC5B;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,E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BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;iBACpC,CAAC;SACH,CAAC;IAEJ,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACxD,CAAC;SACH,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Smartlist Tools
|
|
4
|
+
*
|
|
5
|
+
* Execute and export saved queries (Smart Lists).
|
|
6
|
+
* Smart Lists are reusable filtered views of content.
|
|
7
|
+
*/
|
|
8
|
+
export declare const runSmartlistTool: Tool;
|
|
9
|
+
export declare const exportSmartlistTool: Tool;
|
|
10
|
+
export declare function handleRunSmartlist(args: {
|
|
11
|
+
smartlistId: string;
|
|
12
|
+
}): Promise<{
|
|
13
|
+
content: Array<{
|
|
14
|
+
type: string;
|
|
15
|
+
text: string;
|
|
16
|
+
}>;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function handleExportSmartlist(args: {
|
|
19
|
+
smartlistId: string;
|
|
20
|
+
}): Promise<{
|
|
21
|
+
content: Array<{
|
|
22
|
+
type: string;
|
|
23
|
+
text: string;
|
|
24
|
+
}>;
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=smartlist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smartlist.d.ts","sourceRoot":"","sources":["../../../src/tools/smartlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG1D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,IAwB9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,IAsBjC,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAsC9D;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAwC9D"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { ConfigManager } from "../config.js";
|
|
2
|
+
/**
|
|
3
|
+
* Smartlist Tools
|
|
4
|
+
*
|
|
5
|
+
* Execute and export saved queries (Smart Lists).
|
|
6
|
+
* Smart Lists are reusable filtered views of content.
|
|
7
|
+
*/
|
|
8
|
+
export const runSmartlistTool = {
|
|
9
|
+
name: "run_smartlist",
|
|
10
|
+
description: `Execute a Smart List (saved query) and get results.
|
|
11
|
+
|
|
12
|
+
Smart Lists are pre-configured filtered views with columns, sorting, and pagination.
|
|
13
|
+
|
|
14
|
+
**Example:**
|
|
15
|
+
\`\`\`json
|
|
16
|
+
{
|
|
17
|
+
"smartlistId": "abc123"
|
|
18
|
+
}
|
|
19
|
+
\`\`\`
|
|
20
|
+
|
|
21
|
+
Returns the smartlist configuration and matching results.`,
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {
|
|
25
|
+
smartlistId: {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "The Smart List ID to execute"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
required: ["smartlistId"]
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export const exportSmartlistTool = {
|
|
34
|
+
name: "export_smartlist",
|
|
35
|
+
description: `Export a Smart List's results to CSV.
|
|
36
|
+
|
|
37
|
+
Creates a batch export job. Use get_batch_status to track progress.
|
|
38
|
+
|
|
39
|
+
**Example:**
|
|
40
|
+
\`\`\`json
|
|
41
|
+
{
|
|
42
|
+
"smartlistId": "abc123"
|
|
43
|
+
}
|
|
44
|
+
\`\`\``,
|
|
45
|
+
inputSchema: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
smartlistId: {
|
|
49
|
+
type: "string",
|
|
50
|
+
description: "The Smart List ID to export"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
required: ["smartlistId"]
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
export async function handleRunSmartlist(args) {
|
|
57
|
+
try {
|
|
58
|
+
const configManager = new ConfigManager();
|
|
59
|
+
const config = await configManager.loadConfig();
|
|
60
|
+
if (!config) {
|
|
61
|
+
throw new Error('Qik MCP server not configured. Run setup first.');
|
|
62
|
+
}
|
|
63
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/smartlist/${args.smartlistId}`, {
|
|
64
|
+
headers: {
|
|
65
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
66
|
+
'Content-Type': 'application/json',
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
if (!response.ok) {
|
|
70
|
+
const errorText = await response.text();
|
|
71
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
72
|
+
}
|
|
73
|
+
const data = await response.json();
|
|
74
|
+
return {
|
|
75
|
+
content: [{
|
|
76
|
+
type: "text",
|
|
77
|
+
text: JSON.stringify(data, null, 2)
|
|
78
|
+
}]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
return {
|
|
83
|
+
content: [{
|
|
84
|
+
type: "text",
|
|
85
|
+
text: JSON.stringify({ error: error.message }, null, 2)
|
|
86
|
+
}]
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export async function handleExportSmartlist(args) {
|
|
91
|
+
try {
|
|
92
|
+
const configManager = new ConfigManager();
|
|
93
|
+
const config = await configManager.loadConfig();
|
|
94
|
+
if (!config) {
|
|
95
|
+
throw new Error('Qik MCP server not configured. Run setup first.');
|
|
96
|
+
}
|
|
97
|
+
const response = await fetch(`${config.apiUrl || 'https://api.qik.dev'}/smartlist/${args.smartlistId}/export`, {
|
|
98
|
+
method: 'POST',
|
|
99
|
+
headers: {
|
|
100
|
+
'Authorization': `Bearer ${config.accessToken}`,
|
|
101
|
+
'Content-Type': 'application/json',
|
|
102
|
+
},
|
|
103
|
+
body: JSON.stringify({})
|
|
104
|
+
});
|
|
105
|
+
if (!response.ok) {
|
|
106
|
+
const errorText = await response.text();
|
|
107
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
108
|
+
}
|
|
109
|
+
const data = await response.json();
|
|
110
|
+
return {
|
|
111
|
+
content: [{
|
|
112
|
+
type: "text",
|
|
113
|
+
text: JSON.stringify(data, null, 2)
|
|
114
|
+
}]
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
return {
|
|
119
|
+
content: [{
|
|
120
|
+
type: "text",
|
|
121
|
+
text: JSON.stringify({ error: error.message }, null, 2)
|
|
122
|
+
}]
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=smartlist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smartlist.js","sourceRoot":"","sources":["../../../src/tools/smartlist.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE;;;;;;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AAK,SAAS,EAAE,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAEnC,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;iBACpC,CAAC;SACH,CAAC;IAEJ,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACxD,CAAC;SACH,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sms.d.ts","sourceRoot":"","sources":["../../../src/tools/sms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG1D,eAAO,MAAM,eAAe,EAAE,IAmC7B,CAAC;AAEF,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"sms.d.ts","sourceRoot":"","sources":["../../../src/tools/sms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG1D,eAAO,MAAM,eAAe,EAAE,IAmC7B,CAAC;AAEF,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAmEpK"}
|