Skip to main content
Glama

plex_library

Destructive

Manage Plex media libraries with operations for listing, creating, updating, scanning, and cleaning. Handle library locations, refresh metadata, empty trash, and list items with filters.

Instructions

Comprehensive library management operations for Plex Media Server.

PORTMANTEAU PATTERN RATIONALE: Consolidates 12+ library-related operations into a single tool to prevent tool explosion. Simplifies library lifecycle management (CRUD, scan, optimize) for agents.

OPERATIONS:

  • list: List all media libraries.

  • get: Get detailed information about a specific library.

  • create/update/delete: Manage library existence and settings.

  • scan/refresh: Update media index and metadata.

  • optimize/empty_trash/clean_bundles: Maintain library database health.

  • add_location/remove_location: Manage physical media paths.

  • list_items: List paginated library contents with sort and type filters.

Return Format

{"success": bool, "data": dict|list, "operation": str, "count": int}

Examples

await plex_library(operation="list") await plex_library(operation="get", library_id="1") await plex_library(operation="scan", library_id="1", force=True) await plex_library(operation="list_items", library_id="1", sort="title", media_type="movie")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoName for the new or updated library.
pathNoFilesystem path to add or remove as a library location.
sortNoSort field for list_items (title, rating, year, added).
agentNoPlex metadata agent identifier (e.g. com.plexapp.agents.imdb).
forceNoForce operations like scan even if already up to date.
limitNoMax items to return for list_items.
thumbNoURL or path for the library thumbnail.
offsetNoPagination offset for list_items.
scannerNoPlex scanner identifier (e.g. Plex Movie Scanner).
languageNoLanguage code for the library metadata.
operationYesThe library operation to perform.
library_idNoID of the target library section.
media_typeNoFilter by media type for list_items (movie, show, episode, track, photo).
library_typeNoType of media library to create.
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true, which covers the destructive nature. The description adds a list of destructive operations (delete, remove_location, empty_trash, clean_bundles) and a return format, but does not elaborate on side effects, permissions, or operational impacts (e.g., resource-intensive scans). This is minimal additional value beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections: purpose, rationale, operations list, return format, and examples. It is front-loaded with the main purpose and remains readable despite the long operation list. The rationale is slightly meta but useful for understanding the tool's design, and no sentence feels redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 13 operations and 14 parameters, the description provides a return format and examples but lacks a crucial operation-to-parameter compatibility matrix (e.g., which params are required for create vs list_items). While the schema descriptions partially cover this, the absence of an output schema increases the burden on the description, which is only partially met.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with each parameter individually described (e.g., 'Sort field for list_items', 'Type of media library to create'). The description adds only examples that show parameter usage but does not provide any parameter-to-operation mapping or additional semantic detail beyond the schema, so the baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Comprehensive library management operations for Plex Media Server' and enumerates 13 specific operations (list, get, create, update, delete, scan, etc.), providing a specific verb+resource structure. This distinguishes it from sibling tools like plex_media, plex_collections, and plex_search, which focus on other aspects of Plex management.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives a portmanteau rationale and lists operations, implying use for library lifecycle management, but provides no explicit guidance on when to use this tool versus alternatives like plex_media or plex_collections. There is no mention of when not to use this tool or prerequisite conditions, leaving selection largely to the agent's inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sandraschi/plexmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server