Skip to main content
Glama

get_libraries

Retrieve a list of all Plex libraries to manage and access media content efficiently through the Plex MCP Server.

Instructions

Get all Plex libraries

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the get_libraries tool: fetches Plex library sections via API, extracts directory info, and returns formatted JSON.
    private async getLibraries() {
      const data = await this.makeRequest("/library/sections");
      const libraries = data.MediaContainer?.Directory || [];
      
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              libraries: libraries.map((lib: any) => ({
                key: lib.key,
                title: lib.title,
                type: lib.type,
                scannedAt: lib.scannedAt,
                count: lib.count,
              })),
            }, null, 2),
          },
        ],
      };
    }
  • src/index.ts:47-54 (registration)
    Tool registration in ListToolsRequestSchema handler: defines name, description, and input schema (empty object).
    {
      name: "get_libraries",
      description: "Get all Plex libraries",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • src/index.ts:265-266 (registration)
    Handler dispatch in CallToolRequestSchema switch statement: routes 'get_libraries' calls to the getLibraries method.
    case "get_libraries":
      return await this.getLibraries();
  • Input schema definition for get_libraries tool: accepts empty object (no parameters).
    inputSchema: {
      type: "object",
      properties: {},
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Get all Plex libraries' but doesn't disclose behavioral traits such as whether this is a read-only operation, if it requires authentication, rate limits, or what the return format looks like (e.g., list structure, pagination). This is inadequate for a tool with zero annotation coverage.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it highly concise and well-structured for quick understanding.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'all Plex libraries' entails (e.g., types, metadata returned) or behavioral aspects like error handling. For a tool with no structured data support, this leaves significant gaps in understanding.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100%, so there's no need for parameter details in the description. The baseline for 0 parameters is 4, as the description doesn't need to compensate for any gaps, but it doesn't reach 5 since it doesn't explicitly note the lack of parameters.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('all Plex libraries'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'get_library_stats' or 'get_media_details' which also operate on libraries, so it doesn't reach the highest score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_library_stats' (statistics-focused) and 'get_media_details' (content-focused), there's no indication of this tool's specific context or exclusions, leaving usage unclear.

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

Related 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/niavasha/plex-mcp-server'

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