Deploying Programmatic Tool Calling for Large-Scale Agentic Systems

Nhan Nguyen, Hadi Habibzadeh, Ahmad Magdy Eid


Abstract
Production tool calling for agentic systems must satisfy four operational requirements: bounded per-invocation cost, predictable latency, adaptability to evolving tool catalogs, and the ability to catch errors before execution. The ReAct paradigm keeps the large language model (LLM) in the loop, but at production scale, re-processing intermediate results inflates cost and latency and degrades answer quality. Programmatic tool calling (PTC) offers an alternative; the LLM generates a single script that resolves dependencies and extracts relevant fields in one inference pass. PTC is a harder generation task, however, because the LLM must produce code that handles complex, variable responses without observing intermediate results, and existing remedies each fail at least one of the four requirements. We describe a production deployment of PTC serving 26,528 invocations, paired with a three-layer abstract syntax tree (AST)-based validator that rejects invalid scripts before execution and requires no training data, preserving adaptability to evolving tool catalogs. This reduced average input tokens by 77%, latency by 21%, and increased the answered-query rate by 5.6 percentage points across 19 production agents.
Anthology ID:
2026.emnlp-industry.78
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing: Industry Track
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Pepa Atanasova, Gholamreza Haffari, Minghan Wang
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
1315–1322
Language:
URL:
https://aclanthology.org/2026.emnlp-industry.78/
DOI:
Bibkey:
Cite (ACL):
Nhan Nguyen, Hadi Habibzadeh, and Ahmad Magdy Eid. 2026. Deploying Programmatic Tool Calling for Large-Scale Agentic Systems. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing: Industry Track, pages 1315–1322, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
Deploying Programmatic Tool Calling for Large-Scale Agentic Systems (Nguyen et al., EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-industry.78.pdf