Skip to main content
Glama

toggle_complete

Mark a Workflowy node as complete or incomplete by specifying its ID and the completion status. Update task status directly without manual editing.

Instructions

Toggle completion status of a node

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesID of the node to toggle completion status
completedYesWhether the node should be marked as complete (true) or incomplete (false)

Implementation Reference

  • The handler function for the 'toggle_complete' tool. It accepts nodeId and completed parameters, calls workflowyClient.toggleComplete(), and returns a success or error message.
    toggle_complete: {
      description: "Toggle completion status of a node",
      inputSchema: {
        nodeId: z.string().describe("ID of the node to toggle completion status"),
        completed: z.boolean().describe("Whether the node should be marked as complete (true) or incomplete (false)")
      },
      handler: async ({ nodeId, completed, username, password }:
          { nodeId: string, completed: boolean, username?: string, password?: string },
          client: typeof workflowyClient) => {
        try {
          await workflowyClient.toggleComplete(nodeId, completed, username, password);
          return {
            content: [{
              type: "text",
              text: `Successfully ${completed ? "completed" : "uncompleted"} node ${nodeId}`
            }]
          };
        } catch (error: any) {
          return {
            content: [{
              type: "text",
              text: `Error toggling completion status: ${error.message}`
            }]
          };
        }
      }
    }
  • Input schema for the toggle_complete tool: requires nodeId (string) and completed (boolean).
    inputSchema: {
      nodeId: z.string().describe("ID of the node to toggle completion status"),
      completed: z.boolean().describe("Whether the node should be marked as complete (true) or incomplete (false)")
    },
  • The WorkflowyClient.toggleComplete() method that finds the node by ID and calls node.setCompleted() or node.setCompleted(false), then saves the document.
    async toggleComplete(nodeId: string, completed: boolean, username?: string, password?: string) {
        const { wf } = await this.createAuthenticatedClient(username, password);
        const doc = await wf.getDocument();
        const node = this.findNodeById(doc.root, nodeId);
        if (!node) {
            throw new Error(`Node with ID ${nodeId} not found.`);
        }
    
        if (completed) {
            await node.setCompleted();
        } else {
            await node.setCompleted(false);
        }
    
        if (doc.isDirty()) {
            // Saves the changes if there are any
            await doc.save();
        }
    }
  • The registerTools function that iterates over toolRegistry (which includes toggle_complete from workflowyTools) and registers each tool with the FastMCP server.
    export function registerTools(server: FastMCP): void {
      Object.entries(toolRegistry).forEach(([name, tool]) => {
        server.addTool({
          name,
          description: tool.description,
          parameters: z.object(tool.inputSchema),
          annotations: tool.annotations,
          execute: tool.handler
          });
      });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It implies mutation but does not disclose side effects, authorization needs, or that the 'completed' parameter makes it a setter rather than a true toggle. Minimal behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, clear sentence with no wasted words. Efficient but very brief; could have elaborated slightly without harming conciseness.

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?

For a simple tool with two well-documented parameters, the description is mostly adequate but lacks mention of return values or errors. No output schema exists, so some extra context would be helpful.

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?

Schema coverage is 100%, so the schema already documents both parameters. The description adds no extra meaning beyond the schema. Baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('toggle completion status') and the resource ('node'), distinguishing it from sibling tools like create_node or update_node which have different purposes.

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?

No guidance is provided on when to use this tool versus alternatives, such as update_node which could also set the completed field. The description lacks context for selecting this tool.

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/danield137/mcp-workflowy'

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