Skip to main content
Glama

video_generate

Create short videos from text prompts using AI video generation for content creation and visual storytelling.

Instructions

Generate a short video from a prompt using Kling AI ($0.05)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes
durationNo

Implementation Reference

  • index.js:23-23 (registration)
    The 'video_generate' tool is defined in the TOOLS array, specifying its input schema and associated API endpoint.
    { name: 'video_generate', description: 'Generate a short video from a prompt using Kling AI', inputSchema: { type: 'object', properties: { prompt: { type: 'string' }, duration: { type: 'number', default: 5 } }, required: ['prompt'] }, endpoint: '/video/generate', price: '$0.05' },
  • index.js:94-115 (handler)
    The tool handler dispatches the call to the generic `callTool` function, which performs an HTTP request to the configured endpoint.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      
      if (!API_KEY) {
        return {
          content: [{ type: 'text', text: 'Error: ITERATOOLS_API_KEY environment variable not set. Get a key at https://iteratools.com' }],
          isError: true,
        };
      }
      
      const tool = TOOLS.find(t => t.name === name);
      if (!tool) {
        return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
      }
      
      try {
        const result = await callTool(tool.endpoint, args);
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
      } catch (err) {
        return { content: [{ type: 'text', text: `Error: ${err.message}` }], isError: true };
      }
    });
  • The `callTool` helper function executes the API request for any tool by calling the specified endpoint with the provided parameters.
    async function callTool(endpoint, params) {
      const fetch = (await import('node-fetch')).default;
      const isGet = ['GET'].includes((TOOLS.find(t => t.endpoint === endpoint) || {}).method);
      
      const url = isGet 
        ? `${BASE_URL}${endpoint}?${new URLSearchParams(params)}`
        : `${BASE_URL}${endpoint}`;
      
      const res = await fetch(url, {
        method: isGet ? 'GET' : 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Authorization': `Bearer ${API_KEY}`,
        },
        body: isGet ? undefined : JSON.stringify(params),
      });
      
      const text = await res.text();
      let data;
      try { data = JSON.parse(text); } catch { data = { raw: text }; }
      
      if (!res.ok) {
        if (res.status === 402) {
          throw new Error(`Insufficient credits. Add credits at https://iteratools.com. Cost: ${TOOLS.find(t=>t.endpoint===endpoint)?.price || 'see docs'}`);
        }
        throw new Error(`API error ${res.status}: ${text.substring(0, 200)}`);
      }
      
      return data;
    }
Behavior3/5

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

With no annotations provided, the description carries full disclosure burden. It successfully notes the cost and external provider (Kling AI), but omits critical operational details: output format (MP4? GIF?), resolution limits, async vs. synchronous behavior, and content policy restrictions.

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?

Single, dense sentence front-loaded with the action. Every element earns its place: function (generate), scope (short video), input (prompt), provider (Kling AI), and cost constraint ($0.05). No redundant or filler text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 2-parameter tool with simple types and no output schema, the description is minimally viable. The cost disclosure adds necessary context for a paid API, but the undocumented 'duration' parameter and lack of output format guidance leave gaps that should be addressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage. The description mentions 'prompt' implicitly but does not explain what it should contain (scene description, style, motion cues?) or the expected format. It completely omits the 'duration' parameter and its units (seconds?).

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?

Clear verb ('Generate') and resource ('short video'), specifies input mechanism ('from a prompt') and provider ('Kling AI'). Distinguishes from siblings by medium (video vs. image/audio) and cost model, though lacks explicit differentiation from image_generate.

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?

Mentions cost ($0.05) which informs budget-conscious usage, but provides no explicit guidance on when to choose video over image_generate or other visual tools, and no prerequisites or constraints for the prompt content.

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/fredpsantos33/itera-tools-mcp'

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