{"record":{"id":"e954b609d61a85f4","repo":"vllm-project/vllm","slug":"tool-parser-parsing-failed-message","errorCode":null,"errorMessage":"tool parser parsing failed: {message}","messagePattern":"tool parser parsing failed: (.+?)","errorType":"exception","errorClass":"ToolParserError","httpStatus":null,"severity":"warning","filePath":"rust/src/parser/src/tool/error.rs","lineNumber":14,"sourceCode":"// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: Copyright contributors to the vLLM project\n\nuse thiserror::Error;\nuse thiserror_ext::Macro;\n\n/// Result alias for tool parser operations.\npub type Result<T> = std::result::Result<T, ToolParserError>;\n\n/// Errors produced while creating or running tool parsers.\n#[derive(Debug, Error, Macro)]\n#[thiserror_ext(macro(path = \"crate::tool::error\"))]\npub enum ToolParserError {\n    #[error(\"tool parser parsing failed: {message}\")]\n    ParsingFailed { message: String },\n    #[error(\n        \"`{name}` only provides a unified parser; the same reasoning parser and tool parser should be specified together\"\n    )]\n    DummyUnifiedParser { name: String },\n}\n","sourceCodeStart":1,"sourceCodeEnd":21,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/rust/src/parser/src/tool/error.rs#L1-L21","documentation":"ToolParserError::ParsingFailed is the generic failure a tool parser raises when it cannot make progress on the streamed tool-call syntax — malformed JSON arguments, unbalanced function-call delimiters, or state-machine violations while consuming deltas. The `message` string carries the parser-specific detail.","triggerScenarios":"Model output that drifts from the tool-call grammar the parser expects (broken JSON in arguments, missing closing tags like </tool_call>, interleaved reasoning text inside tool call blocks); streaming deltas arriving out of the assumed order.","commonSituations":"Small or lightly fine-tuned models emitting malformed tool calls; prompt templates that corrupt the tool-call format; aggressive sampling parameters (high temperature) producing invalid syntax; switching tool parser without switching chat template.","solutions":["Inspect `message` for the exact parse failure position/cause","Lower temperature / tighten sampling so the model emits well-formed tool calls","Ensure the tool parser matches the model's tool-call format (e.g. hermes parser with hermes-style templates)","Handle the error per-request and surface it to the client rather than aborting the whole stream"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn is_tool_parse_failed(e: &ToolParserError) -> bool {\n    matches!(e, ToolParserError::ParsingFailed { .. })\n}","tryCatchPattern":"match tool_parser.push(delta) {\n    Err(ToolParserError::ParsingFailed { message }) => {\n        tracing::warn!(\"tool call malformed: {message}\");\n        stream.emit_tool_error(request_id, message); // degrade this call, keep stream alive\n    }\n    r => r?,\n}","preventionTips":["Surface tool-parse failures per-request instead of aborting the connection","Keep sampling temperature low for tool-calling workloads","Match the tool parser to the model's tool-call template exactly"],"tags":["tool-parser","streaming","model-output","rust"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}