Skip to content

brain_list MCP tool always returns 400: category=[object Object] #703

Description

@vRobM

Summary

brain_list MCP tool always fails with a 400 error regardless of whether a category parameter is provided. The server receives category=[object Object] in the query string instead of the correct value (or nothing).

Steps to Reproduce

Call brain_list via MCP:

  • With {category: "architecture", limit: 3} -> error
  • With {limit: 2} (no category at all) -> same error

Actual Result

error: "pi error (400): Failed to deserialize query string: unknown variant `[object Object]`, expected one of `architecture`, `pattern`, `solution`, `convention`, `security`, `performance`, `tooling`, `debug`, `sota`, `discovery`, `hypothesis`, `cross_domain`, `neural_architecture`, `compression`, `self_learning`, `reinforcement_learning`, `graph_intelligence`, `distributed_systems`, `edge_computing`, `hardware_acceleration`, `quantum`, `neuromorphic`, `bio_computing`, `cognitive_science`, `formal_methods`, `geopolitics`, `climate`, `biomedical`, `space`, `finance`, `meta_cognition`, `benchmark`, `consciousness`, `information_decomposition`, `custom`"

Expected Result

List of memories, optionally filtered by category.

Evidence

REST API works fine (bypassing the MCP handler):

GET /v1/memories/list?category=architecture&limit=3

Returns 3 results with total_count: 2129 -- correct.

Related MCP tool works: brain_search with {query: "architecture patterns", category: "architecture"} returns results successfully. Both handlers use the identical pattern for extracting category from args.

Root Cause

The deployed brain_list MCP handler on pi.ruv.io is constructing query params with category=[object Object] regardless of the provided arguments. The error text uses pi error not API error, confirming the deployed binary differs from the current main branch source at crates/mcp-brain-server/src/routes.rs.

The main branch handler (lines 6070-6078) looks correct:

"brain_list" => {
    let mut params = Vec::new();
    if let Some(c) = args.get("category").and_then(|v| v.as_str()) {
        params.push(("category", c.to_string()));
    }
    if let Some(l) = args.get("limit").and_then(|v| v.as_u64()) {
        params.push(("limit", l.to_string()));
    }
    proxy_get(&client, &base, "/v1/memories/list", api_key, &params).await
}

The fix is to rebuild and redeploy the brain server from main.

Workaround

Use the REST API directly:

curl -H "Authorization: Bearer $KEY" "https://pi.ruv.io/v1/memories/list?category=architecture&limit=5"

Or use brain_search which handles the category parameter correctly.


aidevops.sh v3.32.145 plugin for OpenCode v1.18.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions