Skip to main content
Glama

get_media_details

Retrieve detailed metadata for a specific media item using its rating key on Plex MCP Server, enabling precise content management and querying within Plex Media Server.

Instructions

Get detailed information about a specific media item

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ratingKeyYesThe rating key of the media item

Implementation Reference

  • The handler function that implements the core logic for the get_media_details tool. It makes an API request to retrieve metadata for the specified ratingKey and returns a formatted JSON response with details like title, type, summary, genres, actors, directors, and viewing stats.
    private async getMediaDetails(ratingKey: string) {
      const data = await this.makeRequest(`/library/metadata/${ratingKey}`);
      const item = data.MediaContainer?.Metadata?.[0];
    
      if (!item) {
        throw new McpError(ErrorCode.InvalidRequest, `Media item not found: ${ratingKey}`);
      }
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              details: {
                ratingKey: item.ratingKey,
                title: item.title,
                type: item.type,
                year: item.year,
                summary: item.summary,
                rating: item.rating,
                duration: item.duration,
                genres: item.Genre?.map((g: any) => g.tag) || [],
                actors: item.Role?.map((r: any) => r.tag) || [],
                directors: item.Director?.map((d: any) => d.tag) || [],
                writers: item.Writer?.map((w: any) => w.tag) || [],
                studios: item.Studio?.map((s: any) => s.tag) || [],
                addedAt: item.addedAt,
                updatedAt: item.updatedAt,
                viewCount: item.viewCount,
                lastViewedAt: item.lastViewedAt,
              },
            }, null, 2),
          },
        ],
      };
    }
  • Input schema definition for the tool, specifying that a 'ratingKey' string parameter is required.
    inputSchema: {
      type: "object",
      properties: {
        ratingKey: {
          type: "string",
          description: "The rating key of the media item",
        },
      },
      required: ["ratingKey"],
    },
  • src/index.ts:96-109 (registration)
    Tool registration in the ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: "get_media_details",
      description: "Get detailed information about a specific media item",
      inputSchema: {
        type: "object",
        properties: {
          ratingKey: {
            type: "string",
            description: "The rating key of the media item",
          },
        },
        required: ["ratingKey"],
      },
    },
  • src/index.ts:276-277 (registration)
    Dispatch/registration in the CallToolRequestSchema switch statement that routes calls to the handler.
    case "get_media_details":
      return await this.getMediaDetails((args as any)?.ratingKey as string);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it 'gets' information, implying a read-only operation, but doesn't specify if it requires authentication, has rate limits, returns structured data, or handles errors. This leaves significant gaps in understanding how the tool behaves beyond its basic purpose.

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 that directly states the tool's purpose without unnecessary words. It's front-loaded and wastes no space, making it easy for an agent to parse quickly.

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 for a tool that retrieves detailed information. It doesn't hint at what details are returned (e.g., metadata, status), potential errors, or behavioral traits like pagination. For a read operation with no structured output documentation, more context is needed to guide effective use.

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, clearly documenting the 'ratingKey' parameter. The description adds no additional meaning beyond what the schema provides, such as explaining what a ratingKey is or how to obtain it. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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 ('detailed information about a specific media item'), making the purpose understandable. However, it doesn't differentiate this tool from potential sibling tools that might also retrieve media information, such as 'search_media' or 'get_recently_added', which could provide similar details in different contexts.

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. It doesn't mention prerequisites (e.g., needing a ratingKey), exclusions, or comparisons to sibling tools like 'search_media' for broader queries or 'get_recently_watched' for recent items, leaving the agent to infer usage from context alone.

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