brain_list MCP tool always returns 400: category=[object Object]
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.5k
- Forks
- 603
- Avg merge
- 23h 32m
- Merged PRs (30d)
- 59
Description
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, ¶ms).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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in crates/mcp-brain-server/src/routes.rs around lines 6070-6078 and compare the deployed brain_list handler with the main branch implementation. Rebuild and redeploy the brain server, then verify brain_list with and without category and confirm that category=architecture&limit=3 succeeds like the REST API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100