What happened?
When querying traces using the AI Assistant's search_traces
MCP tool, providing an explicit attributes filter for error
(e.g., "error": "false") alongside with_errors: true results
in the user's manual filter being silently clobbered.
The buildQueryParams function unconditionally sets
attributes["error"] = "true" if WithErrors is enabled,
regardless of whether the user explicitly requested a
conflicting attribute value in the same query. This results
in the backend querying for traces with error=true without
warning the user that their error=false filter was ignored.
Steps to reproduce
-
Invoke the AI Assistant's search_traces tool.
-
Provide a query input that explicitly sets the error
attribute to "false" while simultaneously setting
with_errors to true:
{
"service_name": "my-service",
"attributes": {
"error": "false"
},
"with_errors": true
}
-
Observe that the search executes for traces containing
errors, completely ignoring the manual error=false filter.
Expected behavior
The system should surface the conflict to the caller rather
than silently choosing a behavior. If with_errors: true is
set, and attributes["error"] is explicitly set to anything
other than "true", the handler should fail fast and return
a clear validation error.
Relevant log output
N/A
What happened?
When querying traces using the AI Assistant's search_traces
MCP tool, providing an explicit attributes filter for error
(e.g., "error": "false") alongside with_errors: true results
in the user's manual filter being silently clobbered.
The buildQueryParams function unconditionally sets
attributes["error"] = "true" if WithErrors is enabled,
regardless of whether the user explicitly requested a
conflicting attribute value in the same query. This results
in the backend querying for traces with error=true without
warning the user that their error=false filter was ignored.
Steps to reproduce
Invoke the AI Assistant's search_traces tool.
Provide a query input that explicitly sets the error
attribute to "false" while simultaneously setting
with_errors to true:
{
"service_name": "my-service",
"attributes": {
"error": "false"
},
"with_errors": true
}
Observe that the search executes for traces containing
errors, completely ignoring the manual error=false filter.
Expected behavior
The system should surface the conflict to the caller rather
than silently choosing a behavior. If with_errors: true is
set, and attributes["error"] is explicitly set to anything
other than "true", the handler should fail fast and return
a clear validation error.
Relevant log output
N/A