Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions IMPLEMENTATION_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ Writes require both `MCP_READ_ONLY=false` and the target service's `ALLOW_WRITES

Use `/api/v1` with `X-Api-Key`. Preserve `%20` search encoding, existing tool names and the default TV season `[1]`. Service defaults come from Seerr; language-profile IDs aren't guessed. A direct Sonarr/Radarr addition is separate from a Seerr request and its approval policy.

Request-history reads come from two endpoints, because neither alone is sufficient. `GET /request` pages the log and carries `requestedBy`, but ignores a `mediaId` filter; `GET /media` omits `requests`. Per-title history is therefore only available from `GET /{tv|movie}/{tmdbId}` via `mediaInfo.requests`. A TMDB id Seerr has never seen answers 500, which the tools report as `in_seerr: false` rather than as a fault, and an unknown `requestedBy` answers 200 with an empty page, so filter and sort values are validated locally instead of inferred from the response.

Request mutations map to Seerr's documented endpoints: `POST /request/{id}/retry` re-runs the arr push for a request whose `externalServiceId` is empty, `POST /request/{id}/{approve|decline}` changes its status, `DELETE /request/{id}` clears one log entry, and `DELETE /media/{id}` discards one media item's availability state. The two deletes stay separate because they remove different records: the first leaves the title requestable, the second removes Seerr's tracking of it. Neither deletes files, and `DELETE /media/{id}` answers success for any id, so its result reports `removed` separately from `verified`.

### Radarr and Sonarr

Use `/api/v3` with `X-Api-Key`. External catalog IDs and native library IDs must stay distinct. Additions check existing library membership and validate profile/root choices before posting. They don't search automatically.
Expand Down
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ Hermes and OpenClaw configuration follows their documentation; end-to-end sessio
| "Stop monitoring season 1 of Severance. Leave the other seasons alone." | Sonarr season monitoring |
| "Why hasn't Arrival imported? Check Radarr's queue and history." | Radarr queue, history and import diagnostics |
| "Show the SABnzbd queue, then pause the download I choose." | Downloader queue and per-job pause |
| "Who requested Mad Men, and when?" | Seerr request history |
| "That request is stuck. Approve it and make Seerr push it again." | Seerr request status and retry |
| "Remove those bogus requests, but keep the titles." | Seerr request removal |

Calendars, lookups and status checks work in read-only mode. Requests, monitoring changes, searches that trigger downloads, and download controls need [write permission](#allowing-changes). `get_services` shows which services are connected and whether writes are enabled.

Expand All @@ -156,7 +159,31 @@ You can also add media directly with `radarr_add_movie` or `sonarr_add_series`.

IDs depend on the operation: Seerr requests and Radarr additions use TMDB IDs; Sonarr additions use TVDB IDs. Once a title is in your library, monitoring and search tools use its Sonarr or Radarr ID. Episode tools use Sonarr episode IDs and check that they belong to the selected series.

Sonarr monitoring changes only the selected seasons or episodes. Season and episode changes require separate calls.
Sonarr monitoring changes only the selected seasons or episodes. Season and episode changes require separate calls. All of this works in read-only mode except `request_media` and the direct additions.

### Seerr request history

"Who asked for this?" is a request-log question, not a library one:

- `list_requests` pages the request log newest-first (`page_number`, `limit` up to 100) and carries the requester on every entry. `requested_by` is who asked; `modified_by` is whoever last acted, usually the approving admin, and the two routinely differ. Narrow with `requested_by` (Seerr user id) and `media_type`, or `filter`.
- `get_media_requests` answers it for one title by TMDB id, oldest first, so the first entry is the original requester. Use it instead of scanning the log when the title is known.

Both are read-only and need no writes. Two upstream quirks shape them: `/api/v1/media` deliberately omits `requests`, and `request?mediaId=` is silently ignored (it returns the whole log), so per-title history only comes from the title's own detail endpoint. Seerr also answers 500, not 404, for a TMDB id it has never seen, which these tools report as `in_seerr: false` rather than an error. Filters, sorts and media types are validated locally because Seerr rejects a bad value with 400 but silently ignores an unknown `requestedBy`.

Paging is reported as `native` from Seerr's `pageInfo`; a title the requester list does not match returns an empty page rather than an error.

### Fixing and removing requests

A request that never reached Sonarr or Radarr sits in the log forever without ever downloading. The signal is `media.externalServiceId` being empty on a request that is otherwise approved. `retry_request` is Seerr's own repair for it: it re-runs the push and reports `pushed_to_arr` from the result, instead of creating a second request. `set_request_status` approves or declines one request (`approve` or `decline`); approval is the decision that lets Seerr push to the arr, not a bookkeeping flag.

Removal comes in two deliberately separate operations, because they delete different things:

- `remove_request` clears ONE log entry. The title's media record survives, so it can be requested again later. A request Seerr has already forgotten reports `removed: false` instead of failing.
- `remove_media` deletes ONE Seerr media item, discarding its availability status, request history and availability state. It does **not** delete the file on disk and does **not** remove the title from Sonarr or Radarr.

A media ID is neither a TMDB ID nor a request ID. Seerr also accepts any media ID with a success response, even one it never had, so `remove_media` reports `removed` (the delete was accepted) separately from `verified` (a record is known to have existed). Neither tool can be used to delete files.

### NZBHydra downloads

### Upcoming episodes and movie releases

Expand Down Expand Up @@ -194,7 +221,7 @@ If NZB retrieval redirects to an indexer, add that indexer's origin to `NZBHYDRA
| Group | Tools |
| --- | --- |
| Common | `ping`, `get_services` |
| Seerr | `search_media`, `request_media`, `get_request` |
| Seerr | `search_media`, `request_media`, `get_request`, `list_requests`, `get_media_requests`, `set_request_status`, `retry_request`, `remove_request`, `remove_media` |
| Radarr | `radarr_find_movies`, `radarr_get_movie`, `radarr_get_options`, `radarr_get_queue`, `radarr_get_history`, `radarr_get_health`, `radarr_get_calendar`, `radarr_get_releases`, `radarr_get_command`, `radarr_add_movie`, `radarr_set_monitored`, `radarr_search_movie`, `radarr_grab_release` |
| Sonarr | `sonarr_find_series`, `sonarr_get_series`, `sonarr_get_episodes`, `sonarr_get_next_up`, `sonarr_get_missing`, `sonarr_get_calendar`, `sonarr_get_options`, `sonarr_get_queue`, `sonarr_get_history`, `sonarr_get_health`, `sonarr_get_releases`, `sonarr_get_command`, `sonarr_add_series`, `sonarr_set_monitoring`, `sonarr_search_episodes`, `sonarr_grab_release`, `sonarr_remove_queue_item` |
| Downloaders | `downloads_get_status`, `downloads_get_queue`, `downloads_get_history`, `downloads_get_categories`, `downloads_pause`, `downloads_resume`, `downloads_retry` |
Expand Down Expand Up @@ -236,4 +263,4 @@ Tests use `httpx.MockTransport` for service API calls, MCP sessions for tool beh

API tests target Sonarr/Radarr `/api/v3`, NZBGet v18+, SABnzbd 5.x and NZBHydra's public Newznab API. They don't check compatibility with every server release. Use disposable media and queues when testing writes against a live service.

[Implementation notes](IMPLEMENTATION_PLAN.md) cover the code structure and follow-up work. Changes to API operations should include a mock contract test.
[Implementation notes](IMPLEMENTATION_PLAN.md) cover the code structure and follow-up work. Changes to API operations should include a mock contract test.
Loading
Loading