Skip to content
1 min read · 105 words

Variable: pythonicToolCallParser

ts
const pythonicToolCallParser: ToolCallParserFn;

Defined in: src/batteries/llm/chat_common/tool_parsers.ts:716

Parse pythonic tool calls — [get_weather(city='SF'), get_time()]. Requires the whole trimmed output to be the bracketed call list, so it cannot false-positive on incidental prose. Parallel calls are inherent to the format.

Disambiguation, NOT authorization. The [fn(args), …] shape (whole-output) is the structural signal that this is a call list. It deliberately does NOT check callees against ctx.toolNames — whether a tool is allowed is the consumer's call, and the dispatch layer already replies "Tool not found: … Available tools: …" so the model can self-correct. Dropping an unknown-tool call here would hide the request and that feedback loop.