Skip to main content
Glama
drakonkat

wizzy-mcp-tmdb

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
NameRequiredDescriptionDefault
include_image_languageNoFilter image languages (comma-separated ISO 639-1 codes or 'null')
languageNoISO 639-1 language (e.g., en-US)
movie_idYesTMDB Movie ID

Implementation Reference

  • 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)}]};
    }
  • 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
    },
  • 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)}]};
        }
    },
  • 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();
    }

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/drakonkat/wizzy-mcp-tmdb'

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