Skip to content

Commit cf80477

Browse files
committed
v0.8.1: bring MCP instructions block into parity with SKILL.md / v0.8.0
The handshake `instructions` are the ONLY guidance a skill-less client (ChatGPT via the remote connector) gets, so they must carry what SKILL.md gives Claude. Two fixes: - Correct the stale single-substring `search` guidance: the unified `search` has tokenized + ANDed terms since v0.7.0, so a multi-word query narrows rather than "returns little". Disambiguate it from the search_* `keyword` filters (one literal substring -> one term per call). - Add a RESULTS & ERRORS paragraph mirroring SKILL.md: pagination envelope + total_matches, visible limit caps (requested_limit/limit_warning), validated enum filters (invalid -> {error,valid_values}; valid + 0 rows = real absence), unvalidated free-text filters, and list_locations/list_persons mentioned-in semantics. smoke-test now asserts the served instructions reflect v0.8 (valid_values, "mentioned in records from", requested_limit) and dropped the old myth.
1 parent 5f766fd commit cf80477

4 files changed

Lines changed: 36 additions & 11 deletions

File tree

mcpb/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": "0.3",
33
"name": "iwac-mcp-server",
44
"display_name": "Islam West Africa Collection (IWAC)",
5-
"version": "0.8.0",
5+
"version": "0.8.1",
66
"description": "Read-only access to the Islam West Africa Collection via Hugging Face datasets.",
77
"long_description": "Search and analyse the Islam West Africa Collection (IWAC): ~12,000 newspaper articles, 1,500 Islamic publications (searchable by keyword, subject, series, and table of contents), 4,700 index entries, plus audiovisual materials, archival documents, and academic references. Includes AI sentiment analysis (Gemini polarity/centrality) and per-article AI abstracts. All matching is accent- and case-insensitive.\n\n**No API key is required for the 20 core tools** (keyword search, filtering, statistics, item details). Two optional semantic-search tools use Gemini embeddings — covering all articles and the publication series with tables of contents — and need a free Google/Gemini API key; these are disabled by default.\n\nOn first use the server downloads ~250 MB of parquet data from Hugging Face into a local cache.",
88
"author": {

mcpb/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iwac-mcp-server-bundle",
3-
"version": "0.8.0",
3+
"version": "0.8.1",
44
"description": "Node MCP server for the Islam West Africa Collection, packaged as a Claude Desktop extension (.mcpb).",
55
"private": true,
66
"type": "module",

mcpb/smoke-test.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ const serverVersion = client.getServerVersion()?.version;
2727
console.log(`server version: ${serverVersion}`);
2828
if (!serverVersion || serverVersion === "0.0.0-dev") fail("server version not injected from package.json");
2929

30+
// Instructions parity (the ONLY guidance channel a skill-less client gets):
31+
// must reflect v0.8.x semantics and not the pre-v0.7 single-substring search myth.
32+
const instructions = client.getInstructions?.() ?? "";
33+
if (!instructions) {
34+
fail("server handshake carried no instructions");
35+
} else {
36+
if (instructions.includes("as one phrase returns little"))
37+
fail("instructions still describe `search` as single-substring (multi-word now tokenizes/ANDs)");
38+
for (const needle of ["valid_values", "mentioned in records from", "requested_limit"]) {
39+
if (!instructions.includes(needle)) fail(`instructions missing v0.8 guidance: "${needle}"`);
40+
}
41+
}
42+
3043
const semanticOn = ["1", "true", "yes", "on"].includes(
3144
(process.env.IWAC_SEMANTIC_SEARCH_ENABLED ?? "").trim().toLowerCase(),
3245
);

mcpb/src/index.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,27 @@ const INSTRUCTIONS =
2222
"articles, Islamic publications, archival documents, audiovisual records, and academic " +
2323
"references on Islam and Muslim societies in Benin, Burkina Faso, Côte d'Ivoire, Niger, " +
2424
"Nigeria, and Togo.\n\n" +
25-
"WORKFLOW: call `search` with ONE concept or name at a time, then `fetch` an id from the " +
26-
"results to read the full text. Matching is substring-based, so 'pèlerinage' works but " +
27-
"'pèlerinage Mecque' as one phrase returns little — search terms separately. When many items " +
28-
"match, weigh result counts and AI abstracts before fetching full texts. Beyond search/fetch, " +
29-
"finer tools exist (search_articles, search_publications, search_references, search_index, " +
30-
"search_documents, plus get_* and list_*) with country, newspaper, subject, and date filters — " +
31-
"prefer the `subject` filter over keywords for curated themes. All matching is accent- and " +
32-
"case-insensitive; country filters take exact names (Benin, Burkina Faso, Côte d'Ivoire, " +
33-
"Niger, Nigeria, Togo).\n\n" +
25+
"WORKFLOW: start with `search` (a concept or name), then `fetch` an id from the results to read " +
26+
"the full text. The unified `search` matches each word of a multi-word query independently — " +
27+
"every word must appear somewhere in the item — so 'pèlerinage Mecque' narrows results rather " +
28+
"than failing; prefer a single concept per call. The finer search_* tools' `keyword` filter " +
29+
"instead does ONE literal substring match, so for those search one term at a time ('pèlerinage', " +
30+
"then 'Mecque'). When many items match, weigh result counts and AI abstracts before fetching full " +
31+
"texts. Beyond search/fetch, finer tools exist (search_articles, search_publications, " +
32+
"search_references, search_index, search_documents, plus get_* and list_*) with country, " +
33+
"newspaper, subject, and date filters — prefer the `subject` filter over keywords for curated " +
34+
"themes. All matching is accent- and case-insensitive; country filters take exact names (Benin, " +
35+
"Burkina Faso, Côte d'Ivoire, Niger, Nigeria, Togo).\n\n" +
36+
"RESULTS & ERRORS: list/search tools return a pagination envelope — read `total_matches` to gauge " +
37+
"scale without paging, and request a sane `limit` (an over-large one is capped visibly via " +
38+
"`requested_limit` + `limit_warning`, never silently dropped). Enumerated filters (`country`, " +
39+
"`polarity`, `centrality`, `index_type`) are validated: an invalid value returns {error, " +
40+
"valid_values} to self-correct — an error to fix, not a finding — whereas a VALID value with 0 " +
41+
"rows is a real absence (there is no Nigerian press, so country='Nigeria' on search_articles is " +
42+
"genuinely empty). Free-text filters (newspaper, subject, author, reference_type, language) are " +
43+
"NOT validated, so a typo there returns 0 silently — sanity-check them. On list_locations / " +
44+
"list_persons, `country` means 'mentioned in records from that country' (not 'located there') and " +
45+
"`frequency` is a collection-wide total; the response restates this in a `note`.\n\n" +
3446
"LANGUAGE: articles and documents are in FRENCH — query in French (laïcité, confrérie, " +
3547
"pèlerinage). Academic references are MULTILINGUAL — search both French AND English.\n\n" +
3648
"TRANSLITERATION: Arabic-Islamic terms appear in FRENCH transliteration — search the French " +

0 commit comments

Comments
 (0)