Skip to main content
Glama
niko91i

Deepseek-Thinking-Claude-3.5-Sonnet-CLINE-MCP

by niko91i

check_response_status

Monitor the progress of AI response generation tasks to track completion status and retrieve results when ready.

Instructions

Check the status of a response generation task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYesThe task ID returned by generate_response

Implementation Reference

  • The handler logic for the 'check_response_status' tool within the CallToolRequestSchema request handler. It validates input, retrieves the task status from activeTasks map, checks for timeouts and maximum check attempts, implements exponential backoff for polling delays, updates task metadata, and returns the current status, reasoning/response if available, error if any, and suggested next check interval.
    } else if (request.params.name === "check_response_status") {
      if (!isValidCheckResponseStatusArgs(request.params.arguments)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Invalid check_response_status arguments"
        );
      }
    
      const taskId = request.params.arguments.taskId;
      const task = this.activeTasks.get(taskId);
    
      if (!task) {
        throw new McpError(
          ErrorCode.InvalidRequest,
          `No task found with ID: ${taskId}`
        );
      }
    
      // Vérifier si la tâche a expiré
      const currentTime = Date.now();
      if (currentTime - task.timestamp > TASK_TIMEOUT_MS) {
        const updatedTask = {
          ...task,
          status: "error" as const,
          error: `Tâche expirée après ${TASK_TIMEOUT_MS / 60000} minutes`
        };
        this.activeTasks.set(taskId, updatedTask);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                status: updatedTask.status,
                reasoning: updatedTask.showReasoning ? updatedTask.reasoning : undefined,
                response: undefined,
                error: updatedTask.error,
                timeoutAfter: TASK_TIMEOUT_MS / 60000
              })
            }
          ]
        };
      }
    
      // Mettre à jour les propriétés de suivi
      const checkAttempts = (task.checkAttempts || 0) + 1;
      
      // Vérifier si nous avons atteint le nombre maximal de tentatives
      if (checkAttempts > MAX_STATUS_CHECK_ATTEMPTS && task.status !== "complete" && task.status !== "error") {
        const updatedTask = {
          ...task,
          status: "error" as const,
          error: `Nombre maximum de tentatives atteint (${MAX_STATUS_CHECK_ATTEMPTS})`,
          checkAttempts
        };
        this.activeTasks.set(taskId, updatedTask);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                status: updatedTask.status,
                reasoning: updatedTask.showReasoning ? updatedTask.reasoning : undefined,
                response: undefined,
                error: updatedTask.error,
                maxAttempts: MAX_STATUS_CHECK_ATTEMPTS
              })
            }
          ]
        };
      }
    
      // Calculer le délai avant la prochaine vérification (backoff exponentiel)
      let nextCheckDelay = task.nextCheckDelay || INITIAL_STATUS_CHECK_DELAY_MS;
      nextCheckDelay = Math.min(nextCheckDelay * STATUS_CHECK_BACKOFF_FACTOR, MAX_STATUS_CHECK_DELAY_MS);
      
      // Mettre à jour le statut de la tâche
      const updatedTask = {
        ...task,
        lastChecked: currentTime,
        nextCheckDelay,
        checkAttempts
      };
      this.activeTasks.set(taskId, updatedTask);
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              status: task.status,
              reasoning: task.showReasoning ? task.reasoning : undefined,
              response: task.status === "complete" ? task.response : undefined,
              error: task.error,
              nextCheckIn: Math.round(nextCheckDelay / 1000), // Temps suggéré en secondes
              checkAttempts,
              elapsedTime: Math.round((currentTime - task.timestamp) / 1000) // Temps écoulé en secondes
            }),
          },
        ],
      };
  • src/index.ts:337-350 (registration)
    Registration of the 'check_response_status' tool in the server's listTools response, specifying name, description, and input schema.
    {
      name: "check_response_status",
      description: "Check the status of a response generation task",
      inputSchema: {
        type: "object",
        properties: {
          taskId: {
            type: "string",
            description: "The task ID returned by generate_response",
          },
        },
        required: ["taskId"],
      },
    },
  • TypeScript interface defining the input schema for check_response_status arguments.
    interface CheckResponseStatusArgs {
      taskId: string;
    }
  • Helper function for validating check_response_status arguments against the CheckResponseStatusArgs interface.
    const isValidCheckResponseStatusArgs = (
      args: any
    ): args is CheckResponseStatusArgs =>
      typeof args === "object" && args !== null && typeof args.taskId === "string";
  • TypeScript interface defining the TaskStatus structure used by the check_response_status handler for tracking and returning task state.
    interface TaskStatus {
      status: "pending" | "reasoning" | "responding" | "complete" | "error";
      prompt: string;
      showReasoning?: boolean;
      reasoning?: string;
      response?: string;
      error?: string;
      timestamp: number;
      // Nouvelles propriétés pour gérer le polling
      lastChecked?: number;
      nextCheckDelay?: number;
      checkAttempts?: number;
    }
Behavior2/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 of behavioral disclosure. The description states it 'checks the status,' which implies a read-only operation, but it doesn't specify whether this is a polling mechanism, if there are rate limits, authentication requirements, or what the status values might be. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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, clear sentence: 'Check the status of a response generation task.' It is front-loaded and wastes no words, making it highly efficient and easy to parse.

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 (status checking with one parameter), no annotations, and no output schema, the description is minimally adequate. It identifies the purpose and relates to the sibling tool via the schema, but it lacks details on behavioral aspects like response format, error handling, or operational constraints, which are important for a status-checking tool.

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, with the single parameter 'taskId' documented as 'The task ID returned by generate_response.' The description doesn't add any additional meaning beyond what the schema provides, such as format details or validation rules. With high schema coverage, the baseline score of 3 is appropriate.

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: 'Check the status of a response generation task.' It specifies the verb ('Check') and resource ('status of a response generation task'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from its sibling tool 'generate_response' beyond the implied relationship.

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 context by referencing 'task ID returned by generate_response' in the schema, suggesting this tool should be used after initiating a task with the sibling tool. However, it doesn't provide explicit guidance on when to use this tool versus alternatives or any prerequisites beyond the taskId parameter.

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/niko91i/MCP-deepseek-V3-et-claude-desktop'

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