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: {},

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