{"record":{"id":"b6c14defcbc13e03","repo":"xai-org/grok-build","slug":"required-query-string","errorCode":null,"errorMessage":"Required: query (string).","messagePattern":"Required: query \\(string\\)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/codegen/xai-grok-tools/src/implementations/lsp/manager.rs","lineNumber":576,"sourceCode":"                    _ => unreachable!(),\n                }\n            }\n            LspOperation::DocumentSymbol => {\n                let Some(ref file_path) = input.file_path else {\n                    return err(\"Required: file_path (string).\".into());\n                };\n                let path = PathBuf::from(file_path);\n                let Some(client) = self.client_for_file_mut(&path) else {\n                    return err(format!(\"No LSP server configured for {}\", path.display()));\n                };\n                client\n                    .document_symbols(&path)\n                    .await\n                    .map(|s| format_symbols(&s))\n            }\n            LspOperation::WorkspaceSymbol => {\n                let Some(ref query) = input.query else {\n                    return err(\"Required: query (string).\".into());\n                };\n                if self.clients.is_empty() {\n                    return err(\"No LSP servers are running.\".into());\n                }\n                let mut all_symbols = Vec::new();\n                let mut last_err = None;\n                for client in self.clients.values_mut() {\n                    match client.workspace_symbols(query).await {\n                        Ok(symbols) => all_symbols.extend(symbols),\n                        Err(e) => {\n                            last_err = Some(e);\n                        }\n                    }\n                }\n                if all_symbols.is_empty() {\n                    match last_err {\n                        Some(e) => Err(e),\n                        None => Ok(format_symbols(&[])),","sourceCodeStart":558,"sourceCodeEnd":594,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-tools/src/implementations/lsp/manager.rs#L558-L594","documentation":"The workspace_symbol operation requires a query string to search workspace-wide symbols. The manager validates input.query before fanning the request out to all running LSP clients, returning this message when the argument is missing. Like error 760 it is an argument-contract check, not a search failure.","triggerScenarios":"Calling the lsp tool with operation \"workspace_symbol\" but omitting query, passing query: null, or an agent emitting a call without the search text.","commonSituations":"Agents constructing tool calls that leave optional-looking fields unset; UI layers that allow submitting the search with an empty/absent query box; schema drift making query optional in the caller's client.","solutions":["Re-issue the call with query as a non-empty string (e.g. \"Manager\" or \"parse_\").","Ensure the caller's schema requires query for workspace_symbol.","If the search text is user-supplied, validate it is present and non-empty before dispatching."],"exampleFix":"// before\n{ \"operation\": \"workspace_symbol\" }\n// after\n{ \"operation\": \"workspace_symbol\", \"query\": \"dispatch_tool\" }","handlingStrategy":"validation","validationCode":"function validateWorkspaceSymbolArgs(input) {\n  if (typeof input.query !== 'string' || input.query.trim().length === 0) {\n    throw new Error('workspace_symbol requires a non-empty query string');\n  }\n  return true;\n}","typeGuard":"function hasQuery(input): input is { query: string } & typeof input {\n  return typeof (input as any).query === 'string' && (input as any).query.trim().length > 0;\n}","tryCatchPattern":null,"preventionTips":["Require query in the workspace_symbol input schema.","Trim and check user-supplied search text before dispatching.","Add a unit test asserting the tool call payload always includes query."],"tags":["lsp","input-validation","missing-argument"],"backgroundTag":"missing-required-parameter","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}