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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:342-362 (handler)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();
- src/index.ts:50-52 (schema)Input schema definition for get_libraries tool: accepts empty object (no parameters).inputSchema: { type: "object", properties: {},