Skip to content

Conversation

@lukasnxyz
Copy link
Contributor

@lukasnxyz lukasnxyz commented Jun 10, 2025

description

  • fix filter_items mcp tool endpoint
  • move colored string util to global
  • split testing
  • generator tests for diff schemas and queries (checking compiling works)
  • fix release optim configs
  • fix search by edge type not working
  • schema resource in mcp server

issues

closes #103

@lukasnxyz lukasnxyz changed the base branch from main to dev June 14, 2025 17:44
@lukasnxyz lukasnxyz marked this pull request as ready for review June 15, 2025 18:04
Copilot AI review requested due to automatic review settings June 15, 2025 18:04
@lukasnxyz lukasnxyz self-assigned this Jun 15, 2025
@lukasnxyz lukasnxyz requested review from xav-db and removed request for Copilot June 15, 2025 18:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the MCP pipeline to add a new FilterItems tool, propagate a database schema through the router, and clean up test and config utilities.

  • Introduces FilterItems in ToolArgs and implements it in McpTools
  • Adds a schema_resource MCP endpoint and wires schema into the router and storage
  • Moves StyledString utility into a shared module and comments out HNSW bench tests

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
helixdb/src/helix_gateway/mcp/tools.rs Added FilterItems to ToolArgs and its implementation
helixdb/src/helix_gateway/mcp/mcp.rs Removed init payload parsing, added schema_resource
helixdb/src/helix_gateway/router/router.rs Passed schema into MCP tool input
helixdb/src/helix_engine/storage_core/storage_core.rs Stored schema string on HelixGraphStorage
helixdb/src/helix_engine/graph_core/config.rs Renamed and extended config loader to include schema
helixdb/src/helix_engine/vector_core/hnsw_tests.rs Bench tests commented out
helix-container/src/queries.rs Updated query handlers (get_patients_visits) outputs
Comments suppressed due to low confidence (7)

helixdb/src/helix_gateway/mcp/tools.rs:134

  • The parameter order for filter_items was changed (moved txn to the end), breaking the trait signature. Restore the original parameter order (txn first) or update all callers to match.
fn filter_items(

helixdb/src/helix_engine/vector_core/hnsw_tests.rs:27

  • The HNSW benchmark tests have been entirely commented out, disabling coverage for vector recall testing. Consider converting these into #[ignore] tests or parameterized CI benchmarks rather than fully removing them.
/*

helixdb/src/helix_gateway/mcp/mcp.rs:165

  • The init handler no longer parses the expected InitRequest fields (e.g., connection_addr and connection_port), breaking clients that send those. Reintroduce request deserialization or update the API contract and clients accordingly.
pub fn init<'a>(input: &'a mut MCPToolInput, response: &mut Response) -> Result<(), GraphError> {

helixdb/src/helix_engine/graph_core/config.rs:46

  • Renaming from_config_file to from_files and changing its signature is a breaking API change. Either preserve the old method or clearly document the new signature and migrate callers.
pub fn from_files(config_path: PathBuf, schema_path:PathBuf) -> Result<Self, GraphError> {

helixdb/src/helix_gateway/mcp/tools.rs:83

  • By removing the wildcard match arm, any unsupported ToolArgs variant will now cause a compile‐time pattern‐match error. Reintroduce a fallback case to return a clear Tool not found error for unknown variants.
ToolArgs::FilterItems { properties, filter_traversals } => self.filter_items(connection, properties, filter_traversals, txn),

helix-container/src/queries.rs:239

  • The handler for get_patients_visits_in_previous_month now only inserts visits in the response and omits the patient field, which likely breaks existing clients expecting both. Re-add the missing patient insertion or document the new response shape.
return_vals.insert("visits".to_string(), ReturnValue::from_traversal_value_array_with_mixin(visits.clone(), remapping_vals.borrow_mut()));

helixdb/src/helix_gateway/mcp/tools.rs:359

  • [nitpick] Leaving debug println! statements in production code can clutter logs and leak internal state. Remove or replace with a proper logging macro at debug level.
println!("properties: {:?}", properties);


/// Same, but returns an owned clone for convenience.
fn cloned_base(&self) -> Type {
fn cloned_base(&self) -> Type { // TODO: never used?
Copy link

Copilot AI Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The cloned_base method is marked as never used—either remove it if obsolete or implement its intended use. Leaving dead code with TODO hurts long-term maintainability.

Copilot uses AI. Check for mistakes.
Copy link
Member

@xav-db xav-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all looks good

@xav-db xav-db merged commit 9877894 into dev Jun 15, 2025
@xav-db xav-db deleted the mcp-fixes branch June 15, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move optimization flags to the root Cargo.toml

3 participants