{"record":{"id":"4189df460b1ce3d3","repo":"xai-org/grok-build","slug":"required-file-path-string","errorCode":null,"errorMessage":"Required: file_path (string).","messagePattern":"Required: file_path \\(string\\)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/codegen/xai-grok-tools/src/implementations/lsp/manager.rs","lineNumber":563,"sourceCode":"                        .await\n                        .map(|l| format_locations_labeled(\"Definition\", &l)),\n                    LspOperation::FindReferences => client\n                        .goto_references(&path, line, col)\n                        .await\n                        .map(|l| format_locations_labeled(\"References\", &l)),\n                    LspOperation::GoToImplementation => client\n                        .goto_implementation(&path, line, col)\n                        .await\n                        .map(|l| format_locations_labeled(\"Implementations\", &l)),\n                    LspOperation::Hover => client.hover(&path, line, col).await.map(|opt| {\n                        opt.unwrap_or_else(|| \"No hover information available.\".to_string())\n                    }),\n                    _ => 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();","sourceCodeStart":545,"sourceCodeEnd":581,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-tools/src/implementations/lsp/manager.rs#L545-L581","documentation":"The LSP tool's document_symbol operation requires a file_path argument, and the manager validates this before dispatching to the LSP client. If input.file_path is None (the argument was omitted, null, or not a string that survived deserialization), the tool short-circuits with this message telling the caller exactly which argument is missing. It is an argument-contract error, not an LSP failure.","triggerScenarios":"Calling the lsp tool with operation \"document_symbol\" but omitting the file_path field, passing file_path: null, or an agent/model hallucinating a tool call that drops the argument.","commonSituations":"LLM agents constructing tool JSON by hand and forgetting required fields; schemas that mark file_path optional; wrappers that strip empty-string/null params before forwarding.","solutions":["Re-issue the tool call including file_path as a non-empty string (e.g. \"src/main.rs\").","Check the tool's input schema and ensure file_path is listed/required for the document_symbol operation.","If you build calls programmatically, validate the argument set before invoking the manager."],"exampleFix":"// before\n{ \"operation\": \"document_symbol\" }\n// after\n{ \"operation\": \"document_symbol\", \"file_path\": \"src/main.rs\" }","handlingStrategy":"validation","validationCode":"function validateDocumentSymbolArgs(input) {\n  if (typeof input.file_path !== 'string' || input.file_path.length === 0) {\n    throw new Error('document_symbol requires a non-empty file_path string');\n  }\n  return true;\n}","typeGuard":"function hasFilePath(input): input is { file_path: string } & typeof input {\n  return typeof (input as any).file_path === 'string' && (input as any).file_path.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Validate required tool arguments before dispatching to the manager.","Keep the tool input schema marking file_path as required for document_symbol.","Log/inspect the exact tool call JSON when agents generate it."],"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"}