Skip to main content
Glama

list_nodes

Retrieve nodes from Workflowy by specifying a parent ID to list child nodes or omit to fetch root nodes, enabling structured data access and organization.

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 handler function that implements the core logic of the 'list_nodes' tool. It fetches and returns either root nodes or child nodes of a given parentId from Workflowy, handling errors gracefully.
    handler: async ({ parentId, username, password }: { parentId?: string, username?: string, password?: string }) => { try { const items = !!parentId ? await workflowyClient.getChildItems(parentId, username, password) : await workflowyClient.getRootItems(username, password); return { content: [{ type: "text", text: JSON.stringify(items, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error listing nodes: ${error.message}` }] }; } },
  • Zod-based input schema defining the optional 'parentId' parameter for the 'list_nodes' tool.
    inputSchema: { parentId: z.string().optional().describe("ID of the parent node to list children from. If omitted, returns root nodes.") },
  • The registration function that adds the 'list_nodes' tool (along with others) to the FastMCP server by iterating over the toolRegistry and calling server.addTool.
    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)
    Central tool registry where 'list_nodes' is included via the spread of workflowyTools.
    export const toolRegistry: Record<string, any> = { ...workflowyTools, // Add more tool categories here };
  • src/index.ts:14-14 (registration)
    Invocation of the registerTools function in the main server setup, which registers the 'list_nodes' tool.
    registerTools(server);

Other Tools

Related 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