Skip to main content
Glama

list_tasks

View and filter Kling AI video generation tasks by status, date range, or pagination to monitor progress and access task history.

Instructions

List all your Kling AI generation tasks with filtering options. View task history, check statuses, and filter by date range or status. Supports pagination for browsing through large task lists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination (default: 1)
page_sizeNoNumber of tasks per page (default: 10, max: 100)
statusNoFilter tasks by status
start_timeNoFilter tasks created after this time (ISO 8601 format)
end_timeNoFilter tasks created before this time (ISO 8601 format)

Implementation Reference

  • Core handler function that executes the Kling API call to list tasks with optional filtering and pagination parameters.
    async listTasks(params?: TaskListParams): Promise<any> {
      const path = '/v1/task/list';
      
      const queryParams = {
        page: params?.page || 1,
        page_size: params?.page_size || 10,
        ...(params?.status && { status: params.status }),
        ...(params?.start_time && { start_time: params.start_time }),
        ...(params?.end_time && { end_time: params.end_time }),
      };
    
      try {
        const response = await this.axiosInstance.get(path, { params: queryParams });
        return response.data.data;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          throw new Error(`Kling API error: ${error.response?.data?.message || error.message}`);
        }
        throw error;
      }
    }
  • Type definition for the input parameters of the listTasks tool.
    export interface TaskListParams {
      page?: number;
      page_size?: number;
      status?: 'submitted' | 'processing' | 'succeed' | 'failed';
      start_time?: string;
      end_time?: string;
    }
  • src/index.ts:431-464 (registration)
    Tool registration in the TOOLS array, including name, description, and input schema.
    {
      name: 'list_tasks',
      description: 'List all your Kling AI generation tasks with filtering options. View task history, check statuses, and filter by date range or status. Supports pagination for browsing through large task lists.',
      inputSchema: {
        type: 'object',
        properties: {
          page: {
            type: 'number',
            description: 'Page number for pagination (default: 1)',
            minimum: 1,
          },
          page_size: {
            type: 'number',
            description: 'Number of tasks per page (default: 10, max: 100)',
            minimum: 1,
            maximum: 100,
          },
          status: {
            type: 'string',
            enum: ['submitted', 'processing', 'succeed', 'failed'],
            description: 'Filter tasks by status',
          },
          start_time: {
            type: 'string',
            description: 'Filter tasks created after this time (ISO 8601 format)',
          },
          end_time: {
            type: 'string',
            description: 'Filter tasks created before this time (ISO 8601 format)',
          },
        },
        required: [],
      },
    },
  • MCP server handler for the 'list_tasks' tool call, which invokes klingClient.listTasks and formats the response as text.
    case 'list_tasks': {
      const params: TaskListParams = {
        page: args.page as number,
        page_size: args.page_size as number,
        status: args.status as 'submitted' | 'processing' | 'succeed' | 'failed',
        start_time: args.start_time as string,
        end_time: args.end_time as string,
      };
    
      const taskList = await klingClient.listTasks(params);
      
      let tasksText = `Kling AI Task List (Page ${params.page || 1}):\n`;
      tasksText += `\nTotal Tasks: ${taskList.total || 0}`;
      
      if (taskList.tasks && taskList.tasks.length > 0) {
        tasksText += '\n\nTasks:';
        taskList.tasks.forEach((task: any, index: number) => {
          tasksText += `\n\n${index + 1}. Task ID: ${task.task_id}`;
          tasksText += `\n   Type: ${task.task_type || 'N/A'}`;
          tasksText += `\n   Status: ${task.task_status}`;
          tasksText += `\n   Created: ${new Date(task.created_at * 1000).toLocaleString()}`;
          if (task.updated_at) {
            tasksText += `\n   Updated: ${new Date(task.updated_at * 1000).toLocaleString()}`;
          }
          if (task.model_name) {
            tasksText += `\n   Model: ${task.model_name}`;
          }
        });
      } else {
        tasksText += '\n\nNo tasks found.';
      }
      
      return {
        content: [
          {
            type: 'text',
            text: tasksText,
          },
        ],
      };
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool supports pagination for large task lists, which is a useful behavioral trait. However, it lacks details on permissions, rate limits, error handling, or the structure of returned data, leaving gaps in understanding the tool's full behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, starting with the core purpose. Both sentences earn their place by adding context (filtering options and pagination support). It avoids unnecessary details, making it efficient, though it could be slightly more structured by explicitly separating purpose from features.

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?

Given the tool's moderate complexity (5 parameters, no output schema, no annotations), the description is somewhat complete but has gaps. It covers the purpose and key features like filtering and pagination, but without annotations or output schema, it lacks details on authentication, error handling, and return format, which are important for full context.

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?

Schema description coverage is 100%, meaning all parameters are well-documented in the schema itself. The description mentions filtering by date range or status, which aligns with the schema but doesn't add significant meaning beyond it. With high schema coverage, the baseline score is 3, as the description provides minimal extra value for parameters.

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 tool's purpose: 'List all your Kling AI generation tasks with filtering options.' It specifies the resource (Kling AI generation tasks) and the action (list with filtering). However, it doesn't explicitly differentiate from sibling tools like 'check_image_status' or 'check_video_status', which might also involve task status checking, though those appear more specific to media types.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by mentioning 'View task history, check statuses, and filter by date range or status,' suggesting it's for monitoring and filtering tasks. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like the status-checking siblings (e.g., 'check_image_status'), nor does it specify any exclusions or prerequisites for use.

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/199-mcp/mcp-kling'

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