@thelord/mcp-arr 1.4.0 → 1.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/dist/arr-client.d.ts +177 -3
- package/dist/arr-client.d.ts.map +1 -1
- package/dist/arr-client.js +162 -4
- package/dist/arr-client.js.map +1 -1
- package/dist/index.js +603 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1272,6 +1272,260 @@ if (clients.prowlarr) {
|
|
|
1272
1272
|
properties: {},
|
|
1273
1273
|
required: [],
|
|
1274
1274
|
},
|
|
1275
|
+
}, {
|
|
1276
|
+
name: "prowlarr_get_indexer",
|
|
1277
|
+
description: "Get a specific indexer by ID",
|
|
1278
|
+
inputSchema: {
|
|
1279
|
+
type: "object",
|
|
1280
|
+
properties: {
|
|
1281
|
+
indexerId: {
|
|
1282
|
+
type: "number",
|
|
1283
|
+
description: "Indexer ID",
|
|
1284
|
+
},
|
|
1285
|
+
},
|
|
1286
|
+
required: ["indexerId"],
|
|
1287
|
+
},
|
|
1288
|
+
}, {
|
|
1289
|
+
name: "prowlarr_update_indexer",
|
|
1290
|
+
description: "Update an indexer (enable/disable, priority, tags)",
|
|
1291
|
+
inputSchema: {
|
|
1292
|
+
type: "object",
|
|
1293
|
+
properties: {
|
|
1294
|
+
indexerId: {
|
|
1295
|
+
type: "number",
|
|
1296
|
+
description: "Indexer ID to update",
|
|
1297
|
+
},
|
|
1298
|
+
enable: {
|
|
1299
|
+
type: "boolean",
|
|
1300
|
+
description: "Enable or disable the indexer",
|
|
1301
|
+
},
|
|
1302
|
+
priority: {
|
|
1303
|
+
type: "number",
|
|
1304
|
+
description: "Indexer priority (1-50, lower is higher priority)",
|
|
1305
|
+
},
|
|
1306
|
+
tags: {
|
|
1307
|
+
type: "array",
|
|
1308
|
+
items: { type: "number" },
|
|
1309
|
+
description: "Tag IDs to apply",
|
|
1310
|
+
},
|
|
1311
|
+
},
|
|
1312
|
+
required: ["indexerId"],
|
|
1313
|
+
},
|
|
1314
|
+
}, {
|
|
1315
|
+
name: "prowlarr_delete_indexer",
|
|
1316
|
+
description: "Delete an indexer from Prowlarr",
|
|
1317
|
+
inputSchema: {
|
|
1318
|
+
type: "object",
|
|
1319
|
+
properties: {
|
|
1320
|
+
indexerId: {
|
|
1321
|
+
type: "number",
|
|
1322
|
+
description: "Indexer ID to delete",
|
|
1323
|
+
},
|
|
1324
|
+
},
|
|
1325
|
+
required: ["indexerId"],
|
|
1326
|
+
},
|
|
1327
|
+
}, {
|
|
1328
|
+
name: "prowlarr_test_indexer",
|
|
1329
|
+
description: "Test a specific indexer connection",
|
|
1330
|
+
inputSchema: {
|
|
1331
|
+
type: "object",
|
|
1332
|
+
properties: {
|
|
1333
|
+
indexerId: {
|
|
1334
|
+
type: "number",
|
|
1335
|
+
description: "Indexer ID to test",
|
|
1336
|
+
},
|
|
1337
|
+
},
|
|
1338
|
+
required: ["indexerId"],
|
|
1339
|
+
},
|
|
1340
|
+
}, {
|
|
1341
|
+
name: "prowlarr_get_applications",
|
|
1342
|
+
description: "Get all applications (Sonarr, Radarr, etc. connections)",
|
|
1343
|
+
inputSchema: {
|
|
1344
|
+
type: "object",
|
|
1345
|
+
properties: {},
|
|
1346
|
+
required: [],
|
|
1347
|
+
},
|
|
1348
|
+
}, {
|
|
1349
|
+
name: "prowlarr_get_application",
|
|
1350
|
+
description: "Get a specific application by ID",
|
|
1351
|
+
inputSchema: {
|
|
1352
|
+
type: "object",
|
|
1353
|
+
properties: {
|
|
1354
|
+
applicationId: {
|
|
1355
|
+
type: "number",
|
|
1356
|
+
description: "Application ID",
|
|
1357
|
+
},
|
|
1358
|
+
},
|
|
1359
|
+
required: ["applicationId"],
|
|
1360
|
+
},
|
|
1361
|
+
}, {
|
|
1362
|
+
name: "prowlarr_update_application",
|
|
1363
|
+
description: "Update an application connection",
|
|
1364
|
+
inputSchema: {
|
|
1365
|
+
type: "object",
|
|
1366
|
+
properties: {
|
|
1367
|
+
applicationId: {
|
|
1368
|
+
type: "number",
|
|
1369
|
+
description: "Application ID to update",
|
|
1370
|
+
},
|
|
1371
|
+
syncLevel: {
|
|
1372
|
+
type: "string",
|
|
1373
|
+
description: "Sync level: disabled, addOnly, fullSync",
|
|
1374
|
+
},
|
|
1375
|
+
tags: {
|
|
1376
|
+
type: "array",
|
|
1377
|
+
items: { type: "number" },
|
|
1378
|
+
description: "Tag IDs to apply",
|
|
1379
|
+
},
|
|
1380
|
+
},
|
|
1381
|
+
required: ["applicationId"],
|
|
1382
|
+
},
|
|
1383
|
+
}, {
|
|
1384
|
+
name: "prowlarr_delete_application",
|
|
1385
|
+
description: "Delete an application from Prowlarr",
|
|
1386
|
+
inputSchema: {
|
|
1387
|
+
type: "object",
|
|
1388
|
+
properties: {
|
|
1389
|
+
applicationId: {
|
|
1390
|
+
type: "number",
|
|
1391
|
+
description: "Application ID to delete",
|
|
1392
|
+
},
|
|
1393
|
+
},
|
|
1394
|
+
required: ["applicationId"],
|
|
1395
|
+
},
|
|
1396
|
+
}, {
|
|
1397
|
+
name: "prowlarr_test_application",
|
|
1398
|
+
description: "Test an application connection",
|
|
1399
|
+
inputSchema: {
|
|
1400
|
+
type: "object",
|
|
1401
|
+
properties: {
|
|
1402
|
+
applicationId: {
|
|
1403
|
+
type: "number",
|
|
1404
|
+
description: "Application ID to test",
|
|
1405
|
+
},
|
|
1406
|
+
},
|
|
1407
|
+
required: ["applicationId"],
|
|
1408
|
+
},
|
|
1409
|
+
}, {
|
|
1410
|
+
name: "prowlarr_sync_applications",
|
|
1411
|
+
description: "Sync indexers to all applications (push indexer config to Sonarr/Radarr/etc.)",
|
|
1412
|
+
inputSchema: {
|
|
1413
|
+
type: "object",
|
|
1414
|
+
properties: {},
|
|
1415
|
+
required: [],
|
|
1416
|
+
},
|
|
1417
|
+
}, {
|
|
1418
|
+
name: "prowlarr_get_app_profiles",
|
|
1419
|
+
description: "Get app sync profiles (control which indexers sync to which apps)",
|
|
1420
|
+
inputSchema: {
|
|
1421
|
+
type: "object",
|
|
1422
|
+
properties: {},
|
|
1423
|
+
required: [],
|
|
1424
|
+
},
|
|
1425
|
+
}, {
|
|
1426
|
+
name: "prowlarr_get_history",
|
|
1427
|
+
description: "Get Prowlarr history (searches, grabs, failures)",
|
|
1428
|
+
inputSchema: {
|
|
1429
|
+
type: "object",
|
|
1430
|
+
properties: {
|
|
1431
|
+
page: {
|
|
1432
|
+
type: "number",
|
|
1433
|
+
description: "Page number (default: 1)",
|
|
1434
|
+
},
|
|
1435
|
+
pageSize: {
|
|
1436
|
+
type: "number",
|
|
1437
|
+
description: "Items per page (default: 20)",
|
|
1438
|
+
},
|
|
1439
|
+
indexerId: {
|
|
1440
|
+
type: "number",
|
|
1441
|
+
description: "Filter by indexer ID",
|
|
1442
|
+
},
|
|
1443
|
+
},
|
|
1444
|
+
required: [],
|
|
1445
|
+
},
|
|
1446
|
+
}, {
|
|
1447
|
+
name: "prowlarr_get_tags",
|
|
1448
|
+
description: "Get all tags defined in Prowlarr",
|
|
1449
|
+
inputSchema: {
|
|
1450
|
+
type: "object",
|
|
1451
|
+
properties: {},
|
|
1452
|
+
required: [],
|
|
1453
|
+
},
|
|
1454
|
+
}, {
|
|
1455
|
+
name: "prowlarr_create_tag",
|
|
1456
|
+
description: "Create a new tag in Prowlarr",
|
|
1457
|
+
inputSchema: {
|
|
1458
|
+
type: "object",
|
|
1459
|
+
properties: {
|
|
1460
|
+
label: {
|
|
1461
|
+
type: "string",
|
|
1462
|
+
description: "Tag label/name",
|
|
1463
|
+
},
|
|
1464
|
+
},
|
|
1465
|
+
required: ["label"],
|
|
1466
|
+
},
|
|
1467
|
+
}, {
|
|
1468
|
+
name: "prowlarr_update_tag",
|
|
1469
|
+
description: "Update a tag label in Prowlarr",
|
|
1470
|
+
inputSchema: {
|
|
1471
|
+
type: "object",
|
|
1472
|
+
properties: {
|
|
1473
|
+
tagId: {
|
|
1474
|
+
type: "number",
|
|
1475
|
+
description: "Tag ID to update",
|
|
1476
|
+
},
|
|
1477
|
+
label: {
|
|
1478
|
+
type: "string",
|
|
1479
|
+
description: "New tag label",
|
|
1480
|
+
},
|
|
1481
|
+
},
|
|
1482
|
+
required: ["tagId", "label"],
|
|
1483
|
+
},
|
|
1484
|
+
}, {
|
|
1485
|
+
name: "prowlarr_delete_tag",
|
|
1486
|
+
description: "Delete a tag from Prowlarr",
|
|
1487
|
+
inputSchema: {
|
|
1488
|
+
type: "object",
|
|
1489
|
+
properties: {
|
|
1490
|
+
tagId: {
|
|
1491
|
+
type: "number",
|
|
1492
|
+
description: "Tag ID to delete",
|
|
1493
|
+
},
|
|
1494
|
+
},
|
|
1495
|
+
required: ["tagId"],
|
|
1496
|
+
},
|
|
1497
|
+
}, {
|
|
1498
|
+
name: "prowlarr_get_indexer_schemas",
|
|
1499
|
+
description: "Get available indexer schemas (templates for adding new indexers)",
|
|
1500
|
+
inputSchema: {
|
|
1501
|
+
type: "object",
|
|
1502
|
+
properties: {},
|
|
1503
|
+
required: [],
|
|
1504
|
+
},
|
|
1505
|
+
}, {
|
|
1506
|
+
name: "prowlarr_get_notifications",
|
|
1507
|
+
description: "Get configured notification connections",
|
|
1508
|
+
inputSchema: {
|
|
1509
|
+
type: "object",
|
|
1510
|
+
properties: {},
|
|
1511
|
+
required: [],
|
|
1512
|
+
},
|
|
1513
|
+
}, {
|
|
1514
|
+
name: "prowlarr_rss_sync",
|
|
1515
|
+
description: "Trigger RSS sync for all indexers",
|
|
1516
|
+
inputSchema: {
|
|
1517
|
+
type: "object",
|
|
1518
|
+
properties: {},
|
|
1519
|
+
required: [],
|
|
1520
|
+
},
|
|
1521
|
+
}, {
|
|
1522
|
+
name: "prowlarr_get_download_clients",
|
|
1523
|
+
description: "Get configured download clients",
|
|
1524
|
+
inputSchema: {
|
|
1525
|
+
type: "object",
|
|
1526
|
+
properties: {},
|
|
1527
|
+
required: [],
|
|
1528
|
+
},
|
|
1275
1529
|
});
|
|
1276
1530
|
}
|
|
1277
1531
|
// Lingarr tools - imported from separate module to reduce merge conflicts
|
|
@@ -3137,7 +3391,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3137
3391
|
case "prowlarr_get_indexers": {
|
|
3138
3392
|
if (!clients.prowlarr)
|
|
3139
3393
|
throw new Error("Prowlarr not configured");
|
|
3140
|
-
const indexers = await clients.prowlarr.
|
|
3394
|
+
const indexers = await clients.prowlarr.getProwlarrIndexers();
|
|
3141
3395
|
return {
|
|
3142
3396
|
content: [{
|
|
3143
3397
|
type: "text",
|
|
@@ -3147,9 +3401,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3147
3401
|
id: i.id,
|
|
3148
3402
|
name: i.name,
|
|
3149
3403
|
protocol: i.protocol,
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3404
|
+
enable: i.enable,
|
|
3405
|
+
supportsRss: i.supportsRss,
|
|
3406
|
+
supportsSearch: i.supportsSearch,
|
|
3153
3407
|
priority: i.priority,
|
|
3154
3408
|
})),
|
|
3155
3409
|
}, null, 2),
|
|
@@ -3169,7 +3423,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3169
3423
|
if (!clients.prowlarr)
|
|
3170
3424
|
throw new Error("Prowlarr not configured");
|
|
3171
3425
|
const results = await clients.prowlarr.testAllIndexers();
|
|
3172
|
-
const indexers = await clients.prowlarr.
|
|
3426
|
+
const indexers = await clients.prowlarr.getProwlarrIndexers();
|
|
3173
3427
|
const indexerMap = new Map(indexers.map(i => [i.id, i.name]));
|
|
3174
3428
|
return {
|
|
3175
3429
|
content: [{
|
|
@@ -3215,6 +3469,350 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3215
3469
|
}],
|
|
3216
3470
|
};
|
|
3217
3471
|
}
|
|
3472
|
+
case "prowlarr_get_indexer": {
|
|
3473
|
+
if (!clients.prowlarr)
|
|
3474
|
+
throw new Error("Prowlarr not configured");
|
|
3475
|
+
const { indexerId } = args;
|
|
3476
|
+
const indexer = await clients.prowlarr.getIndexerById(indexerId);
|
|
3477
|
+
return {
|
|
3478
|
+
content: [{
|
|
3479
|
+
type: "text",
|
|
3480
|
+
text: JSON.stringify(indexer, null, 2),
|
|
3481
|
+
}],
|
|
3482
|
+
};
|
|
3483
|
+
}
|
|
3484
|
+
case "prowlarr_update_indexer": {
|
|
3485
|
+
if (!clients.prowlarr)
|
|
3486
|
+
throw new Error("Prowlarr not configured");
|
|
3487
|
+
const { indexerId, enable, priority, tags } = args;
|
|
3488
|
+
const updates = {};
|
|
3489
|
+
if (enable !== undefined)
|
|
3490
|
+
updates.enable = enable;
|
|
3491
|
+
if (priority !== undefined)
|
|
3492
|
+
updates.priority = priority;
|
|
3493
|
+
if (tags !== undefined)
|
|
3494
|
+
updates.tags = tags;
|
|
3495
|
+
const updated = await clients.prowlarr.updateIndexer(indexerId, updates);
|
|
3496
|
+
return {
|
|
3497
|
+
content: [{
|
|
3498
|
+
type: "text",
|
|
3499
|
+
text: JSON.stringify({
|
|
3500
|
+
success: true,
|
|
3501
|
+
indexer: {
|
|
3502
|
+
id: updated.id,
|
|
3503
|
+
name: updated.name,
|
|
3504
|
+
enable: updated.enable,
|
|
3505
|
+
priority: updated.priority,
|
|
3506
|
+
tags: updated.tags,
|
|
3507
|
+
},
|
|
3508
|
+
}, null, 2),
|
|
3509
|
+
}],
|
|
3510
|
+
};
|
|
3511
|
+
}
|
|
3512
|
+
case "prowlarr_delete_indexer": {
|
|
3513
|
+
if (!clients.prowlarr)
|
|
3514
|
+
throw new Error("Prowlarr not configured");
|
|
3515
|
+
const { indexerId } = args;
|
|
3516
|
+
await clients.prowlarr.deleteIndexer(indexerId);
|
|
3517
|
+
return {
|
|
3518
|
+
content: [{
|
|
3519
|
+
type: "text",
|
|
3520
|
+
text: JSON.stringify({ success: true, message: `Indexer ${indexerId} deleted` }, null, 2),
|
|
3521
|
+
}],
|
|
3522
|
+
};
|
|
3523
|
+
}
|
|
3524
|
+
case "prowlarr_test_indexer": {
|
|
3525
|
+
if (!clients.prowlarr)
|
|
3526
|
+
throw new Error("Prowlarr not configured");
|
|
3527
|
+
const { indexerId } = args;
|
|
3528
|
+
const result = await clients.prowlarr.testIndexer(indexerId);
|
|
3529
|
+
const indexer = await clients.prowlarr.getIndexerById(indexerId);
|
|
3530
|
+
return {
|
|
3531
|
+
content: [{
|
|
3532
|
+
type: "text",
|
|
3533
|
+
text: JSON.stringify({
|
|
3534
|
+
id: indexerId,
|
|
3535
|
+
name: indexer.name,
|
|
3536
|
+
isValid: result.isValid,
|
|
3537
|
+
errors: result.validationFailures.map(f => f.errorMessage),
|
|
3538
|
+
}, null, 2),
|
|
3539
|
+
}],
|
|
3540
|
+
};
|
|
3541
|
+
}
|
|
3542
|
+
case "prowlarr_get_applications": {
|
|
3543
|
+
if (!clients.prowlarr)
|
|
3544
|
+
throw new Error("Prowlarr not configured");
|
|
3545
|
+
const apps = await clients.prowlarr.getApplications();
|
|
3546
|
+
return {
|
|
3547
|
+
content: [{
|
|
3548
|
+
type: "text",
|
|
3549
|
+
text: JSON.stringify({
|
|
3550
|
+
count: apps.length,
|
|
3551
|
+
applications: apps.map(a => ({
|
|
3552
|
+
id: a.id,
|
|
3553
|
+
name: a.name,
|
|
3554
|
+
implementation: a.implementation,
|
|
3555
|
+
syncLevel: a.syncLevel,
|
|
3556
|
+
tags: a.tags,
|
|
3557
|
+
})),
|
|
3558
|
+
}, null, 2),
|
|
3559
|
+
}],
|
|
3560
|
+
};
|
|
3561
|
+
}
|
|
3562
|
+
case "prowlarr_get_application": {
|
|
3563
|
+
if (!clients.prowlarr)
|
|
3564
|
+
throw new Error("Prowlarr not configured");
|
|
3565
|
+
const { applicationId } = args;
|
|
3566
|
+
const app = await clients.prowlarr.getApplicationById(applicationId);
|
|
3567
|
+
return {
|
|
3568
|
+
content: [{
|
|
3569
|
+
type: "text",
|
|
3570
|
+
text: JSON.stringify(app, null, 2),
|
|
3571
|
+
}],
|
|
3572
|
+
};
|
|
3573
|
+
}
|
|
3574
|
+
case "prowlarr_update_application": {
|
|
3575
|
+
if (!clients.prowlarr)
|
|
3576
|
+
throw new Error("Prowlarr not configured");
|
|
3577
|
+
const { applicationId, syncLevel, tags } = args;
|
|
3578
|
+
const updates = {};
|
|
3579
|
+
if (syncLevel !== undefined)
|
|
3580
|
+
updates.syncLevel = syncLevel;
|
|
3581
|
+
if (tags !== undefined)
|
|
3582
|
+
updates.tags = tags;
|
|
3583
|
+
const updated = await clients.prowlarr.updateApplication(applicationId, updates);
|
|
3584
|
+
return {
|
|
3585
|
+
content: [{
|
|
3586
|
+
type: "text",
|
|
3587
|
+
text: JSON.stringify({
|
|
3588
|
+
success: true,
|
|
3589
|
+
application: {
|
|
3590
|
+
id: updated.id,
|
|
3591
|
+
name: updated.name,
|
|
3592
|
+
syncLevel: updated.syncLevel,
|
|
3593
|
+
tags: updated.tags,
|
|
3594
|
+
},
|
|
3595
|
+
}, null, 2),
|
|
3596
|
+
}],
|
|
3597
|
+
};
|
|
3598
|
+
}
|
|
3599
|
+
case "prowlarr_delete_application": {
|
|
3600
|
+
if (!clients.prowlarr)
|
|
3601
|
+
throw new Error("Prowlarr not configured");
|
|
3602
|
+
const { applicationId } = args;
|
|
3603
|
+
await clients.prowlarr.deleteApplication(applicationId);
|
|
3604
|
+
return {
|
|
3605
|
+
content: [{
|
|
3606
|
+
type: "text",
|
|
3607
|
+
text: JSON.stringify({ success: true, message: `Application ${applicationId} deleted` }, null, 2),
|
|
3608
|
+
}],
|
|
3609
|
+
};
|
|
3610
|
+
}
|
|
3611
|
+
case "prowlarr_test_application": {
|
|
3612
|
+
if (!clients.prowlarr)
|
|
3613
|
+
throw new Error("Prowlarr not configured");
|
|
3614
|
+
const { applicationId } = args;
|
|
3615
|
+
const result = await clients.prowlarr.testApplication(applicationId);
|
|
3616
|
+
const app = await clients.prowlarr.getApplicationById(applicationId);
|
|
3617
|
+
return {
|
|
3618
|
+
content: [{
|
|
3619
|
+
type: "text",
|
|
3620
|
+
text: JSON.stringify({
|
|
3621
|
+
id: applicationId,
|
|
3622
|
+
name: app.name,
|
|
3623
|
+
isValid: result.isValid,
|
|
3624
|
+
errors: result.validationFailures.map(f => f.errorMessage),
|
|
3625
|
+
}, null, 2),
|
|
3626
|
+
}],
|
|
3627
|
+
};
|
|
3628
|
+
}
|
|
3629
|
+
case "prowlarr_sync_applications": {
|
|
3630
|
+
if (!clients.prowlarr)
|
|
3631
|
+
throw new Error("Prowlarr not configured");
|
|
3632
|
+
const result = await clients.prowlarr.syncApplications();
|
|
3633
|
+
return {
|
|
3634
|
+
content: [{
|
|
3635
|
+
type: "text",
|
|
3636
|
+
text: JSON.stringify({
|
|
3637
|
+
success: true,
|
|
3638
|
+
message: "Application indexer sync triggered",
|
|
3639
|
+
commandId: result.id,
|
|
3640
|
+
}, null, 2),
|
|
3641
|
+
}],
|
|
3642
|
+
};
|
|
3643
|
+
}
|
|
3644
|
+
case "prowlarr_get_app_profiles": {
|
|
3645
|
+
if (!clients.prowlarr)
|
|
3646
|
+
throw new Error("Prowlarr not configured");
|
|
3647
|
+
const profiles = await clients.prowlarr.getAppProfiles();
|
|
3648
|
+
return {
|
|
3649
|
+
content: [{
|
|
3650
|
+
type: "text",
|
|
3651
|
+
text: JSON.stringify({
|
|
3652
|
+
count: profiles.length,
|
|
3653
|
+
profiles: profiles.map(p => ({
|
|
3654
|
+
id: p.id,
|
|
3655
|
+
name: p.name,
|
|
3656
|
+
enableRss: p.enableRss,
|
|
3657
|
+
enableAutomaticSearch: p.enableAutomaticSearch,
|
|
3658
|
+
enableInteractiveSearch: p.enableInteractiveSearch,
|
|
3659
|
+
minimumSeeders: p.minimumSeeders,
|
|
3660
|
+
})),
|
|
3661
|
+
}, null, 2),
|
|
3662
|
+
}],
|
|
3663
|
+
};
|
|
3664
|
+
}
|
|
3665
|
+
case "prowlarr_get_history": {
|
|
3666
|
+
if (!clients.prowlarr)
|
|
3667
|
+
throw new Error("Prowlarr not configured");
|
|
3668
|
+
const { page, pageSize, indexerId } = args;
|
|
3669
|
+
let history;
|
|
3670
|
+
if (indexerId) {
|
|
3671
|
+
const records = await clients.prowlarr.getIndexerHistory(indexerId);
|
|
3672
|
+
history = { records, totalRecords: records.length };
|
|
3673
|
+
}
|
|
3674
|
+
else {
|
|
3675
|
+
history = await clients.prowlarr.getHistory(page || 1, pageSize || 20);
|
|
3676
|
+
}
|
|
3677
|
+
return {
|
|
3678
|
+
content: [{
|
|
3679
|
+
type: "text",
|
|
3680
|
+
text: JSON.stringify({
|
|
3681
|
+
totalRecords: history.totalRecords,
|
|
3682
|
+
records: history.records.map((r) => ({
|
|
3683
|
+
id: r.id,
|
|
3684
|
+
indexerId: r.indexerId,
|
|
3685
|
+
eventType: r.eventType,
|
|
3686
|
+
successful: r.successful,
|
|
3687
|
+
date: r.date,
|
|
3688
|
+
query: r.data?.query,
|
|
3689
|
+
})),
|
|
3690
|
+
}, null, 2),
|
|
3691
|
+
}],
|
|
3692
|
+
};
|
|
3693
|
+
}
|
|
3694
|
+
case "prowlarr_get_tags": {
|
|
3695
|
+
if (!clients.prowlarr)
|
|
3696
|
+
throw new Error("Prowlarr not configured");
|
|
3697
|
+
const tags = await clients.prowlarr.getTags();
|
|
3698
|
+
return {
|
|
3699
|
+
content: [{
|
|
3700
|
+
type: "text",
|
|
3701
|
+
text: JSON.stringify({ count: tags.length, tags }, null, 2),
|
|
3702
|
+
}],
|
|
3703
|
+
};
|
|
3704
|
+
}
|
|
3705
|
+
case "prowlarr_create_tag": {
|
|
3706
|
+
if (!clients.prowlarr)
|
|
3707
|
+
throw new Error("Prowlarr not configured");
|
|
3708
|
+
const { label } = args;
|
|
3709
|
+
const tag = await clients.prowlarr.createTag(label);
|
|
3710
|
+
return {
|
|
3711
|
+
content: [{
|
|
3712
|
+
type: "text",
|
|
3713
|
+
text: JSON.stringify({ success: true, tag }, null, 2),
|
|
3714
|
+
}],
|
|
3715
|
+
};
|
|
3716
|
+
}
|
|
3717
|
+
case "prowlarr_update_tag": {
|
|
3718
|
+
if (!clients.prowlarr)
|
|
3719
|
+
throw new Error("Prowlarr not configured");
|
|
3720
|
+
const { tagId, label } = args;
|
|
3721
|
+
const tag = await clients.prowlarr.updateTag(tagId, label);
|
|
3722
|
+
return {
|
|
3723
|
+
content: [{
|
|
3724
|
+
type: "text",
|
|
3725
|
+
text: JSON.stringify({ success: true, tag }, null, 2),
|
|
3726
|
+
}],
|
|
3727
|
+
};
|
|
3728
|
+
}
|
|
3729
|
+
case "prowlarr_delete_tag": {
|
|
3730
|
+
if (!clients.prowlarr)
|
|
3731
|
+
throw new Error("Prowlarr not configured");
|
|
3732
|
+
const { tagId } = args;
|
|
3733
|
+
await clients.prowlarr.deleteTag(tagId);
|
|
3734
|
+
return {
|
|
3735
|
+
content: [{
|
|
3736
|
+
type: "text",
|
|
3737
|
+
text: JSON.stringify({ success: true, message: `Tag ${tagId} deleted` }, null, 2),
|
|
3738
|
+
}],
|
|
3739
|
+
};
|
|
3740
|
+
}
|
|
3741
|
+
case "prowlarr_get_indexer_schemas": {
|
|
3742
|
+
if (!clients.prowlarr)
|
|
3743
|
+
throw new Error("Prowlarr not configured");
|
|
3744
|
+
const schemas = await clients.prowlarr.getIndexerSchemas();
|
|
3745
|
+
return {
|
|
3746
|
+
content: [{
|
|
3747
|
+
type: "text",
|
|
3748
|
+
text: JSON.stringify({
|
|
3749
|
+
count: schemas.length,
|
|
3750
|
+
schemas: schemas.map(s => ({
|
|
3751
|
+
implementation: s.implementation,
|
|
3752
|
+
name: s.name,
|
|
3753
|
+
protocol: s.protocol,
|
|
3754
|
+
privacy: s.privacy,
|
|
3755
|
+
})),
|
|
3756
|
+
}, null, 2),
|
|
3757
|
+
}],
|
|
3758
|
+
};
|
|
3759
|
+
}
|
|
3760
|
+
case "prowlarr_get_notifications": {
|
|
3761
|
+
if (!clients.prowlarr)
|
|
3762
|
+
throw new Error("Prowlarr not configured");
|
|
3763
|
+
const notifications = await clients.prowlarr.getNotifications();
|
|
3764
|
+
return {
|
|
3765
|
+
content: [{
|
|
3766
|
+
type: "text",
|
|
3767
|
+
text: JSON.stringify({
|
|
3768
|
+
count: notifications.length,
|
|
3769
|
+
notifications: notifications.map(n => ({
|
|
3770
|
+
id: n.id,
|
|
3771
|
+
name: n.name,
|
|
3772
|
+
implementation: n.implementation,
|
|
3773
|
+
onHealthIssue: n.onHealthIssue,
|
|
3774
|
+
onApplicationUpdate: n.onApplicationUpdate,
|
|
3775
|
+
})),
|
|
3776
|
+
}, null, 2),
|
|
3777
|
+
}],
|
|
3778
|
+
};
|
|
3779
|
+
}
|
|
3780
|
+
case "prowlarr_rss_sync": {
|
|
3781
|
+
if (!clients.prowlarr)
|
|
3782
|
+
throw new Error("Prowlarr not configured");
|
|
3783
|
+
const result = await clients.prowlarr.rssSync();
|
|
3784
|
+
return {
|
|
3785
|
+
content: [{
|
|
3786
|
+
type: "text",
|
|
3787
|
+
text: JSON.stringify({
|
|
3788
|
+
success: true,
|
|
3789
|
+
message: "RSS sync triggered for all indexers",
|
|
3790
|
+
commandId: result.id,
|
|
3791
|
+
}, null, 2),
|
|
3792
|
+
}],
|
|
3793
|
+
};
|
|
3794
|
+
}
|
|
3795
|
+
case "prowlarr_get_download_clients": {
|
|
3796
|
+
if (!clients.prowlarr)
|
|
3797
|
+
throw new Error("Prowlarr not configured");
|
|
3798
|
+
const downloadClients = await clients.prowlarr.getDownloadClients();
|
|
3799
|
+
return {
|
|
3800
|
+
content: [{
|
|
3801
|
+
type: "text",
|
|
3802
|
+
text: JSON.stringify({
|
|
3803
|
+
count: downloadClients.length,
|
|
3804
|
+
clients: downloadClients.map(c => ({
|
|
3805
|
+
id: c.id,
|
|
3806
|
+
name: c.name,
|
|
3807
|
+
implementation: c.implementation,
|
|
3808
|
+
protocol: c.protocol,
|
|
3809
|
+
enable: c.enable,
|
|
3810
|
+
priority: c.priority,
|
|
3811
|
+
})),
|
|
3812
|
+
}, null, 2),
|
|
3813
|
+
}],
|
|
3814
|
+
};
|
|
3815
|
+
}
|
|
3218
3816
|
// Cross-service search
|
|
3219
3817
|
case "arr_search_all": {
|
|
3220
3818
|
const term = args.term;
|