Skip to main content
Glama

search_nodes

Read-onlyIdempotent

Search Workflowy nodes using a query to identify matching items, helping locate relevant content within your list.

Instructions

Search nodes in Workflowy

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query to find matching nodes

Implementation Reference

  • The handler function for the search_nodes tool. Accepts a query string and credentials, delegates to workflowyClient.search(), and returns the results as JSON text content.
    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}`
          }]
        };
      }
    }
  • Input schema for search_nodes: requires a 'query' string parameter.
    inputSchema: {
      query: z.string().describe("Search query to find matching nodes")
    },
  • The registerTools function iterates over toolRegistry (which includes search_nodes via spread from workflowyTools) and registers each with FastMCP server using its name, description, parameters, annotations, and execute handler.
    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
          });
      });
  • The search helper method on WorkflowyClient. Authenticates, fetches the document, then performs a DFS traversal of all nodes, collecting those whose name (case-insensitive) includes the query string.
    async search(query: string, username?: string, password?: string) {
        const { wf } = await this.createAuthenticatedClient(username, password);
        const t = await wf.getDocument();
        const items = t.root.items;
        let results = [];
        let stack = [...t.root.items];
        while (stack.length > 0) {
            const current = stack.pop();
            if (current!.name.toLowerCase().includes(query.toLowerCase())) {
                results.push(current!.toJson());
            }
            if (current!.items) {
                stack.push(...current!.items);
            }
        }
        // need to traverse the tree to find all items
    
        return results
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the description adds little beyond confirming it is a search operation. No behavioral specifics like result limits or query syntax are disclosed.

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?

The description is a single sentence that immediately conveys the action. It is concise and front-loaded with no filler.

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?

The tool is simple with one parameter, but the description does not explain the output format or behavior when no matches are found, which is necessary given no output schema.

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?

The input schema already describes the 'query' parameter with a description. The tool's description adds no additional meaning beyond the schema, which has 100% coverage.

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

Purpose4/5

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

The description states the tool does a search on nodes. It is clear but does not differentiate from sibling tools like list_nodes, which might also retrieve nodes.

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 list_nodes or other siblings. The description lacks context for appropriate usage.

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