fettle-mcp 0.4.1 → 0.5.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/README.md CHANGED
@@ -98,6 +98,8 @@ claude mcp add fettle --env FETTLE_API_KEY=fettle_your_key_here -- npx -y fettle
98
98
 
99
99
  49 tools, grouped by what they work on. Read-scope keys can call the `read` ones; everything marked `write` needs a write-scope key.
100
100
 
101
+ Every tool carries the MCP hints `readOnlyHint`, `destructiveHint`, `idempotentHint` and `openWorldHint`, so a client can tell reads from changes without parsing names and ask for confirmation only where it matters. Only the five `delete_*` tools are destructive. `preview_maintenance_window` and `check_target` are marked read-only although they need a write-scope key: they change nothing. `check_now` and `check_target` reach the target host, so they are open-world.
102
+
101
103
  ### Monitors
102
104
 
103
105
  | Tool | Scope | What it does |
@@ -97,6 +97,12 @@
97
97
  "fixed_query": {
98
98
  "view": "compact"
99
99
  }
100
+ },
101
+ "annotations": {
102
+ "read_only_hint": true,
103
+ "destructive_hint": false,
104
+ "idempotent_hint": true,
105
+ "open_world_hint": false
100
106
  }
101
107
  },
102
108
  {
@@ -128,6 +134,12 @@
128
134
  ],
129
135
  "body": false,
130
136
  "fixed_query": {}
137
+ },
138
+ "annotations": {
139
+ "read_only_hint": true,
140
+ "destructive_hint": false,
141
+ "idempotent_hint": true,
142
+ "open_world_hint": false
131
143
  }
132
144
  },
133
145
  {
@@ -157,6 +169,12 @@
157
169
  "query": [],
158
170
  "body": false,
159
171
  "fixed_query": {}
172
+ },
173
+ "annotations": {
174
+ "read_only_hint": true,
175
+ "destructive_hint": false,
176
+ "idempotent_hint": true,
177
+ "open_world_hint": false
160
178
  }
161
179
  },
162
180
  {
@@ -252,6 +270,12 @@
252
270
  "query": [],
253
271
  "body": true,
254
272
  "fixed_query": {}
273
+ },
274
+ "annotations": {
275
+ "read_only_hint": false,
276
+ "destructive_hint": false,
277
+ "idempotent_hint": false,
278
+ "open_world_hint": false
255
279
  }
256
280
  },
257
281
  {
@@ -362,6 +386,12 @@
362
386
  "query": [],
363
387
  "body": true,
364
388
  "fixed_query": {}
389
+ },
390
+ "annotations": {
391
+ "read_only_hint": false,
392
+ "destructive_hint": false,
393
+ "idempotent_hint": false,
394
+ "open_world_hint": false
365
395
  }
366
396
  },
367
397
  {
@@ -395,6 +425,12 @@
395
425
  "query": [],
396
426
  "body": true,
397
427
  "fixed_query": {}
428
+ },
429
+ "annotations": {
430
+ "read_only_hint": false,
431
+ "destructive_hint": false,
432
+ "idempotent_hint": true,
433
+ "open_world_hint": false
398
434
  }
399
435
  },
400
436
  {
@@ -428,6 +464,12 @@
428
464
  "query": [],
429
465
  "body": true,
430
466
  "fixed_query": {}
467
+ },
468
+ "annotations": {
469
+ "read_only_hint": false,
470
+ "destructive_hint": false,
471
+ "idempotent_hint": true,
472
+ "open_world_hint": false
431
473
  }
432
474
  },
433
475
  {
@@ -503,6 +545,12 @@
503
545
  "query": [],
504
546
  "body": true,
505
547
  "fixed_query": {}
548
+ },
549
+ "annotations": {
550
+ "read_only_hint": false,
551
+ "destructive_hint": false,
552
+ "idempotent_hint": true,
553
+ "open_world_hint": false
506
554
  }
507
555
  },
508
556
  {
@@ -523,6 +571,12 @@
523
571
  "query": [],
524
572
  "body": false,
525
573
  "fixed_query": {}
574
+ },
575
+ "annotations": {
576
+ "read_only_hint": true,
577
+ "destructive_hint": false,
578
+ "idempotent_hint": true,
579
+ "open_world_hint": false
526
580
  }
527
581
  },
528
582
  {
@@ -604,6 +658,12 @@
604
658
  "query": [],
605
659
  "body": true,
606
660
  "fixed_query": {}
661
+ },
662
+ "annotations": {
663
+ "read_only_hint": false,
664
+ "destructive_hint": false,
665
+ "idempotent_hint": true,
666
+ "open_world_hint": false
607
667
  }
608
668
  },
609
669
  {
@@ -633,6 +693,12 @@
633
693
  "query": [],
634
694
  "body": false,
635
695
  "fixed_query": {}
696
+ },
697
+ "annotations": {
698
+ "read_only_hint": false,
699
+ "destructive_hint": false,
700
+ "idempotent_hint": true,
701
+ "open_world_hint": false
636
702
  }
637
703
  },
638
704
  {
@@ -662,6 +728,12 @@
662
728
  "query": [],
663
729
  "body": false,
664
730
  "fixed_query": {}
731
+ },
732
+ "annotations": {
733
+ "read_only_hint": false,
734
+ "destructive_hint": false,
735
+ "idempotent_hint": true,
736
+ "open_world_hint": false
665
737
  }
666
738
  },
667
739
  {
@@ -691,6 +763,12 @@
691
763
  "query": [],
692
764
  "body": false,
693
765
  "fixed_query": {}
766
+ },
767
+ "annotations": {
768
+ "read_only_hint": false,
769
+ "destructive_hint": true,
770
+ "idempotent_hint": true,
771
+ "open_world_hint": false
694
772
  }
695
773
  },
696
774
  {
@@ -720,6 +798,12 @@
720
798
  "query": [],
721
799
  "body": false,
722
800
  "fixed_query": {}
801
+ },
802
+ "annotations": {
803
+ "read_only_hint": false,
804
+ "destructive_hint": false,
805
+ "idempotent_hint": false,
806
+ "open_world_hint": true
723
807
  }
724
808
  },
725
809
  {
@@ -767,6 +851,12 @@
767
851
  "query": [],
768
852
  "body": true,
769
853
  "fixed_query": {}
854
+ },
855
+ "annotations": {
856
+ "read_only_hint": false,
857
+ "destructive_hint": false,
858
+ "idempotent_hint": true,
859
+ "open_world_hint": false
770
860
  }
771
861
  },
772
862
  {
@@ -796,6 +886,12 @@
796
886
  "query": [],
797
887
  "body": false,
798
888
  "fixed_query": {}
889
+ },
890
+ "annotations": {
891
+ "read_only_hint": true,
892
+ "destructive_hint": false,
893
+ "idempotent_hint": true,
894
+ "open_world_hint": false
799
895
  }
800
896
  },
801
897
  {
@@ -816,6 +912,12 @@
816
912
  "query": [],
817
913
  "body": false,
818
914
  "fixed_query": {}
915
+ },
916
+ "annotations": {
917
+ "read_only_hint": true,
918
+ "destructive_hint": false,
919
+ "idempotent_hint": true,
920
+ "open_world_hint": false
819
921
  }
820
922
  },
821
923
  {
@@ -892,6 +994,12 @@
892
994
  ],
893
995
  "body": false,
894
996
  "fixed_query": {}
997
+ },
998
+ "annotations": {
999
+ "read_only_hint": true,
1000
+ "destructive_hint": false,
1001
+ "idempotent_hint": true,
1002
+ "open_world_hint": false
895
1003
  }
896
1004
  },
897
1005
  {
@@ -921,6 +1029,12 @@
921
1029
  "query": [],
922
1030
  "body": false,
923
1031
  "fixed_query": {}
1032
+ },
1033
+ "annotations": {
1034
+ "read_only_hint": false,
1035
+ "destructive_hint": false,
1036
+ "idempotent_hint": true,
1037
+ "open_world_hint": false
924
1038
  }
925
1039
  },
926
1040
  {
@@ -985,6 +1099,12 @@
985
1099
  ],
986
1100
  "body": false,
987
1101
  "fixed_query": {}
1102
+ },
1103
+ "annotations": {
1104
+ "read_only_hint": true,
1105
+ "destructive_hint": false,
1106
+ "idempotent_hint": true,
1107
+ "open_world_hint": false
988
1108
  }
989
1109
  },
990
1110
  {
@@ -1043,6 +1163,12 @@
1043
1163
  "query": [],
1044
1164
  "body": true,
1045
1165
  "fixed_query": {}
1166
+ },
1167
+ "annotations": {
1168
+ "read_only_hint": false,
1169
+ "destructive_hint": false,
1170
+ "idempotent_hint": false,
1171
+ "open_world_hint": false
1046
1172
  }
1047
1173
  },
1048
1174
  {
@@ -1072,6 +1198,12 @@
1072
1198
  "query": [],
1073
1199
  "body": false,
1074
1200
  "fixed_query": {}
1201
+ },
1202
+ "annotations": {
1203
+ "read_only_hint": true,
1204
+ "destructive_hint": false,
1205
+ "idempotent_hint": true,
1206
+ "open_world_hint": false
1075
1207
  }
1076
1208
  },
1077
1209
  {
@@ -1134,6 +1266,12 @@
1134
1266
  "query": [],
1135
1267
  "body": true,
1136
1268
  "fixed_query": {}
1269
+ },
1270
+ "annotations": {
1271
+ "read_only_hint": false,
1272
+ "destructive_hint": false,
1273
+ "idempotent_hint": true,
1274
+ "open_world_hint": false
1137
1275
  }
1138
1276
  },
1139
1277
  {
@@ -1163,6 +1301,12 @@
1163
1301
  "query": [],
1164
1302
  "body": false,
1165
1303
  "fixed_query": {}
1304
+ },
1305
+ "annotations": {
1306
+ "read_only_hint": false,
1307
+ "destructive_hint": false,
1308
+ "idempotent_hint": true,
1309
+ "open_world_hint": false
1166
1310
  }
1167
1311
  },
1168
1312
  {
@@ -1192,6 +1336,12 @@
1192
1336
  "query": [],
1193
1337
  "body": false,
1194
1338
  "fixed_query": {}
1339
+ },
1340
+ "annotations": {
1341
+ "read_only_hint": false,
1342
+ "destructive_hint": false,
1343
+ "idempotent_hint": true,
1344
+ "open_world_hint": false
1195
1345
  }
1196
1346
  },
1197
1347
  {
@@ -1221,12 +1371,18 @@
1221
1371
  "query": [],
1222
1372
  "body": false,
1223
1373
  "fixed_query": {}
1374
+ },
1375
+ "annotations": {
1376
+ "read_only_hint": false,
1377
+ "destructive_hint": true,
1378
+ "idempotent_hint": true,
1379
+ "open_world_hint": false
1224
1380
  }
1225
1381
  },
1226
1382
  {
1227
1383
  "name": "list_maintenance_windows",
1228
1384
  "title": "List maintenance windows",
1229
- "description": "List the organization's maintenance windows: each with id, name, enabled, scope (ORG or MONITOR), dtstart, duration_minutes, rrule, timezone, monitor_ids, created_at and next_occurrences (always empty here; get_maintenance_window fills it). The result is a page: items plus total, page, size and pages. All arguments are optional. page (integer, 1 or more, default 1) and size (integer, 1 to 100, default 25) select the page. q (string, up to 255 characters) matches a case-insensitive substring of the name. sort is created_at (the default, newest first) or name (alphabetical).",
1385
+ "description": "List the organization's maintenance windows: each with id, name, enabled, scope (ORG or MONITOR), dtstart, duration_minutes, rrule, timezone, monitor_ids and created_at (get_maintenance_window adds the upcoming occurrences). The result is a page: items plus total, page, size and pages. All arguments are optional. page (integer, 1 or more, default 1) and size (integer, 1 to 100, default 25) select the page. q (string, up to 255 characters) matches a case-insensitive substring of the name. sort is created_at (the default, newest first) or name (alphabetical).",
1230
1386
  "scope": "read",
1231
1387
  "input_schema": {
1232
1388
  "type": "object",
@@ -1267,6 +1423,12 @@
1267
1423
  ],
1268
1424
  "body": false,
1269
1425
  "fixed_query": {}
1426
+ },
1427
+ "annotations": {
1428
+ "read_only_hint": true,
1429
+ "destructive_hint": false,
1430
+ "idempotent_hint": true,
1431
+ "open_world_hint": false
1270
1432
  }
1271
1433
  },
1272
1434
  {
@@ -1287,12 +1449,18 @@
1287
1449
  "query": [],
1288
1450
  "body": false,
1289
1451
  "fixed_query": {}
1452
+ },
1453
+ "annotations": {
1454
+ "read_only_hint": true,
1455
+ "destructive_hint": false,
1456
+ "idempotent_hint": true,
1457
+ "open_world_hint": false
1290
1458
  }
1291
1459
  },
1292
1460
  {
1293
1461
  "name": "get_maintenance_window",
1294
1462
  "title": "Get a maintenance window",
1295
- "description": "Return one maintenance window, in the list_maintenance_windows shape, with next_occurrences filled in (the next three, each with start and end). window_id (uuid, required) is the window's id from list_maintenance_windows; an id that is not a window of this organization is a 404.",
1463
+ "description": "Return one maintenance window, in the list_maintenance_windows shape plus next_occurrences (the next three, each with start and end). window_id (uuid, required) is the window's id from list_maintenance_windows; an id that is not a window of this organization is a 404.",
1296
1464
  "scope": "read",
1297
1465
  "input_schema": {
1298
1466
  "type": "object",
@@ -1316,6 +1484,12 @@
1316
1484
  "query": [],
1317
1485
  "body": false,
1318
1486
  "fixed_query": {}
1487
+ },
1488
+ "annotations": {
1489
+ "read_only_hint": true,
1490
+ "destructive_hint": false,
1491
+ "idempotent_hint": true,
1492
+ "open_world_hint": false
1319
1493
  }
1320
1494
  },
1321
1495
  {
@@ -1381,6 +1555,12 @@
1381
1555
  "query": [],
1382
1556
  "body": true,
1383
1557
  "fixed_query": {}
1558
+ },
1559
+ "annotations": {
1560
+ "read_only_hint": false,
1561
+ "destructive_hint": false,
1562
+ "idempotent_hint": false,
1563
+ "open_world_hint": false
1384
1564
  }
1385
1565
  },
1386
1566
  {
@@ -1449,6 +1629,12 @@
1449
1629
  "query": [],
1450
1630
  "body": true,
1451
1631
  "fixed_query": {}
1632
+ },
1633
+ "annotations": {
1634
+ "read_only_hint": false,
1635
+ "destructive_hint": false,
1636
+ "idempotent_hint": true,
1637
+ "open_world_hint": false
1452
1638
  }
1453
1639
  },
1454
1640
  {
@@ -1478,6 +1664,12 @@
1478
1664
  "query": [],
1479
1665
  "body": false,
1480
1666
  "fixed_query": {}
1667
+ },
1668
+ "annotations": {
1669
+ "read_only_hint": false,
1670
+ "destructive_hint": true,
1671
+ "idempotent_hint": true,
1672
+ "open_world_hint": false
1481
1673
  }
1482
1674
  },
1483
1675
  {
@@ -1519,6 +1711,12 @@
1519
1711
  "query": [],
1520
1712
  "body": true,
1521
1713
  "fixed_query": {}
1714
+ },
1715
+ "annotations": {
1716
+ "read_only_hint": true,
1717
+ "destructive_hint": false,
1718
+ "idempotent_hint": true,
1719
+ "open_world_hint": false
1522
1720
  }
1523
1721
  },
1524
1722
  {
@@ -1560,6 +1758,12 @@
1560
1758
  ],
1561
1759
  "body": false,
1562
1760
  "fixed_query": {}
1761
+ },
1762
+ "annotations": {
1763
+ "read_only_hint": true,
1764
+ "destructive_hint": false,
1765
+ "idempotent_hint": true,
1766
+ "open_world_hint": false
1563
1767
  }
1564
1768
  },
1565
1769
  {
@@ -1622,12 +1826,18 @@
1622
1826
  ],
1623
1827
  "body": false,
1624
1828
  "fixed_query": {}
1829
+ },
1830
+ "annotations": {
1831
+ "read_only_hint": true,
1832
+ "destructive_hint": false,
1833
+ "idempotent_hint": true,
1834
+ "open_world_hint": false
1625
1835
  }
1626
1836
  },
1627
1837
  {
1628
1838
  "name": "get_response_time_by_region",
1629
1839
  "title": "Get a monitor's response time by region",
1630
- "description": "Return a monitor's average response time over time, one series per region: monitor_id, window, bucket_seconds and regions, each with region, display_name and points. Every region the monitor is configured for has a series. points are oldest first and cover the whole window, each with bucket_start, avg_response_time_ms (null when the bucket had no successful check) and sample_count. Use it to see where a monitor is slow and since when. monitor_id (uuid, required) is the monitor's id from list_monitors; an id that is not a monitor of this organization (or a deleted one) is a 404. window (optional) is 24h (the default; 24 hourly buckets), 7d (28 six-hourly buckets) or 30d (30 daily buckets); any other value is a 422.",
1840
+ "description": "Return a monitor's average response time over time, one series per region: monitor_id, window, bucket_seconds and regions, each with region, display_name and points. Every region the monitor is configured for has a series, even one with no checks yet, followed by any region since removed from the monitor that still had checks in the window. points are oldest first, the same buckets in every series, each with bucket_start, avg_response_time_ms (null when the bucket had no successful check) and sample_count; they start at the window's start, or at the bucket the monitor was created in when it is younger than the window. Use it to see where a monitor is slow and since when. monitor_id (uuid, required) is the monitor's id from list_monitors; an id that is not a monitor of this organization (or a deleted one) is a 404. window (optional) is 24h (the default; up to 24 hourly buckets), 7d (up to 28 six-hourly buckets) or 30d (up to 30 daily buckets); any other value is a 422.",
1631
1841
  "scope": "read",
1632
1842
  "input_schema": {
1633
1843
  "type": "object",
@@ -1661,6 +1871,12 @@
1661
1871
  ],
1662
1872
  "body": false,
1663
1873
  "fixed_query": {}
1874
+ },
1875
+ "annotations": {
1876
+ "read_only_hint": true,
1877
+ "destructive_hint": false,
1878
+ "idempotent_hint": true,
1879
+ "open_world_hint": false
1664
1880
  }
1665
1881
  },
1666
1882
  {
@@ -1697,6 +1913,12 @@
1697
1913
  ],
1698
1914
  "body": false,
1699
1915
  "fixed_query": {}
1916
+ },
1917
+ "annotations": {
1918
+ "read_only_hint": true,
1919
+ "destructive_hint": false,
1920
+ "idempotent_hint": true,
1921
+ "open_world_hint": false
1700
1922
  }
1701
1923
  },
1702
1924
  {
@@ -1726,6 +1948,12 @@
1726
1948
  "query": [],
1727
1949
  "body": false,
1728
1950
  "fixed_query": {}
1951
+ },
1952
+ "annotations": {
1953
+ "read_only_hint": true,
1954
+ "destructive_hint": false,
1955
+ "idempotent_hint": true,
1956
+ "open_world_hint": false
1729
1957
  }
1730
1958
  },
1731
1959
  {
@@ -1758,6 +1986,12 @@
1758
1986
  "query": [],
1759
1987
  "body": true,
1760
1988
  "fixed_query": {}
1989
+ },
1990
+ "annotations": {
1991
+ "read_only_hint": false,
1992
+ "destructive_hint": false,
1993
+ "idempotent_hint": true,
1994
+ "open_world_hint": false
1761
1995
  }
1762
1996
  },
1763
1997
  {
@@ -1787,6 +2021,12 @@
1787
2021
  ],
1788
2022
  "body": false,
1789
2023
  "fixed_query": {}
2024
+ },
2025
+ "annotations": {
2026
+ "read_only_hint": false,
2027
+ "destructive_hint": true,
2028
+ "idempotent_hint": true,
2029
+ "open_world_hint": false
1790
2030
  }
1791
2031
  },
1792
2032
  {
@@ -1816,6 +2056,12 @@
1816
2056
  "query": [],
1817
2057
  "body": false,
1818
2058
  "fixed_query": {}
2059
+ },
2060
+ "annotations": {
2061
+ "read_only_hint": true,
2062
+ "destructive_hint": false,
2063
+ "idempotent_hint": true,
2064
+ "open_world_hint": false
1819
2065
  }
1820
2066
  },
1821
2067
  {
@@ -1857,6 +2103,12 @@
1857
2103
  ],
1858
2104
  "body": false,
1859
2105
  "fixed_query": {}
2106
+ },
2107
+ "annotations": {
2108
+ "read_only_hint": true,
2109
+ "destructive_hint": false,
2110
+ "idempotent_hint": true,
2111
+ "open_world_hint": false
1860
2112
  }
1861
2113
  },
1862
2114
  {
@@ -1914,6 +2166,12 @@
1914
2166
  "query": [],
1915
2167
  "body": true,
1916
2168
  "fixed_query": {}
2169
+ },
2170
+ "annotations": {
2171
+ "read_only_hint": false,
2172
+ "destructive_hint": false,
2173
+ "idempotent_hint": false,
2174
+ "open_world_hint": false
1917
2175
  }
1918
2176
  },
1919
2177
  {
@@ -1965,6 +2223,12 @@
1965
2223
  "query": [],
1966
2224
  "body": true,
1967
2225
  "fixed_query": {}
2226
+ },
2227
+ "annotations": {
2228
+ "read_only_hint": false,
2229
+ "destructive_hint": false,
2230
+ "idempotent_hint": false,
2231
+ "open_world_hint": false
1968
2232
  }
1969
2233
  },
1970
2234
  {
@@ -2006,6 +2270,12 @@
2006
2270
  "query": [],
2007
2271
  "body": true,
2008
2272
  "fixed_query": {}
2273
+ },
2274
+ "annotations": {
2275
+ "read_only_hint": false,
2276
+ "destructive_hint": false,
2277
+ "idempotent_hint": true,
2278
+ "open_world_hint": false
2009
2279
  }
2010
2280
  },
2011
2281
  {
@@ -2041,6 +2311,12 @@
2041
2311
  "query": [],
2042
2312
  "body": false,
2043
2313
  "fixed_query": {}
2314
+ },
2315
+ "annotations": {
2316
+ "read_only_hint": false,
2317
+ "destructive_hint": true,
2318
+ "idempotent_hint": true,
2319
+ "open_world_hint": false
2044
2320
  }
2045
2321
  },
2046
2322
  {
@@ -2061,6 +2337,12 @@
2061
2337
  "query": [],
2062
2338
  "body": false,
2063
2339
  "fixed_query": {}
2340
+ },
2341
+ "annotations": {
2342
+ "read_only_hint": true,
2343
+ "destructive_hint": false,
2344
+ "idempotent_hint": true,
2345
+ "open_world_hint": false
2064
2346
  }
2065
2347
  },
2066
2348
  {
@@ -2081,6 +2363,12 @@
2081
2363
  "query": [],
2082
2364
  "body": false,
2083
2365
  "fixed_query": {}
2366
+ },
2367
+ "annotations": {
2368
+ "read_only_hint": true,
2369
+ "destructive_hint": false,
2370
+ "idempotent_hint": true,
2371
+ "open_world_hint": false
2084
2372
  }
2085
2373
  },
2086
2374
  {
@@ -2124,6 +2412,12 @@
2124
2412
  "query": [],
2125
2413
  "body": true,
2126
2414
  "fixed_query": {}
2415
+ },
2416
+ "annotations": {
2417
+ "read_only_hint": true,
2418
+ "destructive_hint": false,
2419
+ "idempotent_hint": true,
2420
+ "open_world_hint": true
2127
2421
  }
2128
2422
  }
2129
2423
  ]
@@ -24,6 +24,16 @@ export interface ToolOperation {
24
24
  fixed_query: Record<string, string>;
25
25
  body: boolean;
26
26
  }
27
+ /**
28
+ * The MCP behaviour hints of one tool, as core writes them (snake_case).
29
+ * Core always sets all four: MCP reads a missing `destructiveHint` as true.
30
+ */
31
+ export interface ToolAnnotations {
32
+ read_only_hint: boolean;
33
+ destructive_hint: boolean;
34
+ idempotent_hint: boolean;
35
+ open_world_hint: boolean;
36
+ }
27
37
  /** One agent-facing tool. */
28
38
  export interface ToolEntry {
29
39
  name: string;
@@ -32,6 +42,8 @@ export interface ToolEntry {
32
42
  scope: "read" | "write";
33
43
  input_schema: Record<string, unknown>;
34
44
  operation: ToolOperation;
45
+ /** Absent in contracts generated before 0.5.0; the tool then goes out without hints. */
46
+ annotations?: ToolAnnotations;
35
47
  }
36
48
  /** The whole document. */
37
49
  export interface ToolContract {
package/dist/contract.js CHANGED
@@ -70,6 +70,34 @@ function assertOperation(operation, toolName) {
70
70
  body: candidate.body === true,
71
71
  };
72
72
  }
73
+ const ANNOTATION_KEYS = [
74
+ "read_only_hint",
75
+ "destructive_hint",
76
+ "idempotent_hint",
77
+ "open_world_hint",
78
+ ];
79
+ /**
80
+ * Check a tool's hints. A half-written hint object is refused rather than
81
+ * patched up: a dropped `destructive_hint` would silently tell clients that a
82
+ * delete is safe, or that every write is dangerous.
83
+ */
84
+ function assertAnnotations(raw, name) {
85
+ if (typeof raw !== "object" || raw === null) {
86
+ fail(`tool '${name}' has annotations that are not an object.`);
87
+ }
88
+ const candidate = raw;
89
+ for (const key of ANNOTATION_KEYS) {
90
+ if (typeof candidate[key] !== "boolean") {
91
+ fail(`tool '${name}' has no boolean annotations.${key}.`);
92
+ }
93
+ }
94
+ return {
95
+ read_only_hint: candidate.read_only_hint,
96
+ destructive_hint: candidate.destructive_hint,
97
+ idempotent_hint: candidate.idempotent_hint,
98
+ open_world_hint: candidate.open_world_hint,
99
+ };
100
+ }
73
101
  /**
74
102
  * Validate a parsed contract document.
75
103
  *
@@ -107,7 +135,7 @@ export function parseContract(raw) {
107
135
  if (typeof candidate.input_schema !== "object" || candidate.input_schema === null) {
108
136
  fail(`tool '${name}' has no input_schema.`);
109
137
  }
110
- return {
138
+ const tool = {
111
139
  name,
112
140
  title: typeof candidate.title === "string" ? candidate.title : name,
113
141
  description: typeof candidate.description === "string" ? candidate.description : "",
@@ -115,6 +143,10 @@ export function parseContract(raw) {
115
143
  input_schema: candidate.input_schema,
116
144
  operation: assertOperation(candidate.operation, name),
117
145
  };
146
+ if (candidate.annotations !== undefined) {
147
+ tool.annotations = assertAnnotations(candidate.annotations, name);
148
+ }
149
+ return tool;
118
150
  });
119
151
  // Core's generator always writes the field and uses "" for "no guide", so
120
152
  // an empty string is the same as absent: refusing to start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AsB,EAAE,IAAY;IAC3D,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC3D,CAAC"}
package/dist/server.js CHANGED
@@ -16,17 +16,29 @@ import { compileValidators, describeSchemaErrors } from "./validation.js";
16
16
  * Render the contract as MCP tool descriptors.
17
17
  *
18
18
  * `inputSchema` is the wire-format camelCase key; the contract stores the same
19
- * data under the snake_case `input_schema` it was generated with. The schema
19
+ * data under the snake_case `input_schema` it was generated with, and its
20
+ * snake_case `annotations` become the camelCase hint keys. The schema
20
21
  * is passed through untouched — this package must not develop a second opinion
21
22
  * about what a tool's arguments look like.
22
23
  */
23
24
  function toWireTools(contract) {
24
- return contract.tools.map((tool) => ({
25
- name: tool.name,
26
- title: tool.title,
27
- description: tool.description,
28
- inputSchema: tool.input_schema,
29
- }));
25
+ return contract.tools.map((tool) => {
26
+ const wire = {
27
+ name: tool.name,
28
+ title: tool.title,
29
+ description: tool.description,
30
+ inputSchema: tool.input_schema,
31
+ };
32
+ if (tool.annotations !== undefined) {
33
+ wire.annotations = {
34
+ readOnlyHint: tool.annotations.read_only_hint,
35
+ destructiveHint: tool.annotations.destructive_hint,
36
+ idempotentHint: tool.annotations.idempotent_hint,
37
+ openWorldHint: tool.annotations.open_world_hint,
38
+ };
39
+ }
40
+ return wire;
41
+ });
30
42
  }
31
43
  /**
32
44
  * Build the MCP server.
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,qBAAqB,EAErB,SAAS,EACT,sBAAsB,EACtB,QAAQ,GAET,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAqB,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,iBAAiB,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,KAAK,YAAY,iBAAiB,EAAE,CAAC;gBACvC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAC7E,CAAC;YACD,IAAI,KAAK,YAAY,iBAAiB,EAAE,CAAC;gBACvC,MAAM,IAAI,QAAQ,CAAC,SAAS,CAAC,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YAC7D,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fettle-mcp",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "mcpName": "sh.fettle/mcp",
5
5
  "description": "MCP server for Fettle (fettle.sh) uptime monitoring — manage monitors, incidents, heartbeats, maintenance windows and status pages from any MCP client.",
6
6
  "keywords": [