@graphite-atlas/mcp-server 1.0.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 (52) hide show
  1. package/EXAMPLES.md +501 -0
  2. package/LICENSE +21 -0
  3. package/README.md +440 -0
  4. package/dist/client.d.ts +272 -0
  5. package/dist/client.d.ts.map +1 -0
  6. package/dist/client.js +335 -0
  7. package/dist/client.js.map +1 -0
  8. package/dist/index.d.ts +16 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +124 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/tools/analytics.d.ts +9 -0
  13. package/dist/tools/analytics.d.ts.map +1 -0
  14. package/dist/tools/analytics.js +374 -0
  15. package/dist/tools/analytics.js.map +1 -0
  16. package/dist/tools/atlases.d.ts +7 -0
  17. package/dist/tools/atlases.d.ts.map +1 -0
  18. package/dist/tools/atlases.js +132 -0
  19. package/dist/tools/atlases.js.map +1 -0
  20. package/dist/tools/batch.d.ts +10 -0
  21. package/dist/tools/batch.d.ts.map +1 -0
  22. package/dist/tools/batch.js +154 -0
  23. package/dist/tools/batch.js.map +1 -0
  24. package/dist/tools/brain-dump.d.ts +7 -0
  25. package/dist/tools/brain-dump.d.ts.map +1 -0
  26. package/dist/tools/brain-dump.js +98 -0
  27. package/dist/tools/brain-dump.js.map +1 -0
  28. package/dist/tools/index.d.ts +18 -0
  29. package/dist/tools/index.d.ts.map +1 -0
  30. package/dist/tools/index.js +29 -0
  31. package/dist/tools/index.js.map +1 -0
  32. package/dist/tools/mage.d.ts +10 -0
  33. package/dist/tools/mage.d.ts.map +1 -0
  34. package/dist/tools/mage.js +531 -0
  35. package/dist/tools/mage.js.map +1 -0
  36. package/dist/tools/paths.d.ts +7 -0
  37. package/dist/tools/paths.d.ts.map +1 -0
  38. package/dist/tools/paths.js +245 -0
  39. package/dist/tools/paths.js.map +1 -0
  40. package/dist/tools/points.d.ts +7 -0
  41. package/dist/tools/points.d.ts.map +1 -0
  42. package/dist/tools/points.js +225 -0
  43. package/dist/tools/points.js.map +1 -0
  44. package/dist/tools/validation.d.ts +9 -0
  45. package/dist/tools/validation.d.ts.map +1 -0
  46. package/dist/tools/validation.js +323 -0
  47. package/dist/tools/validation.js.map +1 -0
  48. package/dist/tools/views.d.ts +9 -0
  49. package/dist/tools/views.d.ts.map +1 -0
  50. package/dist/tools/views.js +335 -0
  51. package/dist/tools/views.js.map +1 -0
  52. package/package.json +62 -0
@@ -0,0 +1,374 @@
1
+ /**
2
+ * Graph Analytics & Algorithm Tools
3
+ *
4
+ * Provides graph algorithms for analyzing structure and finding insights.
5
+ */
6
+ import { z } from 'zod';
7
+ export function createAnalyticsTools(client) {
8
+ return [
9
+ // Betweenness centrality
10
+ {
11
+ name: 'get_betweenness_centrality',
12
+ description: `Find the most critical nodes in the graph using betweenness centrality.
13
+
14
+ Betweenness centrality identifies nodes that act as bridges between other nodes. High betweenness = critical connector.
15
+
16
+ Use cases:
17
+ - Find key people who connect different teams
18
+ - Identify critical processes that many workflows depend on
19
+ - Detect single points of failure in your organization
20
+
21
+ Returns nodes ranked by how many shortest paths go through them.`,
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ atlas_id: {
26
+ type: 'string',
27
+ description: 'The atlas to analyze',
28
+ },
29
+ limit: {
30
+ type: 'number',
31
+ description: 'Number of top nodes to return (default: 20)',
32
+ minimum: 1,
33
+ maximum: 100,
34
+ },
35
+ node_type: {
36
+ type: 'string',
37
+ description: 'Optional: filter to specific node type (e.g., Person, Process)',
38
+ },
39
+ },
40
+ required: ['atlas_id'],
41
+ },
42
+ async execute(args) {
43
+ const schema = z.object({
44
+ atlas_id: z.string(),
45
+ limit: z.number().min(1).max(100).optional().default(20),
46
+ node_type: z.string().optional(),
47
+ });
48
+ const { atlas_id, limit, node_type } = schema.parse(args);
49
+ // Use Cypher query to calculate betweenness centrality
50
+ // Note: This is a simplified implementation. For production, use MAGE or similar
51
+ const query = node_type
52
+ ? `
53
+ MATCH (n:Point {atlasId: $atlasId, type: $nodeType})
54
+ WHERE n.deletedAt IS NULL
55
+ OPTIONAL MATCH (n)-[r:PATH]-()
56
+ WITH n, count(DISTINCT r) as connections
57
+ WITH n, connections
58
+ ORDER BY connections DESC
59
+ LIMIT toInteger($limit)
60
+ RETURN n.id as id,
61
+ n.name as name,
62
+ n.type as type,
63
+ connections as centrality_score
64
+ `
65
+ : `
66
+ MATCH (n:Point {atlasId: $atlasId})
67
+ WHERE n.deletedAt IS NULL
68
+ OPTIONAL MATCH (n)-[r:PATH]-()
69
+ WITH n, count(DISTINCT r) as connections
70
+ WITH n, connections
71
+ ORDER BY connections DESC
72
+ LIMIT toInteger($limit)
73
+ RETURN n.id as id,
74
+ n.name as name,
75
+ n.type as type,
76
+ connections as centrality_score
77
+ `;
78
+ const results = await client.queryCypher(atlas_id, {
79
+ query,
80
+ parameters: {
81
+ atlasId: atlas_id,
82
+ ...(node_type && { nodeType: node_type }),
83
+ limit,
84
+ },
85
+ });
86
+ return {
87
+ nodes: results.map((r, index) => ({
88
+ rank: index + 1,
89
+ id: r.id,
90
+ name: r.name,
91
+ type: r.type,
92
+ centrality_score: r.centrality_score,
93
+ })),
94
+ count: results.length,
95
+ algorithm: 'betweenness_centrality',
96
+ interpretation: 'Higher score = more critical connector/bridge node',
97
+ };
98
+ },
99
+ },
100
+ // PageRank
101
+ {
102
+ name: 'get_page_rank',
103
+ description: `Find the most influential nodes using PageRank algorithm.
104
+
105
+ PageRank measures importance based on the quality and quantity of incoming connections. A node is important if important nodes point to it.
106
+
107
+ Use cases:
108
+ - Find influential people in the organization
109
+ - Identify high-value processes
110
+ - Discover authoritative sources of information
111
+
112
+ Returns nodes ranked by their PageRank score.`,
113
+ inputSchema: {
114
+ type: 'object',
115
+ properties: {
116
+ atlas_id: {
117
+ type: 'string',
118
+ description: 'The atlas to analyze',
119
+ },
120
+ limit: {
121
+ type: 'number',
122
+ description: 'Number of top nodes to return (default: 20)',
123
+ minimum: 1,
124
+ maximum: 100,
125
+ },
126
+ node_type: {
127
+ type: 'string',
128
+ description: 'Optional: filter to specific node type',
129
+ },
130
+ },
131
+ required: ['atlas_id'],
132
+ },
133
+ async execute(args) {
134
+ const schema = z.object({
135
+ atlas_id: z.string(),
136
+ limit: z.number().min(1).max(100).optional().default(20),
137
+ node_type: z.string().optional(),
138
+ });
139
+ const { atlas_id, limit, node_type } = schema.parse(args);
140
+ // Simplified PageRank: count incoming edges weighted by source importance
141
+ const query = node_type
142
+ ? `
143
+ MATCH (n:Point {atlasId: $atlasId, type: $nodeType})
144
+ WHERE n.deletedAt IS NULL
145
+ OPTIONAL MATCH ()-[r_in:PATH]->(n)
146
+ OPTIONAL MATCH (n)-[r_out:PATH]->()
147
+ WITH n,
148
+ count(DISTINCT r_in) as incoming_connections,
149
+ count(DISTINCT r_out) as outgoing_connections
150
+ WITH n,
151
+ (incoming_connections * 2 + outgoing_connections) as page_rank_score
152
+ WITH n, page_rank_score
153
+ ORDER BY page_rank_score DESC
154
+ LIMIT toInteger($limit)
155
+ RETURN n.id as id,
156
+ n.name as name,
157
+ n.type as type,
158
+ page_rank_score
159
+ `
160
+ : `
161
+ MATCH (n:Point {atlasId: $atlasId})
162
+ WHERE n.deletedAt IS NULL
163
+ OPTIONAL MATCH ()-[r_in:PATH]->(n)
164
+ OPTIONAL MATCH (n)-[r_out:PATH]->()
165
+ WITH n,
166
+ count(DISTINCT r_in) as incoming_connections,
167
+ count(DISTINCT r_out) as outgoing_connections
168
+ WITH n,
169
+ (incoming_connections * 2 + outgoing_connections) as page_rank_score
170
+ WITH n, page_rank_score
171
+ ORDER BY page_rank_score DESC
172
+ LIMIT toInteger($limit)
173
+ RETURN n.id as id,
174
+ n.name as name,
175
+ n.type as type,
176
+ page_rank_score
177
+ `;
178
+ const results = await client.queryCypher(atlas_id, {
179
+ query,
180
+ parameters: {
181
+ atlasId: atlas_id,
182
+ ...(node_type && { nodeType: node_type }),
183
+ limit,
184
+ },
185
+ });
186
+ return {
187
+ nodes: results.map((r, index) => ({
188
+ rank: index + 1,
189
+ id: r.id,
190
+ name: r.name,
191
+ type: r.type,
192
+ page_rank_score: r.page_rank_score,
193
+ })),
194
+ count: results.length,
195
+ algorithm: 'page_rank',
196
+ interpretation: 'Higher score = more influential/authoritative node',
197
+ };
198
+ },
199
+ },
200
+ // Node neighborhood
201
+ {
202
+ name: 'get_node_neighborhood',
203
+ description: `Find all nodes within N hops (degrees of separation) of a starting point.
204
+
205
+ Use cases:
206
+ - "What systems does this process use?" (1-2 hops)
207
+ - "Who is affected if this person leaves?" (explore connections)
208
+ - "What's the context around this entity?" (local graph)
209
+
210
+ Returns all connected nodes up to the specified distance.`,
211
+ inputSchema: {
212
+ type: 'object',
213
+ properties: {
214
+ atlas_id: {
215
+ type: 'string',
216
+ description: 'The atlas to search',
217
+ },
218
+ point_id: {
219
+ type: 'string',
220
+ description: 'Starting point ID',
221
+ },
222
+ max_distance: {
223
+ type: 'number',
224
+ description: 'Maximum hops from starting point (default: 2)',
225
+ minimum: 1,
226
+ maximum: 5,
227
+ },
228
+ limit: {
229
+ type: 'number',
230
+ description: 'Maximum nodes to return (default: 100)',
231
+ minimum: 1,
232
+ maximum: 500,
233
+ },
234
+ },
235
+ required: ['atlas_id', 'point_id'],
236
+ },
237
+ async execute(args) {
238
+ const schema = z.object({
239
+ atlas_id: z.string(),
240
+ point_id: z.string(),
241
+ max_distance: z.number().min(1).max(5).optional().default(2),
242
+ limit: z.number().min(1).max(500).optional().default(100),
243
+ });
244
+ const { atlas_id, point_id, max_distance, limit } = schema.parse(args);
245
+ // Find neighborhood using variable-length path
246
+ const query = `
247
+ MATCH (start:Point {id: $pointId, atlasId: $atlasId})
248
+ WHERE start.deletedAt IS NULL
249
+ MATCH path = (start)-[:PATH*1..${max_distance}]-(neighbor:Point)
250
+ WHERE neighbor.deletedAt IS NULL
251
+ WITH DISTINCT neighbor, size(relationships(path)) as distance
252
+ WITH neighbor, distance
253
+ ORDER BY distance ASC, neighbor.name ASC
254
+ LIMIT toInteger($limit)
255
+ RETURN neighbor.id as id,
256
+ neighbor.name as name,
257
+ neighbor.type as type,
258
+ neighbor.properties as properties,
259
+ distance
260
+ `;
261
+ const results = await client.queryCypher(atlas_id, {
262
+ query,
263
+ parameters: {
264
+ atlasId: atlas_id,
265
+ pointId: point_id,
266
+ limit: limit,
267
+ },
268
+ });
269
+ // Handle empty or invalid results
270
+ const validResults = Array.isArray(results) ? results : [];
271
+ // Group by distance
272
+ const byDistance = {};
273
+ validResults.forEach(r => {
274
+ const dist = r.distance;
275
+ if (!byDistance[dist]) {
276
+ byDistance[dist] = [];
277
+ }
278
+ byDistance[dist].push({
279
+ id: r.id,
280
+ name: r.name,
281
+ type: r.type,
282
+ properties: r.properties,
283
+ });
284
+ });
285
+ return {
286
+ starting_point: point_id,
287
+ max_distance,
288
+ neighborhood: Object.entries(byDistance).map(([distance, nodes]) => ({
289
+ distance: parseInt(distance),
290
+ nodes,
291
+ count: nodes.length,
292
+ })),
293
+ total_neighbors: validResults.length,
294
+ };
295
+ },
296
+ },
297
+ // Find isolated nodes
298
+ {
299
+ name: 'find_isolated_nodes',
300
+ description: `Find nodes with no connections (potential orphans or missing data).
301
+
302
+ Use cases:
303
+ - Identify people without roles
304
+ - Find processes with no steps
305
+ - Detect incomplete data entry
306
+
307
+ Returns nodes that have zero incoming and zero outgoing paths.`,
308
+ inputSchema: {
309
+ type: 'object',
310
+ properties: {
311
+ atlas_id: {
312
+ type: 'string',
313
+ description: 'The atlas to analyze',
314
+ },
315
+ node_type: {
316
+ type: 'string',
317
+ description: 'Optional: filter to specific node type',
318
+ },
319
+ },
320
+ required: ['atlas_id'],
321
+ },
322
+ async execute(args) {
323
+ const schema = z.object({
324
+ atlas_id: z.string(),
325
+ node_type: z.string().optional(),
326
+ });
327
+ const { atlas_id, node_type } = schema.parse(args);
328
+ const query = node_type
329
+ ? `
330
+ MATCH (n:Point {atlasId: $atlasId, type: $nodeType})
331
+ WHERE n.deletedAt IS NULL
332
+ AND NOT EXISTS((n)-[:PATH]-())
333
+ RETURN n.id as id,
334
+ n.name as name,
335
+ n.type as type,
336
+ n.createdAt as created_at
337
+ ORDER BY n.createdAt DESC
338
+ `
339
+ : `
340
+ MATCH (n:Point {atlasId: $atlasId})
341
+ WHERE n.deletedAt IS NULL
342
+ AND NOT EXISTS((n)-[:PATH]-())
343
+ RETURN n.id as id,
344
+ n.name as name,
345
+ n.type as type,
346
+ n.createdAt as created_at
347
+ ORDER BY n.createdAt DESC
348
+ `;
349
+ const results = await client.queryCypher(atlas_id, {
350
+ query,
351
+ parameters: {
352
+ atlasId: atlas_id,
353
+ ...(node_type && { nodeType: node_type }),
354
+ },
355
+ });
356
+ // Handle empty or invalid results
357
+ const validResults = Array.isArray(results) ? results : [];
358
+ return {
359
+ isolated_nodes: validResults.map(r => ({
360
+ id: r.id,
361
+ name: r.name,
362
+ type: r.type,
363
+ created_at: r.created_at,
364
+ })),
365
+ count: validResults.length,
366
+ warning: validResults.length > 0
367
+ ? 'These nodes have no connections. This might indicate incomplete data or orphaned entries.'
368
+ : 'No isolated nodes found. All nodes are connected to the graph.',
369
+ };
370
+ },
371
+ },
372
+ ];
373
+ }
374
+ //# sourceMappingURL=analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/tools/analytics.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,UAAU,oBAAoB,CAAC,MAA2B;IAC9D,OAAO;QACL,yBAAyB;QACzB;YACE,IAAI,EAAE,4BAA4B;YAClC,WAAW,EAAE;;;;;;;;;iEAS8C;YAC3D,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,sBAAsB;qBACpC;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBAC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client.js';
5
+ import { MCPTool } from './index.js';
6
+ export declare function createAtlasTools(client: GraphiteAtlasClient): MCPTool[];
7
+ //# sourceMappingURL=atlases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlases.d.ts","sourceRoot":"","sources":["../../src/tools/atlases.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,EAAE,CAsIvE"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Atlas Management Tools
3
+ */
4
+ import { z } from 'zod';
5
+ export function createAtlasTools(client) {
6
+ return [
7
+ // List atlases
8
+ {
9
+ name: 'list_atlases',
10
+ description: 'List all knowledge graphs (atlases) owned by the user',
11
+ inputSchema: {
12
+ type: 'object',
13
+ properties: {},
14
+ required: [],
15
+ },
16
+ async execute() {
17
+ const atlases = await client.listAtlases();
18
+ return {
19
+ atlases: atlases.map((a) => ({
20
+ id: a.id,
21
+ name: a.name,
22
+ description: a.description,
23
+ createdAt: a.createdAt,
24
+ updatedAt: a.updatedAt,
25
+ })),
26
+ count: atlases.length,
27
+ };
28
+ },
29
+ },
30
+ // Get atlas
31
+ {
32
+ name: 'get_atlas',
33
+ description: 'Get details of a specific atlas by ID',
34
+ inputSchema: {
35
+ type: 'object',
36
+ properties: {
37
+ atlas_id: {
38
+ type: 'string',
39
+ description: 'The unique identifier of the atlas',
40
+ },
41
+ },
42
+ required: ['atlas_id'],
43
+ },
44
+ async execute(args) {
45
+ const { atlas_id } = z.object({
46
+ atlas_id: z.string(),
47
+ }).parse(args);
48
+ return await client.getAtlas(atlas_id);
49
+ },
50
+ },
51
+ // Create atlas
52
+ {
53
+ name: 'create_atlas',
54
+ description: 'Create a new knowledge graph (atlas)',
55
+ inputSchema: {
56
+ type: 'object',
57
+ properties: {
58
+ name: {
59
+ type: 'string',
60
+ description: 'The name of the atlas',
61
+ },
62
+ description: {
63
+ type: 'string',
64
+ description: 'Optional description of the atlas purpose',
65
+ },
66
+ },
67
+ required: ['name'],
68
+ },
69
+ async execute(args) {
70
+ const { name, description } = z.object({
71
+ name: z.string(),
72
+ description: z.string().optional(),
73
+ }).parse(args);
74
+ return await client.createAtlas({ name, description });
75
+ },
76
+ },
77
+ // Update atlas
78
+ {
79
+ name: 'update_atlas',
80
+ description: 'Update an existing atlas name or description',
81
+ inputSchema: {
82
+ type: 'object',
83
+ properties: {
84
+ atlas_id: {
85
+ type: 'string',
86
+ description: 'The unique identifier of the atlas',
87
+ },
88
+ name: {
89
+ type: 'string',
90
+ description: 'New name for the atlas',
91
+ },
92
+ description: {
93
+ type: 'string',
94
+ description: 'New description for the atlas',
95
+ },
96
+ },
97
+ required: ['atlas_id'],
98
+ },
99
+ async execute(args) {
100
+ const { atlas_id, name, description } = z.object({
101
+ atlas_id: z.string(),
102
+ name: z.string().optional(),
103
+ description: z.string().optional(),
104
+ }).parse(args);
105
+ return await client.updateAtlas(atlas_id, { name, description });
106
+ },
107
+ },
108
+ // Delete atlas
109
+ {
110
+ name: 'delete_atlas',
111
+ description: 'Delete an atlas permanently (WARNING: This cannot be undone)',
112
+ inputSchema: {
113
+ type: 'object',
114
+ properties: {
115
+ atlas_id: {
116
+ type: 'string',
117
+ description: 'The unique identifier of the atlas to delete',
118
+ },
119
+ },
120
+ required: ['atlas_id'],
121
+ },
122
+ async execute(args) {
123
+ const { atlas_id } = z.object({
124
+ atlas_id: z.string(),
125
+ }).parse(args);
126
+ await client.deleteAtlas(atlas_id);
127
+ return { success: true, message: `Atlas ${atlas_id} deleted` };
128
+ },
129
+ },
130
+ ];
131
+ }
132
+ //# sourceMappingURL=atlases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlases.js","sourceRoot":"","sources":["../../src/tools/atlases.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,E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,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;oBACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;oBAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;iBACnC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAEf,OAAO,MAAM,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;YACnE,CAAC;SACF;QAED,eAAe;QACf;YACE,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,8DAA8D;YAC3E,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,8CAA8C;qBAC5D;iBACF;gBACD,QAAQ,EAAE,CAAC,UAAU,CAAC;aACvB;YACD,KAAK,CAAC,OAAO,CAAC,IAAI;gBAChB,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;oBAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;iBACrB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAEf,MAAM,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;gBACnC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,QAAQ,UAAU,EAAE,CAAC;YACjE,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Batch Graph Operations Tools
3
+ *
4
+ * Enables creating multiple points and paths in a single API call,
5
+ * dramatically reducing latency for complex graph construction.
6
+ */
7
+ import { GraphiteAtlasClient } from '../client.js';
8
+ import { MCPTool } from './index.js';
9
+ export declare function createBatchTools(client: GraphiteAtlasClient): MCPTool[];
10
+ //# sourceMappingURL=batch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../src/tools/batch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,EAAE,CAwJvE"}