mcp-libraryofcongress 1.0.0 → 2.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.
- package/CHANGELOG.md +49 -0
- package/LICENSE +0 -0
- package/README.md +32 -13
- package/dist/index.d.ts +0 -0
- package/dist/index.js +193 -130
- package/dist/index.js.map +1 -1
- package/dist/loc/client.d.ts +0 -0
- package/dist/loc/client.js +1 -1
- package/dist/loc/client.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Breaking change
|
|
6
|
+
|
|
7
|
+
`search_newspapers` no longer returns `words_located`. Each match now carries
|
|
8
|
+
`excerpt_kind`, one of `"passage"` or `"page_opening"`. A caller reading
|
|
9
|
+
`words_located === true` reads `excerpt_kind === "passage"`, and the false case
|
|
10
|
+
reads `"page_opening"`.
|
|
11
|
+
|
|
12
|
+
The boolean and the excerpt disagreed about what they were. `words_located:
|
|
13
|
+
false` means the machine-read text the Library returned stops before the
|
|
14
|
+
searched words, so the excerpt beside it is the **opening of the page** and does
|
|
15
|
+
not carry the match. It sat in the answer in the same place and the same shape
|
|
16
|
+
as a real passage, and a note beside it was the only thing saying otherwise.
|
|
17
|
+
Measured on a live search, four matches in five were openings. Naming the kind
|
|
18
|
+
of thing an excerpt is puts that where it cannot be skipped.
|
|
19
|
+
|
|
20
|
+
### Also in this release
|
|
21
|
+
|
|
22
|
+
- Every excerpt is now labelled in the rendered text itself, as
|
|
23
|
+
`[passage]` or `[page opening]` ahead of the words, so the mark travels with
|
|
24
|
+
the text a reader copies.
|
|
25
|
+
- The tool described quoting as matching a phrase whole. It does not. Measured:
|
|
26
|
+
`"hell is other people"` quoted returns 18 pages, unquoted 1,634,731, and
|
|
27
|
+
among the quoted results are pages from 1891, 1897 and 1906, which precede the
|
|
28
|
+
line by half a century. Quoting narrows hard and decides nothing about how the
|
|
29
|
+
Library matches. The promise is gone from the tool description and from both
|
|
30
|
+
halves of the README, and a quoted query now carries a note saying the match
|
|
31
|
+
is not guaranteed to be the phrase.
|
|
32
|
+
- Headings said the pages carry the query. They say what the Library matched.
|
|
33
|
+
|
|
34
|
+
`NewspaperHit.wordsLocated`, on the `./client` subpath, is unchanged: it is the
|
|
35
|
+
raw fact about the text received, and the tool layer names the kind of thing it
|
|
36
|
+
renders from it.
|
|
37
|
+
|
|
38
|
+
## 1.1.0
|
|
39
|
+
|
|
40
|
+
- An argument no tool declared was read and dropped, and the answer came back
|
|
41
|
+
computed on the defaults with nothing said about it. A caller who mistyped a
|
|
42
|
+
name, or wrote one a tool answering a neighbouring question takes, was
|
|
43
|
+
answered as confidently as one who had asked what they meant. Every tool now
|
|
44
|
+
refuses an argument it does not declare, under the `invalid_input` code,
|
|
45
|
+
naming the argument and offering the declared name when one is close:
|
|
46
|
+
`identifer` on `get_item` is answered with `identifier`, `limit_per_page` on
|
|
47
|
+
`search_newspapers` with `limit`.
|
|
48
|
+
- The schema each tool publishes now carries `additionalProperties: false`, so a
|
|
49
|
+
client reads the rule before it calls rather than discovering it from a
|
|
50
|
+
refusal.
|
|
51
|
+
|
|
3
52
|
## 1.0.0
|
|
4
53
|
|
|
5
54
|
First stable release. The tool names, the argument names and the shape of the
|
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/mcp-libraryofcongress)
|
|
4
4
|
[](https://github.com/smeet666/mcp-libraryofcongress/actions/workflows/ci.yml)
|
|
5
5
|
[](LICENSE)
|
|
6
|
+
[](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.smeet666/mcp-libraryofcongress)
|
|
6
7
|
[](https://glama.ai/mcp/servers/smeet666/mcp-libraryofcongress)
|
|
7
8
|
|
|
8
9
|
An MCP server for the [Library of Congress](https://www.loc.gov). **Search the
|
|
@@ -63,12 +64,15 @@ The server is **read-only**. It uploads nothing and writes nothing back.
|
|
|
63
64
|
A catalogue search reads titles, creators and descriptions. `search_newspapers`
|
|
64
65
|
reads what optical character recognition took off millions of scanned pages of
|
|
65
66
|
American newspapers, so it answers a question nothing else here can: _which
|
|
66
|
-
issue printed
|
|
67
|
+
issue printed these words_. A match comes back with the paper, the date, the
|
|
67
68
|
leaf of the issue, the state it was published in, and an address that opens that
|
|
68
69
|
leaf with the query applied.
|
|
69
70
|
|
|
70
|
-
|
|
71
|
-
matched
|
|
71
|
+
Double quotes narrow the search sharply, and the Library decides what they mean:
|
|
72
|
+
a matched page can carry the words apart or in another order rather than the
|
|
73
|
+
phrase as written, so an answer to a quoted query says so and points at the page
|
|
74
|
+
to read. Without quotes the words are matched separately, which finds far more
|
|
75
|
+
again.
|
|
72
76
|
|
|
73
77
|
The corpus spans every state and a century and a half, so a bare phrase reaches
|
|
74
78
|
a great deal that a question did not ask for. Three arguments narrow it:
|
|
@@ -100,9 +104,14 @@ page 2, 3 and so on rather than treating the first answer as the whole of it.
|
|
|
100
104
|
|
|
101
105
|
**An excerpt is sometimes the opening of the page.** The Library returns the
|
|
102
106
|
beginning of a page's text with each row rather than the whole page, so the
|
|
103
|
-
searched words are often further down than that text reaches.
|
|
104
|
-
|
|
105
|
-
|
|
107
|
+
searched words are often further down than that text reaches. Every match
|
|
108
|
+
carries `excerpt_kind`, and every excerpt is labelled with it in the text block:
|
|
109
|
+
|
|
110
|
+
- **`passage`**, the text around the words that matched, centred on them.
|
|
111
|
+
- **`page_opening`**, the start of the leaf, sent because the text that came
|
|
112
|
+
back stops before the searched words appear. It does not carry the match, so
|
|
113
|
+
quoting it quotes something else. The notes count how many there are, and
|
|
114
|
+
`source_url` opens the leaf with the query applied.
|
|
106
115
|
|
|
107
116
|
**Scanned text is machine-read.** Excerpts carry the misreadings that come with
|
|
108
117
|
it. Quote them as scanned text and link the page.
|
|
@@ -337,13 +346,17 @@ Le serveur est **en lecture seule**. Il ne téléverse rien et n'écrit rien.
|
|
|
337
346
|
Une recherche de catalogue lit les titres, les auteurs et les descriptions.
|
|
338
347
|
`search_newspapers` lit ce que la reconnaissance de caractères a tiré de
|
|
339
348
|
millions de pages de journaux américains numérisées, et répond donc à une
|
|
340
|
-
question qu'aucun autre outil ici ne sait traiter : _quel numéro a imprimé
|
|
341
|
-
|
|
349
|
+
question qu'aucun autre outil ici ne sait traiter : _quel numéro a imprimé ces
|
|
350
|
+
mots_. Une correspondance revient avec le journal, la date, le feuillet du
|
|
342
351
|
numéro, l'État de publication, et une adresse qui ouvre ce feuillet avec la
|
|
343
352
|
requête appliquée.
|
|
344
353
|
|
|
345
|
-
|
|
346
|
-
|
|
354
|
+
Les guillemets doubles resserrent fortement la recherche, et c'est la Library
|
|
355
|
+
qui décide de ce qu'ils veulent dire : une page retenue peut porter les mots
|
|
356
|
+
éloignés les uns des autres ou dans un autre ordre plutôt que la phrase telle
|
|
357
|
+
qu'elle est écrite. La réponse à une requête entre guillemets le dit et renvoie
|
|
358
|
+
à la page à lire. Sans guillemets, les mots sont cherchés séparément, ce qui
|
|
359
|
+
trouve bien plus encore.
|
|
347
360
|
|
|
348
361
|
Le corpus couvre tous les États et un siècle et demi : une phrase seule ramène
|
|
349
362
|
donc beaucoup de choses que la question ne demandait pas. Trois arguments la
|
|
@@ -378,9 +391,15 @@ que de prendre la première réponse pour la totalité.
|
|
|
378
391
|
**Un extrait est parfois le début de la page.** La Library renvoie le début du
|
|
379
392
|
texte d'une page avec chaque ligne de résultat plutôt que la page entière, si
|
|
380
393
|
bien que les mots cherchés se trouvent souvent plus bas que ce texte ne va.
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
394
|
+
Chaque correspondance porte `excerpt_kind`, et chaque extrait en porte
|
|
395
|
+
l'étiquette dans le bloc de texte :
|
|
396
|
+
|
|
397
|
+
- **`passage`** : le texte autour des mots correspondants, centré sur eux.
|
|
398
|
+
- **`page_opening`** : le début du feuillet, renvoyé parce que le texte reçu
|
|
399
|
+
s'arrête avant que les mots cherchés n'apparaissent. Il ne porte pas la
|
|
400
|
+
correspondance, donc le citer revient à citer autre chose. Les notes comptent
|
|
401
|
+
combien il y en a, et `source_url` ouvre le feuillet avec la requête
|
|
402
|
+
appliquée.
|
|
384
403
|
|
|
385
404
|
**Le texte numérisé est lu par une machine.** Les extraits en portent les
|
|
386
405
|
fautes. Citez-les comme tels et suivez le lien.
|
package/dist/index.d.ts
CHANGED
|
File without changes
|