Skip to main content
Glama

edit_node

Modify an existing node in Dynalist documents by updating content, notes, formatting, or status to maintain organized outlines and lists.

Instructions

Edit an existing node in a Dynalist document

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoDynalist URL with node deep link
file_idNoDocument ID (alternative to URL)
node_idYesNode ID to edit
contentNoNew content text
noteNoNew note text
checkedNoChecked status
checkboxNoWhether to show checkbox
headingNoHeading level (0-3)
colorNoColor label (0-6)

Implementation Reference

  • Registration of the 'edit_node' tool using server.tool, including schema and handler.
    server.tool(
      "edit_node",
      "Edit an existing node in a Dynalist document",
      {
        url: z.string().optional().describe("Dynalist URL with node deep link"),
        file_id: z.string().optional().describe("Document ID (alternative to URL)"),
        node_id: z.string().describe("Node ID to edit"),
        content: z.string().optional().describe("New content text"),
        note: z.string().optional().describe("New note text"),
        checked: z.boolean().optional().describe("Checked status"),
        checkbox: z.boolean().optional().describe("Whether to show checkbox"),
        heading: z.number().min(0).max(3).optional().describe("Heading level (0-3)"),
        color: z.number().min(0).max(6).optional().describe("Color label (0-6)"),
      },
      async ({ url, file_id, node_id, content, note, checked, checkbox, heading, color }) => {
        let documentId = file_id;
    
        if (url) {
          const parsed = parseDynalistUrl(url);
          documentId = parsed.documentId;
        }
    
        if (!documentId) {
          return {
            content: [{ type: "text", text: "Error: Either 'url' or 'file_id' must be provided" }],
            isError: true,
          };
        }
    
        const change: Record<string, unknown> = {
          action: "edit",
          node_id,
        };
    
        // Only include fields that are explicitly set
        if (content !== undefined) change.content = content;
        if (note !== undefined) change.note = note;
        if (checked !== undefined) change.checked = checked;
        if (checkbox !== undefined) change.checkbox = checkbox;
        if (heading !== undefined) change.heading = heading;
        if (color !== undefined) change.color = color;
    
        const response = await client.editDocument(documentId, [change as any]);
    
        return {
          content: [
            {
              type: "text",
              text: `Node edited successfully!\nDocument: ${documentId}\nNode: ${node_id}`,
            },
          ],
        };
      }
    );
  • Input schema using Zod for validating parameters like node_id, content, note, etc.
    {
      url: z.string().optional().describe("Dynalist URL with node deep link"),
      file_id: z.string().optional().describe("Document ID (alternative to URL)"),
      node_id: z.string().describe("Node ID to edit"),
      content: z.string().optional().describe("New content text"),
      note: z.string().optional().describe("New note text"),
      checked: z.boolean().optional().describe("Checked status"),
      checkbox: z.boolean().optional().describe("Whether to show checkbox"),
      heading: z.number().min(0).max(3).optional().describe("Heading level (0-3)"),
      color: z.number().min(0).max(6).optional().describe("Color label (0-6)"),
    },
  • Handler function that parses input, constructs edit change object, calls client.editDocument, and returns success message.
    async ({ url, file_id, node_id, content, note, checked, checkbox, heading, color }) => {
      let documentId = file_id;
    
      if (url) {
        const parsed = parseDynalistUrl(url);
        documentId = parsed.documentId;
      }
    
      if (!documentId) {
        return {
          content: [{ type: "text", text: "Error: Either 'url' or 'file_id' must be provided" }],
          isError: true,
        };
      }
    
      const change: Record<string, unknown> = {
        action: "edit",
        node_id,
      };
    
      // Only include fields that are explicitly set
      if (content !== undefined) change.content = content;
      if (note !== undefined) change.note = note;
      if (checked !== undefined) change.checked = checked;
      if (checkbox !== undefined) change.checkbox = checkbox;
      if (heading !== undefined) change.heading = heading;
      if (color !== undefined) change.color = color;
    
      const response = await client.editDocument(documentId, [change as any]);
    
      return {
        content: [
          {
            type: "text",
            text: `Node edited successfully!\nDocument: ${documentId}\nNode: ${node_id}`,
          },
        ],
      };
    }

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/cristip73/dynalist-mcp'

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