@cyanheads/reliefweb-mcp-server 0.1.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/CLAUDE.md +391 -0
- package/Dockerfile +98 -0
- package/LICENSE +201 -0
- package/README.md +320 -0
- package/changelog/0.1.x/0.1.0.md +24 -0
- package/changelog/0.1.x/0.1.1.md +29 -0
- package/changelog/template.md +119 -0
- package/dist/config/server-config.d.ts +14 -0
- package/dist/config/server-config.d.ts.map +1 -0
- package/dist/config/server-config.js +19 -0
- package/dist/config/server-config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/prompts/definitions/crisis-briefing.prompt.d.ts +14 -0
- package/dist/mcp-server/prompts/definitions/crisis-briefing.prompt.d.ts.map +1 -0
- package/dist/mcp-server/prompts/definitions/crisis-briefing.prompt.js +62 -0
- package/dist/mcp-server/prompts/definitions/crisis-briefing.prompt.js.map +1 -0
- package/dist/mcp-server/resources/definitions/country.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/country.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/country.resource.js +30 -0
- package/dist/mcp-server/resources/definitions/country.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/disaster.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/disaster.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/disaster.resource.js +30 -0
- package/dist/mcp-server/resources/definitions/disaster.resource.js.map +1 -0
- package/dist/mcp-server/resources/definitions/report.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/report.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/report.resource.js +30 -0
- package/dist/mcp-server/resources/definitions/report.resource.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-country.tool.d.ts +35 -0
- package/dist/mcp-server/tools/definitions/get-country.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-country.tool.js +106 -0
- package/dist/mcp-server/tools/definitions/get-country.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-disaster.tool.d.ts +42 -0
- package/dist/mcp-server/tools/definitions/get-disaster.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-disaster.tool.js +127 -0
- package/dist/mcp-server/tools/definitions/get-disaster.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-report.tool.d.ts +30 -0
- package/dist/mcp-server/tools/definitions/get-report.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-report.tool.js +92 -0
- package/dist/mcp-server/tools/definitions/get-report.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/list-countries.tool.d.ts +20 -0
- package/dist/mcp-server/tools/definitions/list-countries.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/list-countries.tool.js +83 -0
- package/dist/mcp-server/tools/definitions/list-countries.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/list-sources.tool.d.ts +22 -0
- package/dist/mcp-server/tools/definitions/list-sources.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/list-sources.tool.js +82 -0
- package/dist/mcp-server/tools/definitions/list-sources.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-disasters.tool.d.ts +35 -0
- package/dist/mcp-server/tools/definitions/search-disasters.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-disasters.tool.js +163 -0
- package/dist/mcp-server/tools/definitions/search-disasters.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-jobs.tool.d.ts +32 -0
- package/dist/mcp-server/tools/definitions/search-jobs.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-jobs.tool.js +148 -0
- package/dist/mcp-server/tools/definitions/search-jobs.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-reports.tool.d.ts +40 -0
- package/dist/mcp-server/tools/definitions/search-reports.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-reports.tool.js +191 -0
- package/dist/mcp-server/tools/definitions/search-reports.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-training.tool.d.ts +35 -0
- package/dist/mcp-server/tools/definitions/search-training.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-training.tool.js +166 -0
- package/dist/mcp-server/tools/definitions/search-training.tool.js.map +1 -0
- package/dist/services/reliefweb/reliefweb-service.d.ts +103 -0
- package/dist/services/reliefweb/reliefweb-service.d.ts.map +1 -0
- package/dist/services/reliefweb/reliefweb-service.js +546 -0
- package/dist/services/reliefweb/reliefweb-service.js.map +1 -0
- package/dist/services/reliefweb/types.d.ts +345 -0
- package/dist/services/reliefweb/types.d.ts.map +1 -0
- package/dist/services/reliefweb/types.js +7 -0
- package/dist/services/reliefweb/types.js.map +1 -0
- package/package.json +78 -0
- package/server.json +111 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fetch a single ReliefWeb disaster record by ID with full details.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-disaster
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
export declare const reliefwebGetDisaster: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
id: z.ZodNumber;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
id: z.ZodNumber;
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
status: z.ZodOptional<z.ZodString>;
|
|
13
|
+
glide: z.ZodOptional<z.ZodString>;
|
|
14
|
+
dateEvent: z.ZodOptional<z.ZodString>;
|
|
15
|
+
dateCreated: z.ZodOptional<z.ZodString>;
|
|
16
|
+
primaryCountry: z.ZodOptional<z.ZodString>;
|
|
17
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
18
|
+
types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
primaryType: z.ZodOptional<z.ZodString>;
|
|
20
|
+
urlAlias: z.ZodOptional<z.ZodString>;
|
|
21
|
+
description: z.ZodOptional<z.ZodString>;
|
|
22
|
+
profileOverview: z.ZodOptional<z.ZodString>;
|
|
23
|
+
keyContent: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
24
|
+
title: z.ZodString;
|
|
25
|
+
url: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>>;
|
|
27
|
+
appealsResponsePlans: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
28
|
+
title: z.ZodString;
|
|
29
|
+
url: z.ZodString;
|
|
30
|
+
date: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>>>;
|
|
32
|
+
usefulLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
33
|
+
title: z.ZodString;
|
|
34
|
+
url: z.ZodString;
|
|
35
|
+
}, z.core.$strip>>>;
|
|
36
|
+
}, z.core.$strip>, readonly [{
|
|
37
|
+
readonly reason: "not_found";
|
|
38
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
39
|
+
readonly when: "No disaster found with the given ID.";
|
|
40
|
+
readonly recovery: "Verify the ID is a valid ReliefWeb numeric disaster ID from reliefweb_search_disasters results.";
|
|
41
|
+
}]>;
|
|
42
|
+
//# sourceMappingURL=get-disaster.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-disaster.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-disaster.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuH/B,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fetch a single ReliefWeb disaster record by ID with full details.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-disaster
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { getReliefWebService } from '../../../services/reliefweb/reliefweb-service.js';
|
|
8
|
+
export const reliefwebGetDisaster = tool('reliefweb_get_disaster', {
|
|
9
|
+
title: 'Get ReliefWeb Disaster',
|
|
10
|
+
description: 'Fetch a disaster record by ReliefWeb numeric ID including description, affected countries, GLIDE number, ' +
|
|
11
|
+
'profile overview, key content links, and active appeals or response plans. ' +
|
|
12
|
+
'Use after reliefweb_search_disasters to retrieve full details.',
|
|
13
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
14
|
+
input: z.object({
|
|
15
|
+
id: z
|
|
16
|
+
.number()
|
|
17
|
+
.int()
|
|
18
|
+
.positive()
|
|
19
|
+
.describe('ReliefWeb numeric disaster ID. Obtained from reliefweb_search_disasters results.'),
|
|
20
|
+
}),
|
|
21
|
+
output: z.object({
|
|
22
|
+
id: z.number().describe('ReliefWeb numeric disaster ID.'),
|
|
23
|
+
name: z.string().describe('Disaster name.'),
|
|
24
|
+
status: z.string().optional().describe('Disaster status (alert, current, past, archive).'),
|
|
25
|
+
glide: z.string().optional().describe('GLIDE number for cross-system correlation.'),
|
|
26
|
+
dateEvent: z.string().optional().describe('Event date (ISO 8601), when available.'),
|
|
27
|
+
dateCreated: z.string().optional().describe('ReliefWeb index date (ISO 8601).'),
|
|
28
|
+
primaryCountry: z.string().optional().describe('Primary affected country.'),
|
|
29
|
+
countries: z.array(z.string()).optional().describe('All countries tagged on this disaster.'),
|
|
30
|
+
types: z.array(z.string()).optional().describe('Disaster type names.'),
|
|
31
|
+
primaryType: z.string().optional().describe('Primary disaster type.'),
|
|
32
|
+
urlAlias: z.string().optional().describe('Canonical ReliefWeb URL for this disaster.'),
|
|
33
|
+
description: z.string().optional().describe('Full disaster description text.'),
|
|
34
|
+
profileOverview: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Profile overview text from the ReliefWeb editorial team.'),
|
|
38
|
+
keyContent: z
|
|
39
|
+
.array(z
|
|
40
|
+
.object({
|
|
41
|
+
title: z.string().describe('Link title.'),
|
|
42
|
+
url: z.string().describe('Link URL.'),
|
|
43
|
+
})
|
|
44
|
+
.describe('A curated key content link.'))
|
|
45
|
+
.optional()
|
|
46
|
+
.describe('Curated key content links from the ReliefWeb editorial team.'),
|
|
47
|
+
appealsResponsePlans: z
|
|
48
|
+
.array(z
|
|
49
|
+
.object({
|
|
50
|
+
title: z.string().describe('Appeal or response plan title.'),
|
|
51
|
+
url: z.string().describe('Link URL.'),
|
|
52
|
+
date: z.string().optional().describe('Publication date.'),
|
|
53
|
+
})
|
|
54
|
+
.describe('An appeal or response plan entry.'))
|
|
55
|
+
.optional()
|
|
56
|
+
.describe('Active appeals and response plans linked to this disaster.'),
|
|
57
|
+
usefulLinks: z
|
|
58
|
+
.array(z
|
|
59
|
+
.object({
|
|
60
|
+
title: z.string().describe('Link title.'),
|
|
61
|
+
url: z.string().describe('Link URL.'),
|
|
62
|
+
})
|
|
63
|
+
.describe('A useful external link.'))
|
|
64
|
+
.optional()
|
|
65
|
+
.describe('Useful external links curated by ReliefWeb editors.'),
|
|
66
|
+
}),
|
|
67
|
+
errors: [
|
|
68
|
+
{
|
|
69
|
+
reason: 'not_found',
|
|
70
|
+
code: JsonRpcErrorCode.NotFound,
|
|
71
|
+
when: 'No disaster found with the given ID.',
|
|
72
|
+
recovery: 'Verify the ID is a valid ReliefWeb numeric disaster ID from reliefweb_search_disasters results.',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
async handler(input, ctx) {
|
|
76
|
+
ctx.log.info('reliefweb_get_disaster', { id: input.id });
|
|
77
|
+
const disaster = await getReliefWebService().getDisaster(input.id, ctx);
|
|
78
|
+
if (!disaster) {
|
|
79
|
+
throw ctx.fail('not_found', `No disaster found with ID ${input.id}. Verify the ID from reliefweb_search_disasters.`, { ...ctx.recoveryFor('not_found') });
|
|
80
|
+
}
|
|
81
|
+
return disaster;
|
|
82
|
+
},
|
|
83
|
+
format: (result) => {
|
|
84
|
+
const lines = [`# ${result.name}`];
|
|
85
|
+
lines.push(`**ID:** ${result.id}`);
|
|
86
|
+
if (result.status)
|
|
87
|
+
lines.push(`**Status:** ${result.status}`);
|
|
88
|
+
if (result.glide)
|
|
89
|
+
lines.push(`**GLIDE:** ${result.glide}`);
|
|
90
|
+
if (result.primaryType)
|
|
91
|
+
lines.push(`**Primary type:** ${result.primaryType}`);
|
|
92
|
+
if (result.types?.length)
|
|
93
|
+
lines.push(`**Types:** ${result.types.join(', ')}`);
|
|
94
|
+
if (result.dateEvent)
|
|
95
|
+
lines.push(`**Event date:** ${result.dateEvent}`);
|
|
96
|
+
if (result.dateCreated)
|
|
97
|
+
lines.push(`**Indexed:** ${result.dateCreated}`);
|
|
98
|
+
if (result.primaryCountry)
|
|
99
|
+
lines.push(`**Primary country:** ${result.primaryCountry}`);
|
|
100
|
+
if (result.countries?.length)
|
|
101
|
+
lines.push(`**Countries:** ${result.countries.join(', ')}`);
|
|
102
|
+
if (result.urlAlias)
|
|
103
|
+
lines.push(`**URL:** ${result.urlAlias}`);
|
|
104
|
+
if (result.description)
|
|
105
|
+
lines.push(`\n## Description\n\n${result.description}`);
|
|
106
|
+
if (result.profileOverview)
|
|
107
|
+
lines.push(`\n## Overview\n\n${result.profileOverview}`);
|
|
108
|
+
if (result.keyContent?.length) {
|
|
109
|
+
lines.push('\n## Key Content');
|
|
110
|
+
for (const kc of result.keyContent)
|
|
111
|
+
lines.push(`- [${kc.title}](${kc.url})`);
|
|
112
|
+
}
|
|
113
|
+
if (result.appealsResponsePlans?.length) {
|
|
114
|
+
lines.push('\n## Appeals & Response Plans');
|
|
115
|
+
for (const ap of result.appealsResponsePlans) {
|
|
116
|
+
lines.push(`- [${ap.title}](${ap.url})${ap.date ? ` (${ap.date})` : ''}`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (result.usefulLinks?.length) {
|
|
120
|
+
lines.push('\n## Useful Links');
|
|
121
|
+
for (const ul of result.usefulLinks)
|
|
122
|
+
lines.push(`- [${ul.title}](${ul.url})`);
|
|
123
|
+
}
|
|
124
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
//# sourceMappingURL=get-disaster.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-disaster.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-disaster.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,wBAAwB,EAAE;IACjE,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EACT,2GAA2G;QAC3G,6EAA6E;QAC7E,gEAAgE;IAClE,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAC9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,EAAE,EAAE,CAAC;aACF,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,EAAE;aACV,QAAQ,CAAC,kFAAkF,CAAC;KAChG,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAA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CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5E,CAAC;QACH,CAAC;QACD,IAAI,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;YAChC,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,WAAW;gBAAE,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;QAChF,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fetch a single ReliefWeb report by ID with full body text and metadata.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-report
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
export declare const reliefwebGetReport: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
id: z.ZodNumber;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
id: z.ZodNumber;
|
|
11
|
+
title: z.ZodString;
|
|
12
|
+
dateOriginal: z.ZodOptional<z.ZodString>;
|
|
13
|
+
dateCreated: z.ZodOptional<z.ZodString>;
|
|
14
|
+
primaryCountry: z.ZodOptional<z.ZodString>;
|
|
15
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
|
+
sources: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
+
formats: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
18
|
+
themes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
|
+
urlAlias: z.ZodOptional<z.ZodString>;
|
|
21
|
+
fileUrls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
|
+
headlineSummary: z.ZodOptional<z.ZodString>;
|
|
23
|
+
body: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>, readonly [{
|
|
25
|
+
readonly reason: "not_found";
|
|
26
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
27
|
+
readonly when: "No report found with the given ID.";
|
|
28
|
+
readonly recovery: "Verify the ID is a valid ReliefWeb numeric ID obtained from search results. Use reliefweb_search_reports to discover valid IDs.";
|
|
29
|
+
}]>;
|
|
30
|
+
//# sourceMappingURL=get-report.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-report.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-report.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;GAiF7B,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fetch a single ReliefWeb report by ID with full body text and metadata.
|
|
3
|
+
* @module mcp-server/tools/definitions/get-report
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { getReliefWebService } from '../../../services/reliefweb/reliefweb-service.js';
|
|
8
|
+
export const reliefwebGetReport = tool('reliefweb_get_report', {
|
|
9
|
+
title: 'Get ReliefWeb Report',
|
|
10
|
+
description: 'Fetch a single ReliefWeb report by its numeric ID with full body text, file attachments, and all metadata. ' +
|
|
11
|
+
'Use after reliefweb_search_reports to retrieve document content — body is excluded from search results to manage context budget. ' +
|
|
12
|
+
'Report bodies can be 10–100KB; call this only when you need the full document text.',
|
|
13
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
14
|
+
input: z.object({
|
|
15
|
+
id: z
|
|
16
|
+
.number()
|
|
17
|
+
.int()
|
|
18
|
+
.positive()
|
|
19
|
+
.describe('ReliefWeb numeric report ID. Obtained from reliefweb_search_reports results.'),
|
|
20
|
+
}),
|
|
21
|
+
output: z.object({
|
|
22
|
+
id: z.number().describe('ReliefWeb numeric report ID.'),
|
|
23
|
+
title: z.string().describe('Report title.'),
|
|
24
|
+
dateOriginal: z.string().optional().describe('Source publication date (ISO 8601).'),
|
|
25
|
+
dateCreated: z.string().optional().describe('ReliefWeb index date (ISO 8601).'),
|
|
26
|
+
primaryCountry: z.string().optional().describe('Primary country name for this report.'),
|
|
27
|
+
countries: z.array(z.string()).optional().describe('All countries tagged on this report.'),
|
|
28
|
+
sources: z.array(z.string()).optional().describe('Publishing organizations (short names).'),
|
|
29
|
+
formats: z.array(z.string()).optional().describe('Content format names.'),
|
|
30
|
+
themes: z.array(z.string()).optional().describe('Humanitarian theme/sector names.'),
|
|
31
|
+
languages: z.array(z.string()).optional().describe('Language codes (ISO 639-1).'),
|
|
32
|
+
urlAlias: z.string().optional().describe('Canonical ReliefWeb URL for this report.'),
|
|
33
|
+
fileUrls: z
|
|
34
|
+
.array(z.string())
|
|
35
|
+
.optional()
|
|
36
|
+
.describe('Direct file download URLs attached to this report.'),
|
|
37
|
+
headlineSummary: z
|
|
38
|
+
.string()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe('Short editorial summary from the headline block, when present.'),
|
|
41
|
+
body: z
|
|
42
|
+
.string()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('Full report body text (HTML). Present for most reports; absent for binary-only documents.'),
|
|
45
|
+
}),
|
|
46
|
+
errors: [
|
|
47
|
+
{
|
|
48
|
+
reason: 'not_found',
|
|
49
|
+
code: JsonRpcErrorCode.NotFound,
|
|
50
|
+
when: 'No report found with the given ID.',
|
|
51
|
+
recovery: 'Verify the ID is a valid ReliefWeb numeric ID obtained from search results. Use reliefweb_search_reports to discover valid IDs.',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
async handler(input, ctx) {
|
|
55
|
+
ctx.log.info('reliefweb_get_report', { id: input.id });
|
|
56
|
+
const report = await getReliefWebService().getReport(input.id, ctx);
|
|
57
|
+
if (!report) {
|
|
58
|
+
throw ctx.fail('not_found', `No report found with ID ${input.id}. Verify the ID is a valid ReliefWeb numeric ID.`, { ...ctx.recoveryFor('not_found') });
|
|
59
|
+
}
|
|
60
|
+
return report;
|
|
61
|
+
},
|
|
62
|
+
format: (result) => {
|
|
63
|
+
const lines = [`# ${result.title}`];
|
|
64
|
+
lines.push(`**ID:** ${result.id}`);
|
|
65
|
+
if (result.dateOriginal)
|
|
66
|
+
lines.push(`**Published:** ${result.dateOriginal}`);
|
|
67
|
+
if (result.dateCreated)
|
|
68
|
+
lines.push(`**Indexed:** ${result.dateCreated}`);
|
|
69
|
+
if (result.primaryCountry)
|
|
70
|
+
lines.push(`**Primary country:** ${result.primaryCountry}`);
|
|
71
|
+
if (result.countries?.length)
|
|
72
|
+
lines.push(`**Countries:** ${result.countries.join(', ')}`);
|
|
73
|
+
if (result.sources?.length)
|
|
74
|
+
lines.push(`**Sources:** ${result.sources.join(', ')}`);
|
|
75
|
+
if (result.formats?.length)
|
|
76
|
+
lines.push(`**Format:** ${result.formats.join(', ')}`);
|
|
77
|
+
if (result.themes?.length)
|
|
78
|
+
lines.push(`**Themes:** ${result.themes.join(', ')}`);
|
|
79
|
+
if (result.languages?.length)
|
|
80
|
+
lines.push(`**Languages:** ${result.languages.join(', ')}`);
|
|
81
|
+
if (result.headlineSummary)
|
|
82
|
+
lines.push(`\n**Summary:** ${result.headlineSummary}`);
|
|
83
|
+
if (result.urlAlias)
|
|
84
|
+
lines.push(`**URL:** ${result.urlAlias}`);
|
|
85
|
+
if (result.fileUrls?.length)
|
|
86
|
+
lines.push(`**Files:** ${result.fileUrls.join(', ')}`);
|
|
87
|
+
if (result.body)
|
|
88
|
+
lines.push(`\n---\n\n${result.body}`);
|
|
89
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
//# sourceMappingURL=get-report.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-report.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-report.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAEhF,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,sBAAsB,EAAE;IAC7D,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EACT,6GAA6G;QAC7G,mIAAmI;QACnI,qFAAqF;IACvF,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAC9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,EAAE,EAAE,CAAC;aACF,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,EAAE;aACV,QAAQ,CAAC,8EAA8E,CAAC;KAC5F,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;QACvD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;QAC3C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ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I,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview List all countries tracked by ReliefWeb, optionally filtered by crisis status.
|
|
3
|
+
* @module mcp-server/tools/definitions/list-countries
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const reliefwebListCountries: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
7
|
+
crisis_only: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
9
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
items: z.ZodArray<z.ZodObject<{
|
|
12
|
+
id: z.ZodNumber;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
iso3: z.ZodOptional<z.ZodString>;
|
|
15
|
+
status: z.ZodOptional<z.ZodString>;
|
|
16
|
+
urlAlias: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
totalCount: z.ZodNumber;
|
|
19
|
+
}, z.core.$strip>, undefined>;
|
|
20
|
+
//# sourceMappingURL=list-countries.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-countries.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/list-countries.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGjD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;6BAwFjC,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview List all countries tracked by ReliefWeb, optionally filtered by crisis status.
|
|
3
|
+
* @module mcp-server/tools/definitions/list-countries
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { getReliefWebService } from '../../../services/reliefweb/reliefweb-service.js';
|
|
7
|
+
export const reliefwebListCountries = tool('reliefweb_list_countries', {
|
|
8
|
+
title: 'List ReliefWeb Countries',
|
|
9
|
+
description: 'List all countries and territories tracked by ReliefWeb, optionally filtered to active humanitarian situations. ' +
|
|
10
|
+
'Returns ISO3 codes and status for each entry — use the ISO3 code with reliefweb_get_country to fetch a full profile. ' +
|
|
11
|
+
'Set crisis_only=true to limit results to countries with active humanitarian situations.',
|
|
12
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
13
|
+
input: z.object({
|
|
14
|
+
crisis_only: z
|
|
15
|
+
.boolean()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('When true, filters to countries with an active humanitarian situation (status alert or current). Default false returns all countries.'),
|
|
18
|
+
limit: z
|
|
19
|
+
.number()
|
|
20
|
+
.int()
|
|
21
|
+
.min(1)
|
|
22
|
+
.max(1000)
|
|
23
|
+
.default(100)
|
|
24
|
+
.describe('Number of results to return (1–1000, default 100). Each call counts against the 1,000-calls/day quota.'),
|
|
25
|
+
offset: z
|
|
26
|
+
.number()
|
|
27
|
+
.int()
|
|
28
|
+
.min(0)
|
|
29
|
+
.default(0)
|
|
30
|
+
.describe('Zero-based offset for pagination. Use with limit and totalCount to page through results.'),
|
|
31
|
+
}),
|
|
32
|
+
output: z.object({
|
|
33
|
+
items: z
|
|
34
|
+
.array(z
|
|
35
|
+
.object({
|
|
36
|
+
id: z.number().describe('ReliefWeb numeric country ID.'),
|
|
37
|
+
name: z.string().describe('Country or territory name.'),
|
|
38
|
+
iso3: z
|
|
39
|
+
.string()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe('ISO 3166-1 alpha-3 code for use with reliefweb_get_country.'),
|
|
42
|
+
status: z
|
|
43
|
+
.string()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe('Humanitarian situation status. Active situations have status alert or current.'),
|
|
46
|
+
urlAlias: z
|
|
47
|
+
.string()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Canonical ReliefWeb URL for this country page.'),
|
|
50
|
+
})
|
|
51
|
+
.describe('A country or territory tracked by ReliefWeb.'))
|
|
52
|
+
.describe('Countries tracked by ReliefWeb.'),
|
|
53
|
+
totalCount: z.number().describe('Total countries matching the filter before pagination.'),
|
|
54
|
+
}),
|
|
55
|
+
async handler(input, ctx) {
|
|
56
|
+
ctx.log.info('reliefweb_list_countries', {
|
|
57
|
+
crisisOnly: input.crisis_only,
|
|
58
|
+
limit: input.limit,
|
|
59
|
+
});
|
|
60
|
+
const result = await getReliefWebService().listCountries({
|
|
61
|
+
...(input.crisis_only != null ? { crisisOnly: input.crisis_only } : {}),
|
|
62
|
+
limit: input.limit,
|
|
63
|
+
offset: input.offset,
|
|
64
|
+
}, ctx);
|
|
65
|
+
return { items: result.items, totalCount: result.totalCount };
|
|
66
|
+
},
|
|
67
|
+
format: (result) => {
|
|
68
|
+
const lines = [`**Total:** ${result.totalCount} countries`];
|
|
69
|
+
for (const item of result.items) {
|
|
70
|
+
const parts = [`**${item.name}**`];
|
|
71
|
+
if (item.iso3)
|
|
72
|
+
parts.push(`(${item.iso3})`);
|
|
73
|
+
parts.push(`[${item.id}]`);
|
|
74
|
+
if (item.status)
|
|
75
|
+
parts.push(`— ${item.status}`);
|
|
76
|
+
if (item.urlAlias)
|
|
77
|
+
parts.push(`— ${item.urlAlias}`);
|
|
78
|
+
lines.push(`- ${parts.join(' ')}`);
|
|
79
|
+
}
|
|
80
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
//# sourceMappingURL=list-countries.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-countries.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/list-countries.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OA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AAI,GAAG,CAAC,CAAC;YAC5C,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;YAC3B,IAAI,IAAI,CAAC,MAAM;gBAAE,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;YAChD,IAAI,IAAI,CAAC,QAAQ;gBAAE,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YACpD,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Browse source organizations that contribute content to ReliefWeb.
|
|
3
|
+
* @module mcp-server/tools/definitions/list-sources
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const reliefwebListSources: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
7
|
+
text: z.ZodOptional<z.ZodString>;
|
|
8
|
+
type: z.ZodOptional<z.ZodString>;
|
|
9
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
items: z.ZodArray<z.ZodObject<{
|
|
13
|
+
id: z.ZodNumber;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
shortname: z.ZodOptional<z.ZodString>;
|
|
16
|
+
types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
+
url: z.ZodOptional<z.ZodString>;
|
|
18
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
totalCount: z.ZodNumber;
|
|
21
|
+
}, z.core.$strip>, undefined>;
|
|
22
|
+
//# sourceMappingURL=list-sources.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-sources.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/list-sources.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGjD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;6BAyF/B,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Browse source organizations that contribute content to ReliefWeb.
|
|
3
|
+
* @module mcp-server/tools/definitions/list-sources
|
|
4
|
+
*/
|
|
5
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
import { getReliefWebService } from '../../../services/reliefweb/reliefweb-service.js';
|
|
7
|
+
export const reliefwebListSources = tool('reliefweb_list_sources', {
|
|
8
|
+
title: 'List ReliefWeb Sources',
|
|
9
|
+
description: 'Browse source organizations that contribute content to ReliefWeb, optionally filtered by name text or organization type. ' +
|
|
10
|
+
'Returns short names, types, and URLs. ' +
|
|
11
|
+
'Use the shortname value with the source filter in reliefweb_search_reports, reliefweb_search_jobs, and reliefweb_search_training.',
|
|
12
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
13
|
+
input: z.object({
|
|
14
|
+
text: z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('Full-text search query. Matches against organization name and short name.'),
|
|
18
|
+
type: z
|
|
19
|
+
.string()
|
|
20
|
+
.optional()
|
|
21
|
+
.describe('Organization type (e.g., Government, International Organization, NGO, Academia). Filters on type.name.'),
|
|
22
|
+
limit: z
|
|
23
|
+
.number()
|
|
24
|
+
.int()
|
|
25
|
+
.min(1)
|
|
26
|
+
.max(1000)
|
|
27
|
+
.default(10)
|
|
28
|
+
.describe('Number of results to return (1–1000, default 10). Each call counts against the 1,000-calls/day quota.'),
|
|
29
|
+
offset: z
|
|
30
|
+
.number()
|
|
31
|
+
.int()
|
|
32
|
+
.min(0)
|
|
33
|
+
.default(0)
|
|
34
|
+
.describe('Zero-based offset for pagination. Use with limit and totalCount to page through results.'),
|
|
35
|
+
}),
|
|
36
|
+
output: z.object({
|
|
37
|
+
items: z
|
|
38
|
+
.array(z
|
|
39
|
+
.object({
|
|
40
|
+
id: z.number().describe('ReliefWeb numeric source ID.'),
|
|
41
|
+
name: z.string().describe('Full organization name.'),
|
|
42
|
+
shortname: z
|
|
43
|
+
.string()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe('Organization short name — use this value in the source filter for other search tools.'),
|
|
46
|
+
types: z.array(z.string()).optional().describe('Organization type names.'),
|
|
47
|
+
url: z.string().optional().describe('Organization ReliefWeb profile URL.'),
|
|
48
|
+
homepage: z.string().optional().describe('Organization website URL.'),
|
|
49
|
+
})
|
|
50
|
+
.describe('A source organization contributing content to ReliefWeb.'))
|
|
51
|
+
.describe('Source organizations contributing content to ReliefWeb.'),
|
|
52
|
+
totalCount: z.number().describe('Total sources matching the query before pagination.'),
|
|
53
|
+
}),
|
|
54
|
+
async handler(input, ctx) {
|
|
55
|
+
ctx.log.info('reliefweb_list_sources', {
|
|
56
|
+
text: input.text,
|
|
57
|
+
type: input.type,
|
|
58
|
+
limit: input.limit,
|
|
59
|
+
});
|
|
60
|
+
const result = await getReliefWebService().listSources({
|
|
61
|
+
...(input.text?.trim() ? { text: input.text } : {}),
|
|
62
|
+
...(input.type?.trim() ? { type: input.type } : {}),
|
|
63
|
+
limit: input.limit,
|
|
64
|
+
offset: input.offset,
|
|
65
|
+
}, ctx);
|
|
66
|
+
return { items: result.items, totalCount: result.totalCount };
|
|
67
|
+
},
|
|
68
|
+
format: (result) => {
|
|
69
|
+
const lines = [`**Total:** ${result.totalCount} sources`];
|
|
70
|
+
for (const item of result.items) {
|
|
71
|
+
const namePart = item.shortname ? `**${item.shortname}** — ${item.name}` : `**${item.name}**`;
|
|
72
|
+
const typePart = item.types?.length ? ` (${item.types.join(', ')})` : '';
|
|
73
|
+
lines.push(`- ${namePart} [${item.id}]${typePart}`);
|
|
74
|
+
if (item.homepage)
|
|
75
|
+
lines.push(` Website: ${item.homepage}`);
|
|
76
|
+
if (item.url)
|
|
77
|
+
lines.push(` ReliefWeb: ${item.url}`);
|
|
78
|
+
}
|
|
79
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=list-sources.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-sources.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/list-sources.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,wBAAwB,EAAE;IACjE,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EACT,2HAA2H;QAC3H,wCAAwC;QACxC,mIAAmI;IACrI,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAC9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,2EAA2E,CAAC;QACxF,IAAI,EAAE,CAAC;aACJ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,wGAAwG,CACzG;QACH,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,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AE,IAAI,QAAQ,EAAE,CAAC,CAAC;YACpD,IAAI,IAAI,CAAC,QAAQ;gBAAE,KAAK,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC7D,IAAI,IAAI,CAAC,GAAG;gBAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Search ReliefWeb disasters by type, country, status, and GLIDE number.
|
|
3
|
+
* @module mcp-server/tools/definitions/search-disasters
|
|
4
|
+
*/
|
|
5
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
|
+
export declare const reliefwebSearchDisasters: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
7
|
+
text: z.ZodOptional<z.ZodString>;
|
|
8
|
+
country: z.ZodOptional<z.ZodString>;
|
|
9
|
+
disaster_type: z.ZodOptional<z.ZodString>;
|
|
10
|
+
status: z.ZodOptional<z.ZodString>;
|
|
11
|
+
glide: z.ZodOptional<z.ZodString>;
|
|
12
|
+
date_from: z.ZodOptional<z.ZodString>;
|
|
13
|
+
date_to: z.ZodOptional<z.ZodString>;
|
|
14
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
15
|
+
include_archived: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
17
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
items: z.ZodArray<z.ZodObject<{
|
|
20
|
+
id: z.ZodNumber;
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
status: z.ZodOptional<z.ZodString>;
|
|
23
|
+
glide: z.ZodOptional<z.ZodString>;
|
|
24
|
+
dateEvent: z.ZodOptional<z.ZodString>;
|
|
25
|
+
dateCreated: z.ZodOptional<z.ZodString>;
|
|
26
|
+
primaryCountry: z.ZodOptional<z.ZodString>;
|
|
27
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
|
+
types: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
+
primaryType: z.ZodOptional<z.ZodString>;
|
|
30
|
+
urlAlias: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
totalCount: z.ZodNumber;
|
|
33
|
+
message: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>, undefined>;
|
|
35
|
+
//# sourceMappingURL=search-disasters.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-disasters.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-disasters.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGjD,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA0KnC,CAAC"}
|