Skip to main content
Glama
landicefu

Divide and Conquer MCP Server

by landicefu

reorder_checklist_item

Move checklist items to different positions to organize task sequences. Specify current and new positions using zero-based indexes.

Instructions

Moves a checklist item to a new position.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_indexYesThe current index of the checklist item (0-based)
to_indexYesThe new index for the checklist item (0-based)

Implementation Reference

  • The handler function for the 'reorder_checklist_item' tool. It validates the from_index and to_index, reads the current task data, moves the checklist item using array splice, updates and saves the task data, and returns a success or error message.
    private async reorderChecklistItem(args: any): Promise<any> {
      if (args?.from_index === undefined || args?.to_index === undefined) {
        throw new McpError(ErrorCode.InvalidParams, 'From index and to index are required');
      }
    
      try {
        const taskData = await this.readTaskData();
        
        // Check if the indices are valid
        if (args.from_index < 0 || args.from_index >= taskData.checklist.length) {
          throw new McpError(ErrorCode.InvalidParams, `Invalid from index: ${args.from_index}`);
        }
        
        if (args.to_index < 0 || args.to_index > taskData.checklist.length) {
          throw new McpError(ErrorCode.InvalidParams, `Invalid to index: ${args.to_index}`);
        }
        
        // Move the checklist item
        const [item] = taskData.checklist.splice(args.from_index, 1);
        taskData.checklist.splice(args.to_index, 0, item);
        
        // Write the updated task data to the file
        await this.writeTaskData(taskData);
        
        return {
          content: [
            {
              type: 'text',
              text: 'Checklist item reordered successfully.',
            },
          ],
        };
      } catch (error) {
        console.error('Error reordering checklist item:', error);
        return {
          content: [
            {
              type: 'text',
              text: `Error reordering checklist item: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • The input schema definition for the 'reorder_checklist_item' tool, specifying required from_index and to_index as numbers with descriptions.
    inputSchema: {
      type: 'object',
      properties: {
        from_index: {
          type: 'number',
          description: 'The current index of the checklist item (0-based)'
        },
        to_index: {
          type: 'number',
          description: 'The new index for the checklist item (0-based)'
        }
      },
      required: ['from_index', 'to_index']
    }
  • src/index.ts:440-441 (registration)
    The switch case in the CallToolRequest handler that routes calls to the reorderChecklistItem method.
    case 'reorder_checklist_item':
      return await this.reorderChecklistItem(request.params.arguments);
  • src/index.ts:306-323 (registration)
    The tool registration in the ListTools response, including name, description, and input schema.
    {
      name: 'reorder_checklist_item',
      description: 'Moves a checklist item to a new position.',
      inputSchema: {
        type: 'object',
        properties: {
          from_index: {
            type: 'number',
            description: 'The current index of the checklist item (0-based)'
          },
          to_index: {
            type: 'number',
            description: 'The new index for the checklist item (0-based)'
          }
        },
        required: ['from_index', 'to_index']
      }
    },
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. It states the action ('moves') but doesn't cover critical aspects like whether this requires specific permissions, how it handles invalid indices (e.g., out-of-bounds), if it affects other items' positions, or what the response looks like. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 front-loaded with the core action ('Moves a checklist item') and avoids redundancy. Every part of the sentence earns its place by clearly conveying the essential function.

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 tool's complexity as a mutation operation with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., error handling, side effects), usage context, and return values. While the schema covers parameters well, the overall context for safe and effective use is insufficient, especially for a tool that modifies data.

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 description implies positional parameters but doesn't add meaning beyond what the input schema provides. The schema has 100% coverage with clear descriptions for 'from_index' and 'to_index' as 0-based indices. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate with additional context like index validation or effects on other items.

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 ('moves') and resource ('checklist item') with the specific action of repositioning ('to a new position'). It distinguishes from siblings like 'remove_checklist_item' or 'update_checklist_item' by focusing on positional changes rather than deletion or content modification. However, it doesn't explicitly differentiate from all siblings (e.g., 'clear_task' might also affect ordering), keeping it from a perfect score.

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. It doesn't mention prerequisites (e.g., needing an existing checklist), exclusions (e.g., invalid indices), or related tools like 'update_checklist_item' for non-positional changes. Without such context, the agent must infer usage from the tool name and schema 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/landicefu/divide-and-conquer-mcp-server'

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