movie_images
Fetch movie posters, backdrops, and logos using TMDB ID to support AI image processing and content enrichment with optional language filtering.
Instructions
Fetches images (posters, backdrops, logos) for a movie. Input: movie_id (required TMDB ID), language (optional ISO 639-1 code), include_image_language (optional comma-separated languages). Output: JSON with image arrays. Purpose: Obtain visual media assets for a movie to support AI-driven image processing or content enrichment.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_image_language | No | Filter image languages (comma-separated ISO 639-1 codes or 'null') | |
| language | No | ISO 639-1 language (e.g., en-US) | |
| movie_id | Yes | TMDB Movie ID |
Implementation Reference
- mcp-tmdb-server.js:151-154 (handler)The handler function for the 'movie_images' tool. It fetches images (posters, backdrops, logos) for the specified movie ID from the TMDB API using the tmdbFetch helper and returns the data as a JSON string in text content format.handler: async ({movie_id, language, include_image_language}) => { const data = await tmdbFetch(`/movie/${movie_id}/images`, {language, include_image_language}); return {content: [{type: "text", text: JSON.stringify(data, null, 2)}]}; }
- mcp-tmdb-server.js:138-150 (schema)The input schema (JSON Schema) for the 'movie_images' tool, defining required movie_id and optional language and include_image_language parameters.inputSchema: { type: "object", properties: { movie_id: {type: "number", description: "TMDB Movie ID"}, language: {type: "string", description: "ISO 639-1 language (e.g., en-US)"}, include_image_language: { type: "string", description: "Filter image languages (comma-separated ISO 639-1 codes or 'null')" } }, required: ["movie_id"], additionalProperties: false },
- mcp-tmdb-server.js:135-155 (registration)The complete tool object for 'movie_images' defined in the tools array, which is used by the MCP server's ListTools and CallTool request handlers to register and dispatch the tool.{ name: "movie_images", description: "Fetches images (posters, backdrops, logos) for a movie. Input: movie_id (required TMDB ID), language (optional ISO 639-1 code), include_image_language (optional comma-separated languages). Output: JSON with image arrays. Purpose: Obtain visual media assets for a movie to support AI-driven image processing or content enrichment.", inputSchema: { type: "object", properties: { movie_id: {type: "number", description: "TMDB Movie ID"}, language: {type: "string", description: "ISO 639-1 language (e.g., en-US)"}, include_image_language: { type: "string", description: "Filter image languages (comma-separated ISO 639-1 codes or 'null')" } }, required: ["movie_id"], additionalProperties: false }, handler: async ({movie_id, language, include_image_language}) => { const data = await tmdbFetch(`/movie/${movie_id}/images`, {language, include_image_language}); return {content: [{type: "text", text: JSON.stringify(data, null, 2)}]}; } },
- mcp-tmdb-server.js:18-38 (helper)The tmdbFetch helper function used by the movie_images handler (and other tools) to make authenticated API requests to the TMDB proxy endpoint.async function tmdbFetch(path, params = {}) { if (!TMDB_AUTH_TOKEN) { throw new Error("TMDB authorization token is not configured"); } const url = new URL(TMDB_BASE + path); Object.entries(params).forEach(([k, v]) => { if (v !== undefined && v !== null && v !== "") url.searchParams.set(k, String(v)); }); const res = await fetch(url, { headers: { Accept: "application/json", Authorization: TMDB_AUTH_TOKEN, }, }); if (!res.ok) { const text = await res.text().catch(() => ""); throw new Error(`TMDB request failed ${res.status}: ${text}`); } return res.json(); }