Skip to main content
Glama
landicefu

Divide and Conquer MCP Server

by landicefu

add_note

Adds a note to a task to preserve context, track progress, and maintain structured information during complex task breakdowns.

Instructions

Adds a note to the task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesThe content of the note

Implementation Reference

  • The handler function that executes the add_note tool logic: validates content, reads task data, appends note with timestamp to notes array, persists to config file, returns success message.
    private async addNote(args: any): Promise<any> {
      if (!args?.content) {
        throw new McpError(ErrorCode.InvalidParams, 'Note content is required');
      }
    
      try {
        const taskData = await this.readTaskData();
        
        // Initialize the notes array if it doesn't exist
        if (!taskData.notes) {
          taskData.notes = [];
        }
        
        // Add the note
        taskData.notes.push({
          timestamp: new Date().toISOString(),
          content: args.content
        });
        
        // Write the updated task data to the file
        await this.writeTaskData(taskData);
        
        return {
          content: [
            {
              type: 'text',
              text: 'Note added successfully.',
            },
          ],
        };
      } catch (error) {
        console.error('Error adding note:', error);
        return {
          content: [
            {
              type: 'text',
              text: `Error adding note: ${error instanceof Error ? error.message : String(error)}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema for the add_note tool, requiring a 'content' string.
    inputSchema: {
      type: 'object',
      properties: {
        content: {
          type: 'string',
          description: 'The content of the note'
        }
      },
      required: ['content']
    }
  • src/index.ts:442-443 (registration)
    Dispatch case in the main tool request handler switch statement that calls the addNote handler for 'add_note' tool.
    case 'add_note':
      return await this.addNote(request.params.arguments);
  • src/index.ts:324-337 (registration)
    Tool object in the tools list registered via server.setTools, defining name, description, and input schema for add_note.
    {
      name: 'add_note',
      description: 'Adds a note to the task.',
      inputSchema: {
        type: 'object',
        properties: {
          content: {
            type: 'string',
            description: 'The content of the note'
          }
        },
        required: ['content']
      }
    },

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