search_nodes
Quickly locate specific nodes in Workflowy by entering a search query. Simplify task management and organization by finding relevant content instantly.
Instructions
Search nodes in Workflowy
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query to find matching nodes |
Implementation Reference
- src/tools/workflowy.ts:51-68 (handler)The async handler function implementing the core logic of the 'search_nodes' tool. It invokes workflowyClient.search with the provided query and credentials, returning the search results as JSON or an error message.handler: async ({ query, username, password }: { query: string, username?: string, password?: string }, client: typeof workflowyClient) => { try { const items = await workflowyClient.search(query, username, password); return { content: [{ type: "text", text: JSON.stringify(items, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error searching nodes: ${error.message}` }] }; } }
- src/tools/workflowy.ts:41-43 (schema)Zod-based input schema defining the 'query' parameter for the search_nodes tool.inputSchema: { query: z.string().describe("Search query to find matching nodes") },
- src/tools/index.ts:12-22 (registration)The registerTools function that iterates over the toolRegistry (which includes search_nodes from workflowyTools) and registers each tool with the MCP server via server.addTool, mapping the handler, schema, etc.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/workflowy.ts:39-69 (registration)The complete definition of the search_nodes tool object within the exported workflowyTools, which is spread into the central toolRegistry.search_nodes: { description: "Search nodes in Workflowy", inputSchema: { query: z.string().describe("Search query to find matching nodes") }, annotations: { title: "Search nodes in Workflowy", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, handler: async ({ query, username, password }: { query: string, username?: string, password?: string }, client: typeof workflowyClient) => { try { const items = await workflowyClient.search(query, username, password); return { content: [{ type: "text", text: JSON.stringify(items, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Error searching nodes: ${error.message}` }] }; } } },