Navigation
On this page

Library Tools

Tools for managing Jellyfin libraries, files, episode naming, and subtitle conversion.

These five tools handle library management, file operations, batch episode renaming, cross-service state snapshots, and subtitle conversion within your media server.


manage_library

Create a library, trigger a scan, or refresh metadata for an item.

Parameters

NameTypeRequiredDescription
actionstringYesAction to perform. One of: scan, create, refresh_metadata.
namestringConditionalLibrary name. Required when action is create.
typestringConditionalLibrary type. Required when action is create. One of: movies, tvshows, music, mixed.
folderstringConditionalFolder path (e.g. '/data/anime'). Required when action is create.
itemIdstringConditionalJellyfin item ID. Required when action is refresh_metadata.

Usage Example

“Create a new mixed library called ‘Anime’ pointed at /data/anime.”

“Scan the library for new content.”

“Refresh metadata for item abc123.”


manage_files

List, move, or delete files and folders. Paths starting with downloads/ access the downloads folder. All other paths are relative to the media volume. Since 2.2, paths containing .. are rejected by the server sandbox.

Parameters

NameTypeRequiredDescription
actionstringYesAction to perform. One of: list, move, delete.
pathstringNoPath for listing or deleting (e.g. 'anime/Show', 'downloads/', 'movies/').
sourcePathsstring[]ConditionalArray of source paths for move (e.g. ['downloads/file.mkv', 'tv/Show1']). Required when action is move.
destFolderstringConditionalDestination folder for move (e.g. 'movies/Movie Name'). Required when action is move.
jellyfinItemIdstringNoJellyfin item ID to delete. Also removes files from disk and cleans up Sonarr/Radarr entries. Used when action is delete.
confirmTokenstringConditionalServer-issued token required to execute action=delete. Omit it on the first call to receive a preview and token.

Destructive Confirmation

action=delete is a two-step operation. The first call returns { requiresConfirmation, confirmToken, preview, message } and does not delete anything. Repeat the same arguments with confirmToken within 5 minutes to execute.

Usage Example

“List all files in the downloads folder.”

“Move downloads/movie.mkv and downloads/subs.srt to movies/Movie (2024).”

“Delete the Jellyfin item with ID abc123.”


rename_episodes

Rename episode files to Jellyfin standard format (ShowName - S01E01.ext). Searches the show folder recursively. You can pass jellyfinItemId instead of showPath — the tool resolves the path from Jellyfin automatically.

Parameters

NameTypeRequiredDescription
showNamestringYesCorrect show name for renamed files (e.g. 'Rurouni Kenshin').
showPathstringNoPath to show folder (e.g. 'anime/Samurai X'). Optional if jellyfinItemId is provided.
jellyfinItemIdstringNoJellyfin item ID — resolves the file path automatically. Optional if showPath is provided.
seasonNumbernumberNoSeason number to use in filenames. Defaults to 1.
startEpisodeNumbernumberNoEpisode number to start from when filenames need sequential numbering. Defaults to 1.
dryRunbooleanNoPreview changes without applying. Defaults to true.

Usage Example

“Preview renaming episodes in anime/Samurai X to ‘Rurouni Kenshin’.”

“Rename all episodes of item abc123 to ‘Breaking Bad’ season 3, apply changes.”


get_library_state

Get a consolidated snapshot that combines Jellyfin library counts with Sonarr and Radarr state. Use this when an AI client needs a quick overview before deciding what to search, import, or clean up.

Parameters

This tool does not require parameters.

Usage Example

“Give me a snapshot of the current library state.”

“Check what Jellyfin, Sonarr, and Radarr currently know about my media.”


fix_subtitles

Convert ASS/SSA subtitles to SRT in MKV files to prevent transcoding. Works on a single file or an entire folder (searched recursively). Large batches (more than 3 files) run as a background job. Paths are sandboxed under the media/download roots.

Parameters

NameTypeRequiredDescription
mediaPathstringYesPath to a media file or folder (e.g. 'anime/Show' or '/data/anime/Show').
dryRunbooleanNoList files that would be processed without making changes. Defaults to true.

Usage Example

“Do a dry run of subtitle conversion for anime/Show.”

“Fix the subtitles in all MKV files under anime/Show, apply changes.”