@littlebearapps/australian-history-mcp 0.6.0 → 0.6.1
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/package.json +1 -1
- package/dist/clients/datagovau_client.d.ts +0 -61
- package/dist/clients/datagovau_client.d.ts.map +0 -1
- package/dist/clients/datagovau_client.js +0 -421
- package/dist/clients/datagovau_client.js.map +0 -1
- package/dist/clients/prov_client.d.ts +0 -64
- package/dist/clients/prov_client.d.ts.map +0 -1
- package/dist/clients/prov_client.js +0 -393
- package/dist/clients/prov_client.js.map +0 -1
- package/dist/clients/trove_client.d.ts +0 -77
- package/dist/clients/trove_client.d.ts.map +0 -1
- package/dist/clients/trove_client.js +0 -374
- package/dist/clients/trove_client.js.map +0 -1
- package/dist/tools/datagovau_browse.d.ts +0 -96
- package/dist/tools/datagovau_browse.d.ts.map +0 -1
- package/dist/tools/datagovau_browse.js +0 -297
- package/dist/tools/datagovau_browse.js.map +0 -1
- package/dist/tools/datagovau_dataset.d.ts +0 -79
- package/dist/tools/datagovau_dataset.d.ts.map +0 -1
- package/dist/tools/datagovau_dataset.js +0 -246
- package/dist/tools/datagovau_dataset.js.map +0 -1
- package/dist/tools/datagovau_search.d.ts +0 -58
- package/dist/tools/datagovau_search.d.ts.map +0 -1
- package/dist/tools/datagovau_search.js +0 -112
- package/dist/tools/datagovau_search.js.map +0 -1
- package/dist/tools/harvest.d.ts +0 -175
- package/dist/tools/harvest.d.ts.map +0 -1
- package/dist/tools/harvest.js +0 -426
- package/dist/tools/harvest.js.map +0 -1
- package/dist/tools/prov_images.d.ts +0 -38
- package/dist/tools/prov_images.d.ts.map +0 -1
- package/dist/tools/prov_images.js +0 -87
- package/dist/tools/prov_images.js.map +0 -1
- package/dist/tools/prov_search.d.ts +0 -60
- package/dist/tools/prov_search.d.ts.map +0 -1
- package/dist/tools/prov_search.js +0 -131
- package/dist/tools/prov_search.js.map +0 -1
- package/dist/tools/trove_newspaper.d.ts +0 -100
- package/dist/tools/trove_newspaper.d.ts.map +0 -1
- package/dist/tools/trove_newspaper.js +0 -282
- package/dist/tools/trove_newspaper.js.map +0 -1
- package/dist/tools/trove_search.d.ts +0 -62
- package/dist/tools/trove_search.d.ts.map +0 -1
- package/dist/tools/trove_search.js +0 -143
- package/dist/tools/trove_search.js.map +0 -1
- package/dist/types.d.ts +0 -231
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -5
- package/dist/types.js.map +0 -1
package/dist/tools/harvest.js
DELETED
|
@@ -1,426 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Harvest Tools - Bulk download records from PROV, Trove, and data.gov.au
|
|
3
|
-
*/
|
|
4
|
-
import { provClient } from '../clients/prov_client.js';
|
|
5
|
-
import { createTroveClient } from '../clients/trove_client.js';
|
|
6
|
-
import { dataGovAUClient } from '../clients/datagovau_client.js';
|
|
7
|
-
// ============================================================================
|
|
8
|
-
// PROV Harvest
|
|
9
|
-
// ============================================================================
|
|
10
|
-
export const provHarvestSchema = {
|
|
11
|
-
name: 'prov_harvest',
|
|
12
|
-
description: `Bulk download records from the PROV (Public Record Office Victoria) collection.
|
|
13
|
-
|
|
14
|
-
Use this for batch harvesting of:
|
|
15
|
-
- Historical photographs
|
|
16
|
-
- Maps and plans
|
|
17
|
-
- Government files and records
|
|
18
|
-
- Council meeting minutes
|
|
19
|
-
|
|
20
|
-
Returns paginated results for large datasets.`,
|
|
21
|
-
inputSchema: {
|
|
22
|
-
type: 'object',
|
|
23
|
-
properties: {
|
|
24
|
-
query: {
|
|
25
|
-
type: 'string',
|
|
26
|
-
description: 'Search text',
|
|
27
|
-
},
|
|
28
|
-
series: {
|
|
29
|
-
type: 'string',
|
|
30
|
-
description: 'VPRS series number',
|
|
31
|
-
},
|
|
32
|
-
agency: {
|
|
33
|
-
type: 'string',
|
|
34
|
-
description: 'VA agency number',
|
|
35
|
-
},
|
|
36
|
-
recordForm: {
|
|
37
|
-
type: 'string',
|
|
38
|
-
description: 'Type of record (e.g., "Photograph or Image", "File", "Volume")',
|
|
39
|
-
enum: [
|
|
40
|
-
'Photograph or Image',
|
|
41
|
-
'Map, Plan, or Drawing',
|
|
42
|
-
'File',
|
|
43
|
-
'Volume',
|
|
44
|
-
'Document',
|
|
45
|
-
'Card',
|
|
46
|
-
'Object',
|
|
47
|
-
'Moving Image',
|
|
48
|
-
'Sound Recording',
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
dateFrom: {
|
|
52
|
-
type: 'string',
|
|
53
|
-
description: 'Start date (YYYY-MM-DD)',
|
|
54
|
-
},
|
|
55
|
-
dateTo: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: 'End date (YYYY-MM-DD)',
|
|
58
|
-
},
|
|
59
|
-
digitisedOnly: {
|
|
60
|
-
type: 'boolean',
|
|
61
|
-
description: 'Only digitised records',
|
|
62
|
-
default: false,
|
|
63
|
-
},
|
|
64
|
-
maxRecords: {
|
|
65
|
-
type: 'number',
|
|
66
|
-
description: 'Maximum records to harvest (1-1000)',
|
|
67
|
-
default: 100,
|
|
68
|
-
},
|
|
69
|
-
startFrom: {
|
|
70
|
-
type: 'number',
|
|
71
|
-
description: 'Offset for pagination',
|
|
72
|
-
default: 0,
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
required: [],
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
export async function executePROVHarvest(input) {
|
|
79
|
-
try {
|
|
80
|
-
if (!input.query && !input.series && !input.agency) {
|
|
81
|
-
return {
|
|
82
|
-
content: [{
|
|
83
|
-
type: 'text',
|
|
84
|
-
text: JSON.stringify({
|
|
85
|
-
error: 'At least one of query, series, or agency is required',
|
|
86
|
-
}),
|
|
87
|
-
}],
|
|
88
|
-
isError: true,
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
const maxRecords = Math.min(input.maxRecords ?? 100, 1000);
|
|
92
|
-
const batchSize = 100;
|
|
93
|
-
let start = input.startFrom ?? 0;
|
|
94
|
-
const allRecords = [];
|
|
95
|
-
let totalAvailable = 0;
|
|
96
|
-
// Harvest in batches
|
|
97
|
-
while (allRecords.length < maxRecords) {
|
|
98
|
-
const remaining = maxRecords - allRecords.length;
|
|
99
|
-
const rows = Math.min(batchSize, remaining);
|
|
100
|
-
const result = await provClient.search({
|
|
101
|
-
query: input.query,
|
|
102
|
-
series: input.series,
|
|
103
|
-
agency: input.agency,
|
|
104
|
-
recordForm: input.recordForm,
|
|
105
|
-
startDate: input.dateFrom,
|
|
106
|
-
endDate: input.dateTo,
|
|
107
|
-
digitisedOnly: input.digitisedOnly ?? false,
|
|
108
|
-
rows,
|
|
109
|
-
start,
|
|
110
|
-
});
|
|
111
|
-
totalAvailable = result.totalResults;
|
|
112
|
-
allRecords.push(...result.records);
|
|
113
|
-
// Stop if no more results
|
|
114
|
-
if (result.records.length < rows) {
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
start += rows;
|
|
118
|
-
}
|
|
119
|
-
const hasMore = allRecords.length < totalAvailable;
|
|
120
|
-
const nextOffset = hasMore ? start.toString() : undefined;
|
|
121
|
-
return {
|
|
122
|
-
content: [{
|
|
123
|
-
type: 'text',
|
|
124
|
-
text: JSON.stringify({
|
|
125
|
-
source: 'prov',
|
|
126
|
-
harvested: allRecords.length,
|
|
127
|
-
totalAvailable,
|
|
128
|
-
hasMore,
|
|
129
|
-
nextOffset,
|
|
130
|
-
records: allRecords.map((r) => ({
|
|
131
|
-
id: r.id,
|
|
132
|
-
title: r.title,
|
|
133
|
-
series: r.series,
|
|
134
|
-
agency: r.agency,
|
|
135
|
-
recordForm: r.recordForm,
|
|
136
|
-
dateRange: r.startDate && r.endDate
|
|
137
|
-
? `${r.startDate} - ${r.endDate}`
|
|
138
|
-
: r.startDate || r.endDate,
|
|
139
|
-
digitised: r.digitised,
|
|
140
|
-
url: r.url,
|
|
141
|
-
})),
|
|
142
|
-
}, null, 2),
|
|
143
|
-
}],
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
return {
|
|
148
|
-
content: [{
|
|
149
|
-
type: 'text',
|
|
150
|
-
text: JSON.stringify({
|
|
151
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
152
|
-
}),
|
|
153
|
-
}],
|
|
154
|
-
isError: true,
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
// ============================================================================
|
|
159
|
-
// Trove Harvest
|
|
160
|
-
// ============================================================================
|
|
161
|
-
export const troveHarvestSchema = {
|
|
162
|
-
name: 'trove_harvest',
|
|
163
|
-
description: `Bulk download records from Trove (National Library of Australia).
|
|
164
|
-
|
|
165
|
-
Use this for batch harvesting of:
|
|
166
|
-
- Newspaper articles for a topic/date range
|
|
167
|
-
- Historical images and maps
|
|
168
|
-
- Government publications
|
|
169
|
-
- Research materials
|
|
170
|
-
|
|
171
|
-
Uses stable cursor-based pagination for reliable harvesting.`,
|
|
172
|
-
inputSchema: {
|
|
173
|
-
type: 'object',
|
|
174
|
-
properties: {
|
|
175
|
-
query: {
|
|
176
|
-
type: 'string',
|
|
177
|
-
description: 'Search terms',
|
|
178
|
-
},
|
|
179
|
-
category: {
|
|
180
|
-
type: 'string',
|
|
181
|
-
description: 'Content category',
|
|
182
|
-
enum: ['all', 'newspaper', 'gazette', 'magazine', 'image', 'book', 'diary', 'music', 'research'],
|
|
183
|
-
default: 'all',
|
|
184
|
-
},
|
|
185
|
-
state: {
|
|
186
|
-
type: 'string',
|
|
187
|
-
description: 'Filter by state (newspapers)',
|
|
188
|
-
enum: ['vic', 'nsw', 'qld', 'sa', 'wa', 'tas', 'nt', 'act', 'national'],
|
|
189
|
-
},
|
|
190
|
-
dateFrom: {
|
|
191
|
-
type: 'string',
|
|
192
|
-
description: 'Start date (YYYY)',
|
|
193
|
-
},
|
|
194
|
-
dateTo: {
|
|
195
|
-
type: 'string',
|
|
196
|
-
description: 'End date (YYYY)',
|
|
197
|
-
},
|
|
198
|
-
format: {
|
|
199
|
-
type: 'string',
|
|
200
|
-
description: 'Format filter (e.g., "Photograph", "Map")',
|
|
201
|
-
},
|
|
202
|
-
maxRecords: {
|
|
203
|
-
type: 'number',
|
|
204
|
-
description: 'Maximum records to harvest (1-1000)',
|
|
205
|
-
default: 100,
|
|
206
|
-
},
|
|
207
|
-
cursor: {
|
|
208
|
-
type: 'string',
|
|
209
|
-
description: 'Pagination cursor from previous harvest',
|
|
210
|
-
},
|
|
211
|
-
includeFullText: {
|
|
212
|
-
type: 'boolean',
|
|
213
|
-
description: 'Include article text (newspapers only)',
|
|
214
|
-
default: false,
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
required: ['query'],
|
|
218
|
-
},
|
|
219
|
-
};
|
|
220
|
-
export async function executeTroveHarvest(input) {
|
|
221
|
-
try {
|
|
222
|
-
const client = createTroveClient();
|
|
223
|
-
if (!client.hasApiKey()) {
|
|
224
|
-
return {
|
|
225
|
-
content: [{
|
|
226
|
-
type: 'text',
|
|
227
|
-
text: JSON.stringify({
|
|
228
|
-
error: 'TROVE_API_KEY not configured',
|
|
229
|
-
}),
|
|
230
|
-
}],
|
|
231
|
-
isError: true,
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
const maxRecords = Math.min(input.maxRecords ?? 100, 1000);
|
|
235
|
-
const batchSize = 100; // Trove max per request
|
|
236
|
-
let cursor = input.cursor ?? '*';
|
|
237
|
-
const allRecords = [];
|
|
238
|
-
let totalAvailable = 0;
|
|
239
|
-
// Harvest in batches using bulk harvest mode
|
|
240
|
-
while (allRecords.length < maxRecords) {
|
|
241
|
-
const remaining = maxRecords - allRecords.length;
|
|
242
|
-
const limit = Math.min(batchSize, remaining);
|
|
243
|
-
const result = await client.search({
|
|
244
|
-
query: input.query,
|
|
245
|
-
category: input.category ?? 'all',
|
|
246
|
-
state: input.state,
|
|
247
|
-
dateFrom: input.dateFrom,
|
|
248
|
-
dateTo: input.dateTo,
|
|
249
|
-
format: input.format,
|
|
250
|
-
limit,
|
|
251
|
-
start: cursor,
|
|
252
|
-
bulkHarvest: true,
|
|
253
|
-
includeFullText: input.includeFullText,
|
|
254
|
-
});
|
|
255
|
-
totalAvailable = result.totalResults;
|
|
256
|
-
allRecords.push(...result.records);
|
|
257
|
-
// Stop if no more results or no next cursor
|
|
258
|
-
if (!result.nextStart || result.records.length < limit) {
|
|
259
|
-
cursor = result.nextStart ?? '';
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
-
cursor = result.nextStart;
|
|
263
|
-
}
|
|
264
|
-
const hasMore = allRecords.length < totalAvailable;
|
|
265
|
-
const nextCursor = cursor && hasMore ? cursor : undefined;
|
|
266
|
-
return {
|
|
267
|
-
content: [{
|
|
268
|
-
type: 'text',
|
|
269
|
-
text: JSON.stringify({
|
|
270
|
-
source: 'trove',
|
|
271
|
-
harvested: allRecords.length,
|
|
272
|
-
totalAvailable,
|
|
273
|
-
hasMore,
|
|
274
|
-
nextCursor,
|
|
275
|
-
records: allRecords.map((r) => {
|
|
276
|
-
if ('heading' in r) {
|
|
277
|
-
return {
|
|
278
|
-
type: 'article',
|
|
279
|
-
id: r.id,
|
|
280
|
-
heading: r.heading,
|
|
281
|
-
newspaper: r.title,
|
|
282
|
-
date: r.date,
|
|
283
|
-
url: r.troveUrl,
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
else {
|
|
287
|
-
return {
|
|
288
|
-
type: 'work',
|
|
289
|
-
id: r.id,
|
|
290
|
-
title: r.title,
|
|
291
|
-
format: r.type,
|
|
292
|
-
issued: r.issued,
|
|
293
|
-
url: r.troveUrl,
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
}),
|
|
297
|
-
}, null, 2),
|
|
298
|
-
}],
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
catch (error) {
|
|
302
|
-
return {
|
|
303
|
-
content: [{
|
|
304
|
-
type: 'text',
|
|
305
|
-
text: JSON.stringify({
|
|
306
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
307
|
-
}),
|
|
308
|
-
}],
|
|
309
|
-
isError: true,
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
// ============================================================================
|
|
314
|
-
// data.gov.au Harvest
|
|
315
|
-
// ============================================================================
|
|
316
|
-
export const dataGovAUHarvestSchema = {
|
|
317
|
-
name: 'datagovau_harvest',
|
|
318
|
-
description: `Bulk download dataset metadata from data.gov.au.
|
|
319
|
-
|
|
320
|
-
Use this for batch harvesting of:
|
|
321
|
-
- Dataset metadata from specific organisations
|
|
322
|
-
- Datasets matching search criteria
|
|
323
|
-
- Datasets with specific formats or tags
|
|
324
|
-
|
|
325
|
-
Returns paginated results for large datasets.`,
|
|
326
|
-
inputSchema: {
|
|
327
|
-
type: 'object',
|
|
328
|
-
properties: {
|
|
329
|
-
query: {
|
|
330
|
-
type: 'string',
|
|
331
|
-
description: 'Search keywords',
|
|
332
|
-
},
|
|
333
|
-
organization: {
|
|
334
|
-
type: 'string',
|
|
335
|
-
description: 'Filter by organisation slug',
|
|
336
|
-
},
|
|
337
|
-
format: {
|
|
338
|
-
type: 'string',
|
|
339
|
-
description: 'Filter by resource format (e.g., "CSV", "JSON")',
|
|
340
|
-
},
|
|
341
|
-
tags: {
|
|
342
|
-
type: 'array',
|
|
343
|
-
items: { type: 'string' },
|
|
344
|
-
description: 'Filter by tags',
|
|
345
|
-
},
|
|
346
|
-
maxRecords: {
|
|
347
|
-
type: 'number',
|
|
348
|
-
description: 'Maximum datasets to harvest (1-1000)',
|
|
349
|
-
default: 100,
|
|
350
|
-
},
|
|
351
|
-
startFrom: {
|
|
352
|
-
type: 'number',
|
|
353
|
-
description: 'Offset for pagination',
|
|
354
|
-
default: 0,
|
|
355
|
-
},
|
|
356
|
-
},
|
|
357
|
-
required: [],
|
|
358
|
-
},
|
|
359
|
-
};
|
|
360
|
-
export async function executeDataGovAUHarvest(input) {
|
|
361
|
-
try {
|
|
362
|
-
const maxRecords = Math.min(input.maxRecords ?? 100, 1000);
|
|
363
|
-
const batchSize = 100;
|
|
364
|
-
let offset = input.startFrom ?? 0;
|
|
365
|
-
const allDatasets = [];
|
|
366
|
-
let totalAvailable = 0;
|
|
367
|
-
// Harvest in batches
|
|
368
|
-
while (allDatasets.length < maxRecords) {
|
|
369
|
-
const remaining = maxRecords - allDatasets.length;
|
|
370
|
-
const limit = Math.min(batchSize, remaining);
|
|
371
|
-
const result = await dataGovAUClient.search({
|
|
372
|
-
query: input.query,
|
|
373
|
-
organization: input.organization,
|
|
374
|
-
format: input.format,
|
|
375
|
-
tags: input.tags,
|
|
376
|
-
limit,
|
|
377
|
-
offset,
|
|
378
|
-
sort: 'metadata_modified desc',
|
|
379
|
-
});
|
|
380
|
-
totalAvailable = result.count;
|
|
381
|
-
allDatasets.push(...result.datasets);
|
|
382
|
-
// Stop if no more results
|
|
383
|
-
if (result.datasets.length < limit) {
|
|
384
|
-
break;
|
|
385
|
-
}
|
|
386
|
-
offset += limit;
|
|
387
|
-
}
|
|
388
|
-
const hasMore = allDatasets.length < totalAvailable;
|
|
389
|
-
const nextOffset = hasMore ? offset : undefined;
|
|
390
|
-
return {
|
|
391
|
-
content: [{
|
|
392
|
-
type: 'text',
|
|
393
|
-
text: JSON.stringify({
|
|
394
|
-
source: 'datagovau',
|
|
395
|
-
harvested: allDatasets.length,
|
|
396
|
-
totalAvailable,
|
|
397
|
-
hasMore,
|
|
398
|
-
nextOffset,
|
|
399
|
-
datasets: allDatasets.map((d) => ({
|
|
400
|
-
id: d.id,
|
|
401
|
-
name: d.name,
|
|
402
|
-
title: d.title,
|
|
403
|
-
organization: d.organization?.title,
|
|
404
|
-
resourceCount: d.resources?.length ?? 0,
|
|
405
|
-
formats: [...new Set((d.resources ?? []).map((r) => r.format))],
|
|
406
|
-
license: d.licenseTitle || d.licenseId,
|
|
407
|
-
modified: d.metadataModified,
|
|
408
|
-
url: `https://data.gov.au/dataset/${d.name}`,
|
|
409
|
-
})),
|
|
410
|
-
}, null, 2),
|
|
411
|
-
}],
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
catch (error) {
|
|
415
|
-
return {
|
|
416
|
-
content: [{
|
|
417
|
-
type: 'text',
|
|
418
|
-
text: JSON.stringify({
|
|
419
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
420
|
-
}),
|
|
421
|
-
}],
|
|
422
|
-
isError: true,
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
//# sourceMappingURL=harvest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"harvest.js","sourceRoot":"","sources":["../../src/tools/harvest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE;;;;;;;;8CAQ+B;IAC5C,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,aAAa;aAC3B;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oBAAoB;aAClC;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kBAAkB;aAChC;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gEAAgE;gBAC7E,IAAI,EAAE;oBACJ,qBAAqB;oBACrB,uBAAuB;oBACvB,MAAM;oBACN,QAAQ;oBACR,UAAU;oBACV,MAAM;oBACN,QAAQ;oBACR,cAAc;oBACd,iBAAiB;iBAClB;aACF;YACD,QAAQ,EAAE;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CAAC,CAAC;4BACrC,EAAE,EAAE,CAAC,CAAC,EAAE;4BACR,IAAI,EAAE,CAAC,CAAC,IAAI;4BACZ,KAAK,EAAE,CAAC,CAAC,KAAK;4BACd,YAAY,EAAE,CAAC,CAAC,YAAY,EAAE,KAAK;4BACnC,aAAa,EAAE,CAAC,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC;4BACvC,OAAO,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;4BACpE,OAAO,EAAE,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,SAAS;4BACtC,QAAQ,EAAE,CAAC,CAAC,gBAAgB;4BAC5B,GAAG,EAAE,+BAA+B,CAAC,CAAC,IAAI,EAAE;yBAC7C,CAAC,CAAC;qBACJ,EAAE,IAAI,EAAE,CAAC,CAAC;iBACZ,CAAC;SACH,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;qBAChE,CAAC;iBACH,CAAC;YACF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PROV IIIF Image Extraction Tool
|
|
3
|
-
*
|
|
4
|
-
* Fetches and parses IIIF manifests from PROV to extract
|
|
5
|
-
* downloadable image URLs in different sizes.
|
|
6
|
-
*/
|
|
7
|
-
import type { MCPToolResponse } from '../types.js';
|
|
8
|
-
export declare const provGetImagesSchema: {
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
inputSchema: {
|
|
12
|
-
type: string;
|
|
13
|
-
properties: {
|
|
14
|
-
manifestUrl: {
|
|
15
|
-
type: string;
|
|
16
|
-
description: string;
|
|
17
|
-
};
|
|
18
|
-
pages: {
|
|
19
|
-
type: string;
|
|
20
|
-
description: string;
|
|
21
|
-
};
|
|
22
|
-
size: {
|
|
23
|
-
type: string;
|
|
24
|
-
enum: string[];
|
|
25
|
-
description: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
required: string[];
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
interface PROVGetImagesArgs {
|
|
32
|
-
manifestUrl: string;
|
|
33
|
-
pages?: string;
|
|
34
|
-
size?: 'thumbnail' | 'medium' | 'full' | 'all';
|
|
35
|
-
}
|
|
36
|
-
export declare function executePROVGetImages(args: PROVGetImagesArgs): Promise<MCPToolResponse>;
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=prov_images.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prov_images.d.ts","sourceRoot":"","sources":["../../src/tools/prov_images.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAOnD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;CA4B/B,CAAC;AAMF,UAAU,iBAAiB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;CAChD;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,eAAe,CAAC,CAgD1B"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PROV IIIF Image Extraction Tool
|
|
3
|
-
*
|
|
4
|
-
* Fetches and parses IIIF manifests from PROV to extract
|
|
5
|
-
* downloadable image URLs in different sizes.
|
|
6
|
-
*/
|
|
7
|
-
import { provClient } from '../clients/prov_client.js';
|
|
8
|
-
// ============================================================================
|
|
9
|
-
// Tool Schema
|
|
10
|
-
// ============================================================================
|
|
11
|
-
export const provGetImagesSchema = {
|
|
12
|
-
name: 'prov_get_images',
|
|
13
|
-
description: `Extract image URLs from a PROV digitised record.
|
|
14
|
-
|
|
15
|
-
Fetches the IIIF manifest and returns downloadable URLs for each page
|
|
16
|
-
in three sizes: thumbnail (200px), medium (800px), and full resolution.
|
|
17
|
-
|
|
18
|
-
Returns URLs that can be opened directly in a browser or downloaded.
|
|
19
|
-
Use the 'pages' parameter to limit which pages are returned.`,
|
|
20
|
-
inputSchema: {
|
|
21
|
-
type: 'object',
|
|
22
|
-
properties: {
|
|
23
|
-
manifestUrl: {
|
|
24
|
-
type: 'string',
|
|
25
|
-
description: 'The IIIF manifest URL from a PROV search result (iiifManifest field)',
|
|
26
|
-
},
|
|
27
|
-
pages: {
|
|
28
|
-
type: 'string',
|
|
29
|
-
description: 'Optional page filter. Examples: "1-5" for pages 1-5, "1,3,7" for specific pages, "1-3,7,10-12" for mixed ranges',
|
|
30
|
-
},
|
|
31
|
-
size: {
|
|
32
|
-
type: 'string',
|
|
33
|
-
enum: ['thumbnail', 'medium', 'full', 'all'],
|
|
34
|
-
description: 'Which size URLs to return. Default: "all"',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
required: ['manifestUrl'],
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
export async function executePROVGetImages(args) {
|
|
41
|
-
try {
|
|
42
|
-
const result = await provClient.getImages(args.manifestUrl, {
|
|
43
|
-
pageRange: args.pages,
|
|
44
|
-
});
|
|
45
|
-
// Filter to requested size(s)
|
|
46
|
-
const size = args.size ?? 'all';
|
|
47
|
-
const images = result.images.map((img) => {
|
|
48
|
-
if (size === 'all') {
|
|
49
|
-
return img;
|
|
50
|
-
}
|
|
51
|
-
return {
|
|
52
|
-
page: img.page,
|
|
53
|
-
label: img.label,
|
|
54
|
-
url: img[size],
|
|
55
|
-
};
|
|
56
|
-
});
|
|
57
|
-
const output = {
|
|
58
|
-
source: 'prov',
|
|
59
|
-
manifestUrl: result.manifestUrl,
|
|
60
|
-
title: result.title,
|
|
61
|
-
description: result.description,
|
|
62
|
-
totalPages: result.totalPages,
|
|
63
|
-
returnedPages: images.length,
|
|
64
|
-
size: size,
|
|
65
|
-
images,
|
|
66
|
-
};
|
|
67
|
-
return {
|
|
68
|
-
content: [{
|
|
69
|
-
type: 'text',
|
|
70
|
-
text: JSON.stringify(output, null, 2),
|
|
71
|
-
}],
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
catch (error) {
|
|
75
|
-
return {
|
|
76
|
-
content: [{
|
|
77
|
-
type: 'text',
|
|
78
|
-
text: JSON.stringify({
|
|
79
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
80
|
-
manifestUrl: args.manifestUrl,
|
|
81
|
-
}),
|
|
82
|
-
}],
|
|
83
|
-
isError: true,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=prov_images.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prov_images.js","sourceRoot":"","sources":["../../src/tools/prov_images.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;;;;;;6DAM8C;IAC3D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sEAAsE;aACpF;YACD,KAAK,EAAE;gBACL,IAAI,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,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;iBACtC,CAAC;SACH,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;wBAC/D,WAAW,EAAE,IAAI,CAAC,WAAW;qBAC9B,CAAC;iBACH,CAAC;YACF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PROV Search Tool - Search the Public Record Office Victoria collection
|
|
3
|
-
*/
|
|
4
|
-
import type { MCPToolResponse } from '../types.js';
|
|
5
|
-
export declare const provSearchSchema: {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
inputSchema: {
|
|
9
|
-
type: "object";
|
|
10
|
-
properties: {
|
|
11
|
-
query: {
|
|
12
|
-
type: string;
|
|
13
|
-
description: string;
|
|
14
|
-
};
|
|
15
|
-
series: {
|
|
16
|
-
type: string;
|
|
17
|
-
description: string;
|
|
18
|
-
};
|
|
19
|
-
agency: {
|
|
20
|
-
type: string;
|
|
21
|
-
description: string;
|
|
22
|
-
};
|
|
23
|
-
recordForm: {
|
|
24
|
-
type: string;
|
|
25
|
-
description: string;
|
|
26
|
-
enum: string[];
|
|
27
|
-
};
|
|
28
|
-
dateFrom: {
|
|
29
|
-
type: string;
|
|
30
|
-
description: string;
|
|
31
|
-
};
|
|
32
|
-
dateTo: {
|
|
33
|
-
type: string;
|
|
34
|
-
description: string;
|
|
35
|
-
};
|
|
36
|
-
digitisedOnly: {
|
|
37
|
-
type: string;
|
|
38
|
-
description: string;
|
|
39
|
-
default: boolean;
|
|
40
|
-
};
|
|
41
|
-
limit: {
|
|
42
|
-
type: string;
|
|
43
|
-
description: string;
|
|
44
|
-
default: number;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
required: never[];
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
export declare function executePROVSearch(input: {
|
|
51
|
-
query?: string;
|
|
52
|
-
series?: string;
|
|
53
|
-
agency?: string;
|
|
54
|
-
recordForm?: string;
|
|
55
|
-
dateFrom?: string;
|
|
56
|
-
dateTo?: string;
|
|
57
|
-
digitisedOnly?: boolean;
|
|
58
|
-
limit?: number;
|
|
59
|
-
}): Promise<MCPToolResponse>;
|
|
60
|
-
//# sourceMappingURL=prov_search.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prov_search.d.ts","sourceRoot":"","sources":["../../src/tools/prov_search.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,aAAa,CAAC;AAErE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8D5B,CAAC;AAEF,wBAAsB,iBAAiB,CAAC,KAAK,EAAE;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,eAAe,CAAC,CAgE3B"}
|