{"record":{"id":"69c2292782e458f9","repo":"tinyhumansai/openhuman","slug":"tool-invalid-arguments-e","errorCode":null,"errorMessage":"{tool}: invalid arguments: {e}","messagePattern":"(.+?): invalid arguments: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/threads/tools.rs","lineNumber":48,"sourceCode":"use crate::openhuman::threads::ops;\nuse crate::openhuman::threads::turn_state::{ClearTurnStateRequest, GetTurnStateRequest};\nuse crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolResult};\n\nfn read_required_str(args: &serde_json::Value, key: &str) -> anyhow::Result<String> {\n    args.get(key)\n        .and_then(serde_json::Value::as_str)\n        .map(str::trim)\n        .filter(|s| !s.is_empty())\n        .map(str::to_string)\n        .ok_or_else(|| anyhow::anyhow!(\"missing required string argument `{key}`\"))\n}\n\n/// Deserialize tool args into a request struct with a uniform error.\nfn parse_req<T: serde::de::DeserializeOwned>(\n    args: serde_json::Value,\n    tool: &str,\n) -> anyhow::Result<T> {\n    serde_json::from_value(args).map_err(|e| anyhow::anyhow!(\"{tool}: invalid arguments: {e}\"))\n}\n\n/// Emit a thread ops `RpcOutcome` envelope as a JSON tool result.\nmacro_rules! emit {\n    ($outcome:expr, $name:literal) => {{\n        let outcome = $outcome.map_err(|e| anyhow::anyhow!(concat!($name, \": {}\"), e))?;\n        Ok(ToolResult::success(serde_json::to_string(&outcome.value)?))\n    }};\n}\n\n/// List conversation threads.\npub struct ThreadListTool;\n\n#[async_trait]\nimpl Tool for ThreadListTool {\n    fn name(&self) -> &str {\n        \"thread_list\"\n    }","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/threads/tools.rs#L30-L66","documentation":"Shared helper parse_req: serde_json failed to deserialize tool arguments into the typed request struct. The {tool} prefix names which thread tool called it; {e} names the offending field. Fires before any thread operation runs.","triggerScenarios":"Thrown at src/openhuman/threads/tools.rs:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read {e} for the field name and expected type","Match the tool's parameters_schema exactly (types and required fields)","Send message records as objects, not strings"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}