Skip to main content
Glama

list_nodes

Read-onlyIdempotent

Retrieve a list of Workflowy nodes. Provide a parent node ID to view its children, or omit to view root nodes.

Instructions

List nodes in Workflowy. If a parentId is provided, it lists the child nodes of that parent. If omitted, it lists the root nodes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parentIdNoID of the parent node to list children from. If omitted, returns root nodes.

Implementation Reference

  • The main handler function for the list_nodes tool. It calls workflowyClient.getChildItems (if parentId provided) or workflowyClient.getRootItems (if omitted), then returns the result as JSON text. It handles depth limiting and error handling.
    handler: async ({ parentId, depth, username, password }: { parentId?: string, depth?: number, username?: string, password?: string }) => {
      try {
        const effectiveDepth = depth ?? 0;
        const items = !!parentId
          ? await workflowyClient.getChildItems(parentId, username, password, effectiveDepth)
          : await workflowyClient.getRootItems(username, password, effectiveDepth);
        return {
          content: [{
            type: "text",
            text: JSON.stringify(items, null, 2)
          }]
        };
      } catch (error: any) {
        return {
          content: [{
            type: "text",
            text: `Error listing nodes: ${error.message}`
          }]
        };
      }
    },
  • Input schema for list_nodes: optional parentId (string) and optional depth (number, default 0, with -1 for unlimited). Defined using Zod.
    description: "List nodes in Workflowy. If a `parentId` is provided, it lists the child nodes of that parent. If omitted, it lists the root nodes. By default only returns top-level nodes (depth=0). WARNING: Using depth=-1 (unlimited) can return massive amounts of data and blow up your context - use sparingly!",
    inputSchema: {
      parentId: z.string().optional().describe("ID of the parent node to list children from. If omitted, returns root nodes."),
      depth: z.number().optional().describe("How many levels deep to return. 0 = top level only (default), 1 = include immediate children, -1 = unlimited (WARNING: can return huge amounts of data!)")
    },
  • The registerTools function that registers all tools (including list_nodes) with the FastMCP server. It iterates over toolRegistry and calls server.addTool with name, description, parameters (from zod schema), annotations, and the handler as execute.
    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
          });
      });
  • src/tools/index.ts:6-9 (registration)
    The toolRegistry object which spreads workflowyTools (including list_nodes) into a central registry.
    export const toolRegistry: Record<string, any> = {
      ...workflowyTools,
      // Add more tool categories here
    };
  • Helper method getRootItems on the WorkflowyClient class that retrieves root nodes from the Workflowy document, applying depth limiting via limitDepth.
    async getRootItems(username?: string, password?: string, depth: number = 0) {
        const { wf, client } = await this.createAuthenticatedClient(username, password);
        const doc = await wf.getDocument();
        client.getTreeData()
        const root = doc.root.toJson();
        return this.limitDepth(root, -1, depth);
    }
Behavior3/5

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

Annotations already provide readOnlyHint and idempotentHint. The description adds conditional behavior on parentId, but does not disclose pagination or return format.

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?

Two short, front-loaded sentences with no extraneous text, clearly conveying the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only list tool, the description is adequate, though it could mention that it returns a list of node objects without specifying fields.

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 has 100% description coverage; the description repeats the same information about parentId without adding new semantics.

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 'List nodes in Workflowy' and explains the behavior based on parentId, distinguishing it from siblings like create_node or toggle_complete.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use parentId (to list children) and when not (root nodes), but does not explicitly compare to sibling tools like search_nodes.

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