Skip to content

Add property filter support to query_nodes MCP handler #1036

Closed

Description

@malibio

Summary

The query_nodes MCP tool currently only supports content contains and title contains filters. Property-level filters (e.g., status equals in_progress) are silently ignored, causing agents to get incorrect results.

The backend already has a robust PropertyFilter system (FilterOperator::Equals, NotEquals, Contains, etc.) in models/node.rs, but it's not wired up in the MCP handler.

Problem

When an AI agent queries for tasks with status: in_progress, it sends:

{ "filters": [{ "field": "status", "operator": "equals", "value": "in_progress" }] }

This filter is silently ignored and all tasks are returned, leading to incorrect results.

Acceptance Criteria

  • query_nodes MCP handler supports property filters via the existing PropertyFilter system
  • Supported operators: equals, not_equals, contains, starts_with, ends_with
  • Unsupported filter fields/operators return a clear error instead of being silently ignored
  • Tool description/schema updated to document supported property filters
  • Tests cover property filtering through MCP

Context

  • PropertyFilter implementation: packages/core/src/models/node.rs:603
  • Query service with property filters: packages/core/src/services/query_service/mod.rs
  • MCP handler: packages/core/src/mcp/handlers/nodes.rs:523

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions