search_nodes
Find saved knowledge nodes using text search, semantic matching, and filters for tags or status.
Instructions
Search saved nodes with full-text and semantic search
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes |
Implementation Reference
- src/nodes.ts:35-53 (handler)The handler function for the 'search_nodes' MCP tool. It invokes the API client's searchNodes method with the input state, processes the response, and returns MCP-formatted content or an error.async ({ state }) => { const result = await apiClient.searchNodes(state); if (result.error) { return { content: [{ type: 'text', text: result.error }], isError: true, }; } return { content: [ { type: 'text', text: JSON.stringify(result.data, null, 2), }, ], }; },
- src/nodes.ts:15-34 (schema)Zod schema defining the input parameters for the 'search_nodes' tool: query (required string), optional tags array, status enum, and limit number.{ state: z.object({ query: z .string() .describe('Search term (matches title, body, or tags)'), tags: z .array(z.string()) .optional() .describe('Filter by specific tags'), status: z .enum(['active', 'parked', 'done', 'archived']) .optional() .describe('Filter by status'), limit: z .number() .optional() .default(20) .describe('Maximum number of results'), }), },
- src/nodes.ts:12-54 (registration)Registers the 'search_nodes' tool on the MCP server using server.tool(), providing name, description, input schema, and handler function.server.tool( 'search_nodes', 'Search saved nodes with full-text and semantic search', { state: z.object({ query: z .string() .describe('Search term (matches title, body, or tags)'), tags: z .array(z.string()) .optional() .describe('Filter by specific tags'), status: z .enum(['active', 'parked', 'done', 'archived']) .optional() .describe('Filter by status'), limit: z .number() .optional() .default(20) .describe('Maximum number of results'), }), }, async ({ state }) => { const result = await apiClient.searchNodes(state); if (result.error) { return { content: [{ type: 'text', text: result.error }], isError: true, }; } return { content: [ { type: 'text', text: JSON.stringify(result.data, null, 2), }, ], }; }, );
- src/api-client.ts:58-68 (helper)Helper method in the API client that sends a POST request to the '/mcp/search-nodes' backend endpoint with search parameters.async searchNodes(params: { query: string; tags?: string[]; status?: string; limit?: number; }): Promise<ApiResponse<any>> { return this.request('/mcp/search-nodes', { method: 'POST', body: JSON.stringify(params), }); }