A tool call from a language model rarely arrives cleanly. Arguments can be truncated, markers split across chunks, or model-specific markup can bleed into the output. NVIDIA's Dynamo stack faces these issues head-on with frontend-crates, a set of Rust components designed to parse these fragmented, sometimes malformed, tool calls into structured events that your application can actually use.
If you ask for the weather in Paris, the model might reply with reasoning, then a get_weather call, but the output could be broken up in unexpected ways. One chunk might end halfway through the city name, or the model might invent a tool that isn't even available. The parser's job is to turn this stream—token IDs or decoded text—into ordered reasoning, visible text, and tool calls, even when the input is incomplete or inconsistent.
How Dynamo's Parsers Recover from Broken Output
Two failure cases show what these parsers are up against:
- Syntax error (truncated argument):
</think><tool_call>
<function=get_weather><parameter=city>Par
The argument and tool-call frame never close, so the parser can't emit a complete call.
- Semantic error (unknown tool):
</think><tool_call>
<function=unknown_tool><parameter=city>Paris</parameter></function>
</tool_call>
Here, the frame is valid, but the model called a tool not present in the request. The parser reports what it received; downstream layers check if the tool is allowed and valid.
The tricky part is deciding when to emit, buffer, or drop data. Emit too early and you leak syntax into the answer; wait too long and you delay real output. The parser follows recovery rules: it never guesses at model intent, never invents calls, and always tries to preserve valid data without leaking model-specific markers.




