Skip to main content
Glama

get-movie-details

Retrieve comprehensive information about a specific movie by providing its ID, enabling detailed insights for analysis or recommendations via the TMDB MCP Server.

Instructions

Get detailed information about a specific movie

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
movieIdYesID of the movie to get details for

Implementation Reference

  • The MCP tool handler function for 'get-movie-details' that invokes the TMDB API helper and handles errors by returning a text message on failure.
    "get-movie-details": async ({ movieId }: { movieId: string }) => { try { const result = await getMovieDetails(movieId); return result; } catch (error: unknown) { if (error instanceof Error) { return { text: `Failed to get movie details: ${error.message}` }; } return { text: "Failed to get movie details: Unknown error" }; } },
  • The tool schema definition including name, description, and input schema requiring a 'movieId' string.
    "get-movie-details": { name: "get-movie-details", description: "Get detailed information about a specific movie", inputSchema: { type: "object", properties: { movieId: { type: "string", description: "ID of the movie to get details for", }, }, required: ["movieId"], }, },
  • The supporting function that performs the HTTP request to the TMDB API to fetch movie details, including credits, videos, and images.
    export async function getMovieDetails(movieId: number | string): Promise<MovieDetailsResponse> { try { const response = await axiosWithRetry<MovieDetailsResponse>({ url: `/movie/${movieId}`, params: { append_to_response: 'credits,videos,images' } }); return response.data; } catch (error) { const err = error as Error; console.error('Error getting movie details:', err.message); throw new Error(`Failed to get movie details: ${err.message}`); } }

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/ShubhanshuSondhiya/MCP-TMDB'

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