@orellbuehler/sonarr-mcp 0.1.0 → 0.2.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/README.md +7 -3
- package/dist/server.js +1 -1
- package/dist/sonarr/client.js +3 -1
- package/dist/sonarr/format.js +91 -0
- package/dist/tools/blocklist.js +4 -4
- package/dist/tools/calendar.js +2 -2
- package/dist/tools/commands.js +41 -21
- package/dist/tools/episodes.js +11 -11
- package/dist/tools/history.js +6 -6
- package/dist/tools/organization.js +17 -17
- package/dist/tools/profiles.js +34 -28
- package/dist/tools/providers.js +44 -23
- package/dist/tools/queue.js +19 -16
- package/dist/tools/releases.js +7 -7
- package/dist/tools/series.js +15 -15
- package/dist/tools/settings.js +18 -7
- package/dist/tools/system.js +15 -10
- package/dist/tools/wanted.js +3 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -75,7 +75,9 @@ If Sonarr runs behind a reverse proxy with a URL base, include it in `SONARR_URL
|
|
|
75
75
|
| `SONARR_SERVER` | – | Accepted as an alias for `SONARR_URL`. |
|
|
76
76
|
| `SONARR_API_KEY` | yes | API key from Settings > General > Security. |
|
|
77
77
|
|
|
78
|
-
The server speaks stdio only — it is a single-user, single-instance server. It is never asked for your key over the network; the key is read from the environment and sent to Sonarr as the `X-Api-Key` header.
|
|
78
|
+
The server speaks stdio only — it is a single-user, single-instance server. It is never asked for your key over the network; the key is read from the environment and sent to Sonarr as the `X-Api-Key` header. Redirects are not followed, so the key is never forwarded to another host — point `SONARR_URL` at the final address, including the URL base.
|
|
79
|
+
|
|
80
|
+
Requires Node.js 22 or newer.
|
|
79
81
|
|
|
80
82
|
## Available tools
|
|
81
83
|
|
|
@@ -108,8 +110,10 @@ The server speaks stdio only — it is a single-user, single-instance server. It
|
|
|
108
110
|
- **List tools return summaries.** `list_series`, `list_episodes`, `get_calendar`, `search_releases` and the wanted lists strip images, overviews and alternate titles so a large library still fits in context. Pass `detailed: true`, or use the matching `get_*` tool, when you need the full object.
|
|
109
111
|
- **Ids.** Sonarr series ids are not TVDB ids. `lookup_series` returns `tvdbId` (what `add_series` takes); everything else takes the Sonarr `id` from `list_series`.
|
|
110
112
|
- **Searching.** `search_series`, `search_season` and `search_episodes` queue Sonarr's own automatic search and return a command id — poll it with `get_command`. `search_releases` instead queries indexers live and returns the candidate releases for you to pick from, which you then send with `grab_release`.
|
|
111
|
-
- **Provider configuration.** Indexers, download clients, import lists and notifications are configured through an implementation-specific `fields` array. Call `get_*_schema` for the template, then pass the whole object to `create_*`; for updates, fetch with `get_*`, change what you need, and send it back.
|
|
112
|
-
- **
|
|
113
|
+
- **Provider configuration.** Indexers, download clients, import lists and notifications are configured through an implementation-specific `fields` array. Call `get_*_schema` for the template, then pass the whole object to `create_*`; for updates, fetch with `get_*`, change what you need, and send it back.
|
|
114
|
+
- **Secrets are redacted.** Config and provider tools never return secrets: the host config's API key and passwords, provider fields Sonarr marks as private (API key, password, username), fields whose name looks secret (`apiKey`, `passkey`, `token`, `cookie`, `webHookUrl`, ...) and credentials embedded in URLs all come back as `[redacted]`. Leave those values untouched when you send an object to `update_*` — the server swaps each placeholder for the value Sonarr has stored before saving, and refuses the write if there is none. `create_*` rejects placeholders outright.
|
|
115
|
+
- **Commands are allowlisted.** `run_command` only queues library and maintenance commands (refresh, rescan, searches, RSS sync, rename, import, housekeeping, health check, backup). `ApplicationUpdate`, `ResetApiKey`, log deletion and the like are not available.
|
|
116
|
+
- **Destructive operations are explicit.** `delete_series`, `delete_series_bulk` and the queue tools only touch files on disk when you pass `delete_files` / `remove_from_client`, and both default to `false`. Every tool carries MCP annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`) so clients can ask before running the risky ones. `restart_sonarr` is included; there is deliberately no shutdown, restore-backup or update-install tool.
|
|
113
117
|
- **Sonarr v4.** The v3 API paths are what Sonarr v4 serves, so this works against both v3 and v4. A handful of endpoints in the published spec (language profiles) exist only on v3 and are not exposed.
|
|
114
118
|
|
|
115
119
|
## Development
|
package/dist/server.js
CHANGED
|
@@ -14,7 +14,7 @@ import { registerOrganizationTools } from "./tools/organization.js";
|
|
|
14
14
|
import { registerSettingsTools } from "./tools/settings.js";
|
|
15
15
|
import { registerSystemTools } from "./tools/system.js";
|
|
16
16
|
export function createServer(client) {
|
|
17
|
-
const server = new McpServer({ name: "sonarr-mcp", version: "0.1
|
|
17
|
+
const server = new McpServer({ name: "sonarr-mcp", version: "0.2.1" });
|
|
18
18
|
registerSeriesTools(server, client);
|
|
19
19
|
registerEpisodeTools(server, client);
|
|
20
20
|
registerCalendarTools(server, client);
|
package/dist/sonarr/client.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { REDACTED, redactUrls } from "./format.js";
|
|
1
2
|
export class SonarrClient {
|
|
2
3
|
baseUrl;
|
|
3
4
|
apiKey;
|
|
@@ -21,6 +22,7 @@ export class SonarrClient {
|
|
|
21
22
|
res = await fetch(`${this.baseUrl}${path}`, {
|
|
22
23
|
...options,
|
|
23
24
|
headers: this.headers(options),
|
|
25
|
+
redirect: "error",
|
|
24
26
|
signal: options.signal ?? AbortSignal.timeout(this.timeoutMs),
|
|
25
27
|
});
|
|
26
28
|
}
|
|
@@ -31,7 +33,7 @@ export class SonarrClient {
|
|
|
31
33
|
throw e;
|
|
32
34
|
}
|
|
33
35
|
if (!res.ok) {
|
|
34
|
-
const body = await res.text();
|
|
36
|
+
const body = redactUrls((await res.text()).replaceAll(this.apiKey, REDACTED));
|
|
35
37
|
throw new Error(`${res.status} ${res.statusText}: ${body}`);
|
|
36
38
|
}
|
|
37
39
|
return res;
|
package/dist/sonarr/format.js
CHANGED
|
@@ -106,3 +106,94 @@ export function summarizeList(data, fn, detailed) {
|
|
|
106
106
|
}
|
|
107
107
|
return data;
|
|
108
108
|
}
|
|
109
|
+
export const READ = { readOnlyHint: true };
|
|
110
|
+
export const WRITE = { readOnlyHint: false, destructiveHint: false };
|
|
111
|
+
export const UPDATE = { readOnlyHint: false, destructiveHint: false, idempotentHint: true };
|
|
112
|
+
export const DELETE = { readOnlyHint: false, destructiveHint: true, idempotentHint: true };
|
|
113
|
+
export const DESTRUCTIVE = { readOnlyHint: false, destructiveHint: true };
|
|
114
|
+
export const REDACTED = "[redacted]";
|
|
115
|
+
const SECRET = /api_?key|passw|passkey|passphrase|token|secret|cookie|credential|webhook/i;
|
|
116
|
+
const URL_USERINFO = /(\b[a-z][a-z0-9+.-]*:\/\/)[^\s/?#@]+@/gi;
|
|
117
|
+
const URL_SECRET_PARAM = /((?:[?&]|\\u0026)(?:api_?key|passw(?:or)?d|passkey|token|secret|auth|sig(?:nature)?)=)[^&#\s\\"]+/gi;
|
|
118
|
+
export function redactUrls(value) {
|
|
119
|
+
return value.replace(URL_USERINFO, `$1${REDACTED}@`).replace(URL_SECRET_PARAM, `$1${REDACTED}`);
|
|
120
|
+
}
|
|
121
|
+
function isSet(value) {
|
|
122
|
+
return value !== undefined && value !== null && value !== "";
|
|
123
|
+
}
|
|
124
|
+
export function redactSecrets(data) {
|
|
125
|
+
if (!data || typeof data !== "object" || Array.isArray(data))
|
|
126
|
+
return data;
|
|
127
|
+
const out = {};
|
|
128
|
+
for (const [key, value] of Object.entries(data)) {
|
|
129
|
+
if (typeof value === "string") {
|
|
130
|
+
out[key] = SECRET.test(key) && value !== "" ? REDACTED : redactUrls(value);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
out[key] = value;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return out;
|
|
137
|
+
}
|
|
138
|
+
function redactField(field) {
|
|
139
|
+
if (!field || typeof field !== "object")
|
|
140
|
+
return field;
|
|
141
|
+
const f = field;
|
|
142
|
+
if (!isSet(f.value))
|
|
143
|
+
return f;
|
|
144
|
+
const isPrivate = typeof f.privacy === "string" && f.privacy !== "normal";
|
|
145
|
+
if (isPrivate)
|
|
146
|
+
return { ...f, value: REDACTED };
|
|
147
|
+
if (typeof f.value !== "string")
|
|
148
|
+
return f;
|
|
149
|
+
if (SECRET.test(String(f.name ?? "")))
|
|
150
|
+
return { ...f, value: REDACTED };
|
|
151
|
+
return { ...f, value: redactUrls(f.value) };
|
|
152
|
+
}
|
|
153
|
+
export function redactProvider(data) {
|
|
154
|
+
if (Array.isArray(data))
|
|
155
|
+
return data.map((item) => redactProvider(item));
|
|
156
|
+
if (!data || typeof data !== "object")
|
|
157
|
+
return data;
|
|
158
|
+
const out = redactSecrets(data);
|
|
159
|
+
if (Array.isArray(out.fields))
|
|
160
|
+
out.fields = out.fields.map(redactField);
|
|
161
|
+
if (Array.isArray(out.presets))
|
|
162
|
+
out.presets = out.presets.map((p) => redactProvider(p));
|
|
163
|
+
return out;
|
|
164
|
+
}
|
|
165
|
+
export function hasRedacted(data) {
|
|
166
|
+
if (typeof data === "string")
|
|
167
|
+
return data.includes(REDACTED);
|
|
168
|
+
if (Array.isArray(data))
|
|
169
|
+
return data.some(hasRedacted);
|
|
170
|
+
if (data && typeof data === "object")
|
|
171
|
+
return Object.values(data).some(hasRedacted);
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
export function restoreRedacted(incoming, stored) {
|
|
175
|
+
const out = {};
|
|
176
|
+
for (const [key, value] of Object.entries(incoming)) {
|
|
177
|
+
if (key !== "fields" && hasRedacted(value)) {
|
|
178
|
+
if (!(key in stored))
|
|
179
|
+
throw new Error(`'${key}' is redacted and has no stored value`);
|
|
180
|
+
out[key] = stored[key];
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
out[key] = value;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (Array.isArray(incoming.fields)) {
|
|
187
|
+
const current = (Array.isArray(stored.fields) ? stored.fields : []);
|
|
188
|
+
out.fields = incoming.fields.map((field) => {
|
|
189
|
+
if (!hasRedacted(field))
|
|
190
|
+
return field;
|
|
191
|
+
const f = field;
|
|
192
|
+
const match = current.find((c) => c.name === f.name);
|
|
193
|
+
if (!match)
|
|
194
|
+
throw new Error(`Field '${String(f.name)}' is redacted and has no stored value`);
|
|
195
|
+
return { ...f, value: match.value };
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
return out;
|
|
199
|
+
}
|
package/dist/tools/blocklist.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { buildQS, ok, err } from "../sonarr/format.js";
|
|
2
|
+
import { buildQS, ok, err, DELETE, READ } from "../sonarr/format.js";
|
|
3
3
|
const sortDirection = ["default", "ascending", "descending"];
|
|
4
4
|
export function registerBlocklistTools(server, client) {
|
|
5
5
|
server.tool("get_blocklist", "Page through blocklisted releases — releases Sonarr has been told never to grab again, with the reason they were blocked.", {
|
|
@@ -12,7 +12,7 @@ export function registerBlocklistTools(server, client) {
|
|
|
12
12
|
.array(z.enum(["unknown", "usenet", "torrent"]))
|
|
13
13
|
.optional()
|
|
14
14
|
.describe("Only these download protocols"),
|
|
15
|
-
}, async ({ page, page_size, sort_key, sort_direction, series_ids, protocols }) => {
|
|
15
|
+
}, READ, async ({ page, page_size, sort_key, sort_direction, series_ids, protocols }) => {
|
|
16
16
|
try {
|
|
17
17
|
const qs = buildQS({
|
|
18
18
|
page,
|
|
@@ -28,7 +28,7 @@ export function registerBlocklistTools(server, client) {
|
|
|
28
28
|
return err(e);
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
server.tool("remove_blocklist_item", "Remove one release from the blocklist so Sonarr may grab it again.", { id: z.number().describe("Blocklist entry id") }, async ({ id }) => {
|
|
31
|
+
server.tool("remove_blocklist_item", "Remove one release from the blocklist so Sonarr may grab it again.", { id: z.number().int().positive().describe("Blocklist entry id") }, DELETE, async ({ id }) => {
|
|
32
32
|
try {
|
|
33
33
|
return ok(await client.delete(`/api/v3/blocklist/${id}`));
|
|
34
34
|
}
|
|
@@ -36,7 +36,7 @@ export function registerBlocklistTools(server, client) {
|
|
|
36
36
|
return err(e);
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
server.tool("remove_blocklist_items", "Remove several releases from the blocklist at once.", { ids: z.array(z.number()).describe("Blocklist entry ids") }, async ({ ids }) => {
|
|
39
|
+
server.tool("remove_blocklist_items", "Remove several releases from the blocklist at once.", { ids: z.array(z.number()).describe("Blocklist entry ids") }, DELETE, async ({ ids }) => {
|
|
40
40
|
try {
|
|
41
41
|
return ok(await client.delete("/api/v3/blocklist/bulk", { ids }));
|
|
42
42
|
}
|
package/dist/tools/calendar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { buildQS, ok, err, summarizeEpisode } from "../sonarr/format.js";
|
|
2
|
+
import { buildQS, ok, err, summarizeEpisode, READ } from "../sonarr/format.js";
|
|
3
3
|
export function registerCalendarTools(server, client) {
|
|
4
4
|
server.tool("get_calendar", "List episodes airing in a date range — what aired recently and what is coming up. Defaults to today and tomorrow on the Sonarr side.", {
|
|
5
5
|
start: z.string().optional().describe("ISO 8601 start date, e.g. '2026-09-01'"),
|
|
@@ -15,7 +15,7 @@ export function registerCalendarTools(server, client) {
|
|
|
15
15
|
include_episode_file: z.boolean().optional().describe("Include the episode file object"),
|
|
16
16
|
tags: z.array(z.number()).optional().describe("Only series carrying these tag ids"),
|
|
17
17
|
detailed: z.boolean().optional().describe("Return full episode objects instead of summaries"),
|
|
18
|
-
}, async ({ start, end, unmonitored, include_series, include_episode_file, tags, detailed }) => {
|
|
18
|
+
}, READ, async ({ start, end, unmonitored, include_series, include_episode_file, tags, detailed }) => {
|
|
19
19
|
try {
|
|
20
20
|
const qs = buildQS({
|
|
21
21
|
start,
|
package/dist/tools/commands.js
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { ok, err } from "../sonarr/format.js";
|
|
2
|
+
import { ok, err, DELETE, DESTRUCTIVE, READ, WRITE } from "../sonarr/format.js";
|
|
3
|
+
export const COMMANDS = [
|
|
4
|
+
"RefreshSeries",
|
|
5
|
+
"RescanSeries",
|
|
6
|
+
"SeriesSearch",
|
|
7
|
+
"SeasonSearch",
|
|
8
|
+
"EpisodeSearch",
|
|
9
|
+
"MissingEpisodeSearch",
|
|
10
|
+
"CutoffUnmetEpisodeSearch",
|
|
11
|
+
"RssSync",
|
|
12
|
+
"RenameFiles",
|
|
13
|
+
"RenameSeries",
|
|
14
|
+
"DownloadedEpisodesScan",
|
|
15
|
+
"ManualImport",
|
|
16
|
+
"RefreshMonitoredDownloads",
|
|
17
|
+
"ProcessMonitoredDownloads",
|
|
18
|
+
"ImportListSync",
|
|
19
|
+
"ClearBlocklist",
|
|
20
|
+
"Housekeeping",
|
|
21
|
+
"MessagingCleanup",
|
|
22
|
+
"CheckHealth",
|
|
23
|
+
"Backup",
|
|
24
|
+
];
|
|
3
25
|
function summarizeCommand(c) {
|
|
4
26
|
return {
|
|
5
27
|
id: c.id,
|
|
@@ -15,7 +37,7 @@ function summarizeCommand(c) {
|
|
|
15
37
|
};
|
|
16
38
|
}
|
|
17
39
|
export function registerCommandTools(server, client) {
|
|
18
|
-
server.tool("list_commands", "List commands Sonarr is currently running or has recently run, with their status and duration.", {}, async () => {
|
|
40
|
+
server.tool("list_commands", "List commands Sonarr is currently running or has recently run, with their status and duration.", {}, READ, async () => {
|
|
19
41
|
try {
|
|
20
42
|
const data = (await client.get("/api/v3/command"));
|
|
21
43
|
return ok({ count: data.length, commands: data.map(summarizeCommand) });
|
|
@@ -24,7 +46,7 @@ export function registerCommandTools(server, client) {
|
|
|
24
46
|
return err(e);
|
|
25
47
|
}
|
|
26
48
|
});
|
|
27
|
-
server.tool("get_command", "Get the status of a single command by id — poll this after starting a search or refresh.", { id: z.number().describe("Command id returned when the command was queued") }, async ({ id }) => {
|
|
49
|
+
server.tool("get_command", "Get the status of a single command by id — poll this after starting a search or refresh.", { id: z.number().int().positive().describe("Command id returned when the command was queued") }, READ, async ({ id }) => {
|
|
28
50
|
try {
|
|
29
51
|
return ok(await client.get(`/api/v3/command/${id}`));
|
|
30
52
|
}
|
|
@@ -32,25 +54,23 @@ export function registerCommandTools(server, client) {
|
|
|
32
54
|
return err(e);
|
|
33
55
|
}
|
|
34
56
|
});
|
|
35
|
-
server.tool("run_command",
|
|
36
|
-
name: z.
|
|
57
|
+
server.tool("run_command", `Queue a Sonarr command by name. Only library and maintenance commands are allowed: ${COMMANDS.join(", ")}. Commands that update the application or reset the API key are not available. Prefer the dedicated tools (refresh_series, search_series, ...) where one exists.`, {
|
|
58
|
+
name: z.enum(COMMANDS).describe("Command name, e.g. 'RssSync'"),
|
|
37
59
|
params: z
|
|
38
|
-
.record(z.unknown())
|
|
60
|
+
.record(z.string(), z.unknown())
|
|
39
61
|
.optional()
|
|
40
|
-
.describe("Extra command body fields, e.g. { seriesId: 12 } or { episodeIds: [1, 2] }"),
|
|
41
|
-
}, async ({ name, params }) => {
|
|
62
|
+
.describe("Extra command body fields, e.g. { seriesId: 12 } or { episodeIds: [1, 2] }; a 'name' key is ignored"),
|
|
63
|
+
}, DESTRUCTIVE, async ({ name, params }) => {
|
|
42
64
|
try {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
...(params ?? {}),
|
|
46
|
-
}));
|
|
65
|
+
const extra = Object.fromEntries(Object.entries(params ?? {}).filter(([k]) => k.toLowerCase() !== "name"));
|
|
66
|
+
const res = (await client.post("/api/v3/command", { ...extra, name }));
|
|
47
67
|
return ok(summarizeCommand(res));
|
|
48
68
|
}
|
|
49
69
|
catch (e) {
|
|
50
70
|
return err(e);
|
|
51
71
|
}
|
|
52
72
|
});
|
|
53
|
-
server.tool("cancel_command", "Cancel a queued or running command.", { id: z.number().describe("Command id") }, async ({ id }) => {
|
|
73
|
+
server.tool("cancel_command", "Cancel a queued or running command.", { id: z.number().int().positive().describe("Command id") }, DELETE, async ({ id }) => {
|
|
54
74
|
try {
|
|
55
75
|
return ok(await client.delete(`/api/v3/command/${id}`));
|
|
56
76
|
}
|
|
@@ -58,7 +78,7 @@ export function registerCommandTools(server, client) {
|
|
|
58
78
|
return err(e);
|
|
59
79
|
}
|
|
60
80
|
});
|
|
61
|
-
server.tool("refresh_series", "Refresh metadata from TVDB for one series, or for the whole library when no id is given.", { series_id: z.number().optional().describe("Sonarr series id; all series when omitted") }, async ({ series_id }) => {
|
|
81
|
+
server.tool("refresh_series", "Refresh metadata from TVDB for one series, or for the whole library when no id is given.", { series_id: z.number().optional().describe("Sonarr series id; all series when omitted") }, WRITE, async ({ series_id }) => {
|
|
62
82
|
try {
|
|
63
83
|
const res = (await client.post("/api/v3/command", {
|
|
64
84
|
name: "RefreshSeries",
|
|
@@ -70,7 +90,7 @@ export function registerCommandTools(server, client) {
|
|
|
70
90
|
return err(e);
|
|
71
91
|
}
|
|
72
92
|
});
|
|
73
|
-
server.tool("rescan_series", "Rescan the folder of one series (or all series) to pick up files added or removed outside Sonarr.", { series_id: z.number().optional().describe("Sonarr series id; all series when omitted") }, async ({ series_id }) => {
|
|
93
|
+
server.tool("rescan_series", "Rescan the folder of one series (or all series) to pick up files added or removed outside Sonarr.", { series_id: z.number().optional().describe("Sonarr series id; all series when omitted") }, WRITE, async ({ series_id }) => {
|
|
74
94
|
try {
|
|
75
95
|
const res = (await client.post("/api/v3/command", {
|
|
76
96
|
name: "RescanSeries",
|
|
@@ -82,7 +102,7 @@ export function registerCommandTools(server, client) {
|
|
|
82
102
|
return err(e);
|
|
83
103
|
}
|
|
84
104
|
});
|
|
85
|
-
server.tool("search_series", "Start an automatic search for all monitored missing episodes of a series.", { series_id: z.number().describe("Sonarr series id") }, async ({ series_id }) => {
|
|
105
|
+
server.tool("search_series", "Start an automatic search for all monitored missing episodes of a series.", { series_id: z.number().int().positive().describe("Sonarr series id") }, WRITE, async ({ series_id }) => {
|
|
86
106
|
try {
|
|
87
107
|
const res = (await client.post("/api/v3/command", {
|
|
88
108
|
name: "SeriesSearch",
|
|
@@ -95,9 +115,9 @@ export function registerCommandTools(server, client) {
|
|
|
95
115
|
}
|
|
96
116
|
});
|
|
97
117
|
server.tool("search_season", "Start an automatic search for one season of a series.", {
|
|
98
|
-
series_id: z.number().describe("Sonarr series id"),
|
|
118
|
+
series_id: z.number().int().positive().describe("Sonarr series id"),
|
|
99
119
|
season_number: z.number().describe("Season number (0 is specials)"),
|
|
100
|
-
}, async ({ series_id, season_number }) => {
|
|
120
|
+
}, WRITE, async ({ series_id, season_number }) => {
|
|
101
121
|
try {
|
|
102
122
|
const res = (await client.post("/api/v3/command", {
|
|
103
123
|
name: "SeasonSearch",
|
|
@@ -110,7 +130,7 @@ export function registerCommandTools(server, client) {
|
|
|
110
130
|
return err(e);
|
|
111
131
|
}
|
|
112
132
|
});
|
|
113
|
-
server.tool("search_episodes", "Start an automatic search for specific episodes. Use search_releases first if you want to pick a release by hand.", { episode_ids: z.array(z.number()).describe("Sonarr episode ids") }, async ({ episode_ids }) => {
|
|
133
|
+
server.tool("search_episodes", "Start an automatic search for specific episodes. Use search_releases first if you want to pick a release by hand.", { episode_ids: z.array(z.number()).describe("Sonarr episode ids") }, WRITE, async ({ episode_ids }) => {
|
|
114
134
|
try {
|
|
115
135
|
const res = (await client.post("/api/v3/command", {
|
|
116
136
|
name: "EpisodeSearch",
|
|
@@ -122,7 +142,7 @@ export function registerCommandTools(server, client) {
|
|
|
122
142
|
return err(e);
|
|
123
143
|
}
|
|
124
144
|
});
|
|
125
|
-
server.tool("list_scheduled_tasks", "List Sonarr's scheduled maintenance tasks with their interval and last and next execution times.", {}, async () => {
|
|
145
|
+
server.tool("list_scheduled_tasks", "List Sonarr's scheduled maintenance tasks with their interval and last and next execution times.", {}, READ, async () => {
|
|
126
146
|
try {
|
|
127
147
|
const data = (await client.get("/api/v3/system/task"));
|
|
128
148
|
return ok({ count: data.length, tasks: data });
|
|
@@ -131,7 +151,7 @@ export function registerCommandTools(server, client) {
|
|
|
131
151
|
return err(e);
|
|
132
152
|
}
|
|
133
153
|
});
|
|
134
|
-
server.tool("get_scheduled_task", "Get a single scheduled task by id.", { id: z.number().describe("Scheduled task id") }, async ({ id }) => {
|
|
154
|
+
server.tool("get_scheduled_task", "Get a single scheduled task by id.", { id: z.number().int().positive().describe("Scheduled task id") }, READ, async ({ id }) => {
|
|
135
155
|
try {
|
|
136
156
|
return ok(await client.get(`/api/v3/system/task/${id}`));
|
|
137
157
|
}
|
package/dist/tools/episodes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { buildQS, ok, err, pruneUndefined, summarizeEpisode, } from "../sonarr/format.js";
|
|
2
|
+
import { buildQS, ok, err, pruneUndefined, summarizeEpisode, DELETE, READ, UPDATE, } from "../sonarr/format.js";
|
|
3
3
|
export function registerEpisodeTools(server, client) {
|
|
4
4
|
server.tool("list_episodes", "List episodes as compact summaries (id, season/episode number, title, air date, hasFile, monitored). Filter by series, season or episode file. Use get_episode for the full object.", {
|
|
5
5
|
series_id: z.number().optional().describe("Only episodes of this Sonarr series id"),
|
|
@@ -17,7 +17,7 @@ export function registerEpisodeTools(server, client) {
|
|
|
17
17
|
missing_only: z.boolean().optional().describe("Only episodes without a file (hasFile false)"),
|
|
18
18
|
monitored: z.boolean().optional().describe("Only monitored (true) or unmonitored (false)"),
|
|
19
19
|
detailed: z.boolean().optional().describe("Return full episode objects instead of summaries"),
|
|
20
|
-
}, async ({ series_id, season_number, episode_ids, episode_file_id, include_series, include_episode_file, missing_only, monitored, detailed, }) => {
|
|
20
|
+
}, READ, async ({ series_id, season_number, episode_ids, episode_file_id, include_series, include_episode_file, missing_only, monitored, detailed, }) => {
|
|
21
21
|
try {
|
|
22
22
|
const qs = buildQS({
|
|
23
23
|
seriesId: series_id,
|
|
@@ -41,7 +41,7 @@ export function registerEpisodeTools(server, client) {
|
|
|
41
41
|
return err(e);
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
-
server.tool("get_episode", "Get the full episode object, including the overview and the linked episode file with its quality and media info.", { id: z.number().describe("Sonarr episode id") }, async ({ id }) => {
|
|
44
|
+
server.tool("get_episode", "Get the full episode object, including the overview and the linked episode file with its quality and media info.", { id: z.number().int().positive().describe("Sonarr episode id") }, READ, async ({ id }) => {
|
|
45
45
|
try {
|
|
46
46
|
return ok(await client.get(`/api/v3/episode/${id}`));
|
|
47
47
|
}
|
|
@@ -52,7 +52,7 @@ export function registerEpisodeTools(server, client) {
|
|
|
52
52
|
server.tool("set_episodes_monitored", "Monitor or unmonitor individual episodes. Use set_season_monitored for whole seasons.", {
|
|
53
53
|
episode_ids: z.array(z.number()).describe("Sonarr episode ids"),
|
|
54
54
|
monitored: z.boolean().describe("true to monitor, false to unmonitor"),
|
|
55
|
-
}, async ({ episode_ids, monitored }) => {
|
|
55
|
+
}, UPDATE, async ({ episode_ids, monitored }) => {
|
|
56
56
|
try {
|
|
57
57
|
return ok(await client.put("/api/v3/episode/monitor", { episodeIds: episode_ids, monitored }));
|
|
58
58
|
}
|
|
@@ -63,7 +63,7 @@ export function registerEpisodeTools(server, client) {
|
|
|
63
63
|
server.tool("list_episode_files", "List episode files on disk for a series, with path, size, quality, languages and release group.", {
|
|
64
64
|
series_id: z.number().optional().describe("Sonarr series id"),
|
|
65
65
|
episode_file_ids: z.array(z.number()).optional().describe("Fetch these specific file ids"),
|
|
66
|
-
}, async ({ series_id, episode_file_ids }) => {
|
|
66
|
+
}, READ, async ({ series_id, episode_file_ids }) => {
|
|
67
67
|
try {
|
|
68
68
|
const data = (await client.get(`/api/v3/episodefile${buildQS({
|
|
69
69
|
seriesId: series_id,
|
|
@@ -75,7 +75,7 @@ export function registerEpisodeTools(server, client) {
|
|
|
75
75
|
return err(e);
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
-
server.tool("get_episode_file", "Get a single episode file, including its full media info.", { id: z.number().describe("Episode file id") }, async ({ id }) => {
|
|
78
|
+
server.tool("get_episode_file", "Get a single episode file, including its full media info.", { id: z.number().int().positive().describe("Episode file id") }, READ, async ({ id }) => {
|
|
79
79
|
try {
|
|
80
80
|
return ok(await client.get(`/api/v3/episodefile/${id}`));
|
|
81
81
|
}
|
|
@@ -83,7 +83,7 @@ export function registerEpisodeTools(server, client) {
|
|
|
83
83
|
return err(e);
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
|
-
server.tool("delete_episode_file", "Delete one episode file from disk. The episode stays in the library and becomes missing.", { id: z.number().describe("Episode file id") }, async ({ id }) => {
|
|
86
|
+
server.tool("delete_episode_file", "Delete one episode file from disk. The episode stays in the library and becomes missing.", { id: z.number().int().positive().describe("Episode file id") }, DELETE, async ({ id }) => {
|
|
87
87
|
try {
|
|
88
88
|
return ok(await client.delete(`/api/v3/episodefile/${id}`));
|
|
89
89
|
}
|
|
@@ -91,7 +91,7 @@ export function registerEpisodeTools(server, client) {
|
|
|
91
91
|
return err(e);
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
|
-
server.tool("delete_episode_files", "Delete several episode files from disk in one call.", { episode_file_ids: z.array(z.number()).describe("Episode file ids to delete") }, async ({ episode_file_ids }) => {
|
|
94
|
+
server.tool("delete_episode_files", "Delete several episode files from disk in one call.", { episode_file_ids: z.array(z.number()).describe("Episode file ids to delete") }, DELETE, async ({ episode_file_ids }) => {
|
|
95
95
|
try {
|
|
96
96
|
return ok(await client.delete("/api/v3/episodefile/bulk", { episodeFileIds: episode_file_ids }));
|
|
97
97
|
}
|
|
@@ -102,16 +102,16 @@ export function registerEpisodeTools(server, client) {
|
|
|
102
102
|
server.tool("update_episode_files", "Change the recorded quality, languages, release group or scene name of existing episode files (the file editor). Does not touch the files on disk.", {
|
|
103
103
|
episode_file_ids: z.array(z.number()).describe("Episode file ids to update"),
|
|
104
104
|
quality: z
|
|
105
|
-
.record(z.unknown())
|
|
105
|
+
.record(z.string(), z.unknown())
|
|
106
106
|
.optional()
|
|
107
107
|
.describe("QualityModel object, e.g. { quality: { id: 9 }, revision: { version: 1 } }"),
|
|
108
108
|
languages: z
|
|
109
|
-
.array(z.record(z.unknown()))
|
|
109
|
+
.array(z.record(z.string(), z.unknown()))
|
|
110
110
|
.optional()
|
|
111
111
|
.describe("Language objects, e.g. [{ id: 1, name: 'English' }] — see list_languages"),
|
|
112
112
|
release_group: z.string().optional().describe("Release group to record"),
|
|
113
113
|
scene_name: z.string().optional().describe("Scene name to record"),
|
|
114
|
-
}, async ({ episode_file_ids, quality, languages, release_group, scene_name }) => {
|
|
114
|
+
}, UPDATE, async ({ episode_file_ids, quality, languages, release_group, scene_name }) => {
|
|
115
115
|
try {
|
|
116
116
|
const body = pruneUndefined({
|
|
117
117
|
episodeFileIds: episode_file_ids,
|
package/dist/tools/history.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { buildQS, ok, err } from "../sonarr/format.js";
|
|
2
|
+
import { buildQS, ok, err, DESTRUCTIVE, READ } from "../sonarr/format.js";
|
|
3
3
|
const eventTypes = [
|
|
4
4
|
"unknown",
|
|
5
5
|
"grabbed",
|
|
@@ -23,7 +23,7 @@ export function registerHistoryTools(server, client) {
|
|
|
23
23
|
download_id: z.string().optional().describe("Only history for this download client id"),
|
|
24
24
|
include_series: z.boolean().optional().describe("Include the parent series object"),
|
|
25
25
|
include_episode: z.boolean().optional().describe("Include the episode object"),
|
|
26
|
-
}, async ({ page, page_size, sort_key, sort_direction, event_type, episode_id, series_ids, download_id, include_series, include_episode, }) => {
|
|
26
|
+
}, READ, async ({ page, page_size, sort_key, sort_direction, event_type, episode_id, series_ids, download_id, include_series, include_episode, }) => {
|
|
27
27
|
try {
|
|
28
28
|
const qs = buildQS({
|
|
29
29
|
page,
|
|
@@ -48,7 +48,7 @@ export function registerHistoryTools(server, client) {
|
|
|
48
48
|
event_type: z.enum(eventTypes).optional().describe("Only this event type"),
|
|
49
49
|
include_series: z.boolean().optional().describe("Include the parent series object"),
|
|
50
50
|
include_episode: z.boolean().optional().describe("Include the episode object"),
|
|
51
|
-
}, async ({ date, event_type, include_series, include_episode }) => {
|
|
51
|
+
}, READ, async ({ date, event_type, include_series, include_episode }) => {
|
|
52
52
|
try {
|
|
53
53
|
const qs = buildQS({
|
|
54
54
|
date,
|
|
@@ -64,12 +64,12 @@ export function registerHistoryTools(server, client) {
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
server.tool("get_series_history", "Get the full history for one series, optionally narrowed to a single season.", {
|
|
67
|
-
series_id: z.number().describe("Sonarr series id"),
|
|
67
|
+
series_id: z.number().int().positive().describe("Sonarr series id"),
|
|
68
68
|
season_number: z.number().optional().describe("Only this season number"),
|
|
69
69
|
event_type: z.enum(eventTypes).optional().describe("Only this event type"),
|
|
70
70
|
include_series: z.boolean().optional().describe("Include the parent series object"),
|
|
71
71
|
include_episode: z.boolean().optional().describe("Include the episode object"),
|
|
72
|
-
}, async ({ series_id, season_number, event_type, include_series, include_episode }) => {
|
|
72
|
+
}, READ, async ({ series_id, season_number, event_type, include_series, include_episode }) => {
|
|
73
73
|
try {
|
|
74
74
|
const qs = buildQS({
|
|
75
75
|
seriesId: series_id,
|
|
@@ -85,7 +85,7 @@ export function registerHistoryTools(server, client) {
|
|
|
85
85
|
return err(e);
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
|
-
server.tool("mark_history_item_failed", "Mark a grabbed history item as failed. Sonarr blocklists the release and searches for a replacement.", { id: z.number().describe("History record id") }, async ({ id }) => {
|
|
88
|
+
server.tool("mark_history_item_failed", "Mark a grabbed history item as failed. Sonarr blocklists the release and searches for a replacement.", { id: z.number().int().positive().describe("History record id") }, DESTRUCTIVE, async ({ id }) => {
|
|
89
89
|
try {
|
|
90
90
|
return ok(await client.post(`/api/v3/history/failed/${id}`));
|
|
91
91
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { buildQS, ok, err } from "../sonarr/format.js";
|
|
2
|
+
import { buildQS, ok, err, DELETE, READ, UPDATE, WRITE } from "../sonarr/format.js";
|
|
3
3
|
export function registerOrganizationTools(server, client) {
|
|
4
|
-
server.tool("list_root_folders", "List root folders with their free space and any unmapped folders sitting in them. add_series needs one of these paths.", {}, async () => {
|
|
4
|
+
server.tool("list_root_folders", "List root folders with their free space and any unmapped folders sitting in them. add_series needs one of these paths.", {}, READ, async () => {
|
|
5
5
|
try {
|
|
6
6
|
const data = (await client.get("/api/v3/rootfolder"));
|
|
7
7
|
return ok({
|
|
@@ -19,7 +19,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
19
19
|
return err(e);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
server.tool("get_root_folder", "Get one root folder including the full list of unmapped folders — series folders on disk that are not in the library.", { id: z.number().describe("Root folder id") }, async ({ id }) => {
|
|
22
|
+
server.tool("get_root_folder", "Get one root folder including the full list of unmapped folders — series folders on disk that are not in the library.", { id: z.number().int().positive().describe("Root folder id") }, READ, async ({ id }) => {
|
|
23
23
|
try {
|
|
24
24
|
return ok(await client.get(`/api/v3/rootfolder/${id}`));
|
|
25
25
|
}
|
|
@@ -27,7 +27,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
27
27
|
return err(e);
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
server.tool("add_root_folder", "Add a root folder. The path must exist and be writable by Sonarr.", { path: z.string().describe("Absolute path as Sonarr sees it, e.g. '/tv'") }, async ({ path }) => {
|
|
30
|
+
server.tool("add_root_folder", "Add a root folder. The path must exist and be writable by Sonarr.", { path: z.string().describe("Absolute path as Sonarr sees it, e.g. '/tv'") }, WRITE, async ({ path }) => {
|
|
31
31
|
try {
|
|
32
32
|
return ok(await client.post("/api/v3/rootfolder", { path }));
|
|
33
33
|
}
|
|
@@ -35,7 +35,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
35
35
|
return err(e);
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
server.tool("delete_root_folder", "Remove a root folder from Sonarr. Files on disk are not touched.", { id: z.number().describe("Root folder id") }, async ({ id }) => {
|
|
38
|
+
server.tool("delete_root_folder", "Remove a root folder from Sonarr. Files on disk are not touched.", { id: z.number().int().positive().describe("Root folder id") }, DELETE, async ({ id }) => {
|
|
39
39
|
try {
|
|
40
40
|
return ok(await client.delete(`/api/v3/rootfolder/${id}`));
|
|
41
41
|
}
|
|
@@ -43,7 +43,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
43
43
|
return err(e);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
server.tool("list_tags", "List tags with their ids and labels. Tags link series to delay profiles, release profiles, indexers and notifications.", {}, async () => {
|
|
46
|
+
server.tool("list_tags", "List tags with their ids and labels. Tags link series to delay profiles, release profiles, indexers and notifications.", {}, READ, async () => {
|
|
47
47
|
try {
|
|
48
48
|
const data = (await client.get("/api/v3/tag"));
|
|
49
49
|
return ok({ count: data.length, tags: data });
|
|
@@ -52,7 +52,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
52
52
|
return err(e);
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
server.tool("list_tag_details", "List tags together with everything using them — series ids, indexer ids, notification ids and profile ids.", {}, async () => {
|
|
55
|
+
server.tool("list_tag_details", "List tags together with everything using them — series ids, indexer ids, notification ids and profile ids.", {}, READ, async () => {
|
|
56
56
|
try {
|
|
57
57
|
const data = (await client.get("/api/v3/tag/detail"));
|
|
58
58
|
return ok({ count: data.length, tags: data });
|
|
@@ -61,7 +61,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
61
61
|
return err(e);
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
-
server.tool("create_tag", "Create a tag.", { label: z.string().describe("Tag label, e.g. 'anime'") }, async ({ label }) => {
|
|
64
|
+
server.tool("create_tag", "Create a tag.", { label: z.string().describe("Tag label, e.g. 'anime'") }, WRITE, async ({ label }) => {
|
|
65
65
|
try {
|
|
66
66
|
return ok(await client.post("/api/v3/tag", { label }));
|
|
67
67
|
}
|
|
@@ -70,9 +70,9 @@ export function registerOrganizationTools(server, client) {
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
server.tool("update_tag", "Rename a tag.", {
|
|
73
|
-
id: z.number().describe("Tag id"),
|
|
73
|
+
id: z.number().int().positive().describe("Tag id"),
|
|
74
74
|
label: z.string().describe("New tag label"),
|
|
75
|
-
}, async ({ id, label }) => {
|
|
75
|
+
}, UPDATE, async ({ id, label }) => {
|
|
76
76
|
try {
|
|
77
77
|
return ok(await client.put(`/api/v3/tag/${id}`, { id, label }));
|
|
78
78
|
}
|
|
@@ -80,7 +80,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
80
80
|
return err(e);
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
server.tool("delete_tag", "Delete a tag. It is removed from every series and provider using it.", { id: z.number().describe("Tag id") }, async ({ id }) => {
|
|
83
|
+
server.tool("delete_tag", "Delete a tag. It is removed from every series and provider using it.", { id: z.number().int().positive().describe("Tag id") }, DELETE, async ({ id }) => {
|
|
84
84
|
try {
|
|
85
85
|
return ok(await client.delete(`/api/v3/tag/${id}`));
|
|
86
86
|
}
|
|
@@ -91,7 +91,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
91
91
|
server.tool("list_import_list_exclusions", "List series excluded from import lists — series that lists will never re-add.", {
|
|
92
92
|
page: z.number().optional().describe("Page number; unpaged when omitted"),
|
|
93
93
|
page_size: z.number().optional().describe("Items per page"),
|
|
94
|
-
}, async ({ page, page_size }) => {
|
|
94
|
+
}, READ, async ({ page, page_size }) => {
|
|
95
95
|
try {
|
|
96
96
|
if (page !== undefined || page_size !== undefined) {
|
|
97
97
|
return ok(await client.get(`/api/v3/importlistexclusion/paged${buildQS({ page, pageSize: page_size })}`));
|
|
@@ -106,7 +106,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
106
106
|
server.tool("add_import_list_exclusion", "Exclude a series from import lists by TVDB id, so lists stop re-adding it.", {
|
|
107
107
|
tvdb_id: z.number().describe("TVDB id of the series to exclude"),
|
|
108
108
|
title: z.string().describe("Series title, for display in the Sonarr UI"),
|
|
109
|
-
}, async ({ tvdb_id, title }) => {
|
|
109
|
+
}, WRITE, async ({ tvdb_id, title }) => {
|
|
110
110
|
try {
|
|
111
111
|
return ok(await client.post("/api/v3/importlistexclusion", { tvdbId: tvdb_id, title }));
|
|
112
112
|
}
|
|
@@ -114,7 +114,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
114
114
|
return err(e);
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
|
-
server.tool("delete_import_list_exclusion", "Remove an import list exclusion so lists may add the series again.", { id: z.number().describe("Import list exclusion id") }, async ({ id }) => {
|
|
117
|
+
server.tool("delete_import_list_exclusion", "Remove an import list exclusion so lists may add the series again.", { id: z.number().int().positive().describe("Import list exclusion id") }, DELETE, async ({ id }) => {
|
|
118
118
|
try {
|
|
119
119
|
return ok(await client.delete(`/api/v3/importlistexclusion/${id}`));
|
|
120
120
|
}
|
|
@@ -122,7 +122,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
122
122
|
return err(e);
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
|
-
server.tool("list_remote_path_mappings", "List remote path mappings — how paths reported by a download client on another host translate to paths Sonarr can read.", {}, async () => {
|
|
125
|
+
server.tool("list_remote_path_mappings", "List remote path mappings — how paths reported by a download client on another host translate to paths Sonarr can read.", {}, READ, async () => {
|
|
126
126
|
try {
|
|
127
127
|
const data = (await client.get("/api/v3/remotepathmapping"));
|
|
128
128
|
return ok({ count: data.length, mappings: data });
|
|
@@ -135,7 +135,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
135
135
|
host: z.string().describe("Download client host as configured in Sonarr"),
|
|
136
136
|
remote_path: z.string().describe("Path as the download client reports it"),
|
|
137
137
|
local_path: z.string().describe("Matching path as Sonarr sees it"),
|
|
138
|
-
}, async ({ host, remote_path, local_path }) => {
|
|
138
|
+
}, WRITE, async ({ host, remote_path, local_path }) => {
|
|
139
139
|
try {
|
|
140
140
|
return ok(await client.post("/api/v3/remotepathmapping", {
|
|
141
141
|
host,
|
|
@@ -147,7 +147,7 @@ export function registerOrganizationTools(server, client) {
|
|
|
147
147
|
return err(e);
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
|
-
server.tool("delete_remote_path_mapping", "Delete a remote path mapping.", { id: z.number().describe("Remote path mapping id") }, async ({ id }) => {
|
|
150
|
+
server.tool("delete_remote_path_mapping", "Delete a remote path mapping.", { id: z.number().int().positive().describe("Remote path mapping id") }, DELETE, async ({ id }) => {
|
|
151
151
|
try {
|
|
152
152
|
return ok(await client.delete(`/api/v3/remotepathmapping/${id}`));
|
|
153
153
|
}
|