Skip to main content
Glama
ShubhanshuSondhiya

TMDB MCP Server

get-movie-details

Retrieve comprehensive movie information including cast, crew, plot, ratings, and release details from The Movie Database using a movie ID.

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 for 'get-movie-details', which invokes the TMDB API wrapper function getMovieDetails.
    "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 input schema definition for the 'get-movie-details' tool.
    "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"],
      },
    },
  • src/handlers.ts:57-59 (registration)
    Registration of the list tools endpoint, exposing the tool schemas including 'get-movie-details'.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: Object.values(tools),
    }));
  • src/handlers.ts:62-98 (registration)
    Registration of the call tool endpoint, which dispatches calls to the appropriate tool handler including 'get-movie-details'.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        const { name, arguments: args } = request.params;
        // Using type assertion to tell TypeScript this is a valid key
        const handler = toolHandlers[name as keyof typeof toolHandlers];
    
        if (!handler) throw new Error(`Tool not found: ${name}`);
    
        // Execute the handler but wrap the response in the expected format
        const result = await handler(args as any);
        
        // Return in the format expected by the SDK
        return {
          tools: [{
            name,
            inputSchema: {
              type: "object",
              properties: {} // This would ideally be populated with actual schema
            },
            description: `Tool: ${name}`,
            result
          }]
        };
      } catch (error) {
        // Properly handle errors
        if (error instanceof Error) {
          return {
            tools: [],
            error: error.message
          };
        }
        return {
          tools: [],
          error: "An unknown error occurred"
        };
      }
    });
  • The underlying helper function that fetches movie details from TMDB API using axios, called by the tool handler.
    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}`);
      }
    }
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 the tool retrieves details but doesn't mention whether it's a read-only operation, potential rate limits, error conditions, or what 'detailed information' entails. This is a significant gap for a tool with zero annotation coverage.

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 is appropriately sized and front-loaded, with every part contributing essential information.

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. It doesn't explain what 'detailed information' includes, potential response formats, or behavioral traits like safety or performance. For a tool with no structured context, this leaves critical gaps for an agent.

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 'movieId' parameter. The description adds no additional parameter semantics beyond implying the tool requires a specific movie, which is already covered by the schema. This meets the baseline of 3 when the schema does the heavy lifting.

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 movie'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get-similar' or 'search-movies', which might also retrieve movie information 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 like 'search-movies' or 'get-similar'. It lacks context about prerequisites (e.g., needing a movie ID) or exclusions, leaving the agent to infer usage from the name 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

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