Skip to main content
Glama
landicefu

Divide and Conquer MCP Server

by landicefu

mark_task_undone

Reverts a completed checklist item to an incomplete status to correct errors or adjust task progress in structured workflows.

Instructions

Marks a checklist item as not done.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYesThe index of the checklist item to mark as not done (0-based)

Implementation Reference

  • Implements the core logic for the mark_task_undone tool: validates index, reads task data, sets checklist item done to false, updates progress by saving to file, returns success message.
    private async markTaskUndone(args: any): Promise<any> {
      if (args?.index === undefined) {
        throw new McpError(ErrorCode.InvalidParams, 'Index is required');
      }
    
      try {
        const taskData = await this.readTaskData();
        
        // Check if the index is valid
        if (args.index < 0 || args.index >= taskData.checklist.length) {
          throw new McpError(ErrorCode.InvalidParams, `Invalid index: ${args.index}`);
        }
        
        // Mark the checklist item as not done
        taskData.checklist[args.index].done = false;
        
        // Write the updated task data to the file
        await this.writeTaskData(taskData);
        
        return {
          content: [
            {
              type: 'text',
              text: 'Task marked as not done.',
            },
          ],
        };
      } catch (error) {
        console.error('Error marking task as not done:', error);
        return {
          content: [
            {
              type: 'text',
              text: `Error marking task as not done: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Defines the input schema for the mark_task_undone tool in the ListTools response, specifying required 'index' parameter.
    {
      name: 'mark_task_undone',
      description: 'Marks a checklist item as not done.',
      inputSchema: {
        type: 'object',
        properties: {
          index: {
            type: 'number',
            description: 'The index of the checklist item to mark as not done (0-based)'
          }
        },
        required: ['index']
      }
  • src/index.ts:436-437 (registration)
    Registers the tool handler in the CallToolRequest switch statement, routing calls to the markTaskUndone method.
    case 'mark_task_undone':
      return await this.markTaskUndone(request.params.arguments);

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/landicefu/divide-and-conquer-mcp-server'

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