Concepts/Definition
ADPS Agent Systems · Engineering Concept
Programmatic Tool Calling
Let the model write a bounded program that calls registered tools and reduces intermediate results before they enter context.
Application context
A finance agent must identify people in one department whose travel spend exceeded policy. Conventional tool calling retrieves the staff list and then returns every expense and limit result to the model. Calls and context grow with headcount. The work itself is a loop, several parallel reads, and a deterministic aggregation.
Definition
Programmatic Tool Calling lets the model write a short program that calls registered, explicitly eligible tools inside a bounded execution environment. The program handles loops, conditions, parallelism, aggregation, and error branches. Intermediate data can remain in the runtime while only the necessary result enters model context.
members = await get_members("engineering")
expenses = await gather(get_expenses(m.id) for m in members)
limits = await get_limits(unique(m.level for m in members))
print(find_exceeded(members, expenses, limits))
The program does not invent get_expenses. That tool is already registered. The generated code temporarily composes and processes its calls.
Engineering use
Only tools explicitly permitted for programmatic callers enter the runtime. The sandbox limits CPU, memory, duration, loops, file access, and network egress. Tool admission still checks the current principal, resource, and Intent. The trace records the generated-code version, every actual tool call, intermediate errors, stdout, and the final result.
Compared with ReAct and CodeAct
ReAct asks the model to choose again after each observation. Programmatic Tool Calling hands a local control flow to code, reducing model round trips and large intermediate results. CodeAct supplies a broader executable-code action space that can use libraries, computations, and generated helper functions, not only registered tools.
Position in ADPS
It joins A1 Tool Dispatch and A2 Plan and Execute. A2 chooses the current step. PTC composes several calls inside that step. A1 still governs registration, candidate scope, and per-call admission. A one-run program remains a runtime mechanism. After testing, naming, versioning, and approval for cross-task reuse, it becomes M5 Procedural Memory.
Proposal and provenance
- Concept group
- Reasoning and action mechanisms
- Term origin
- External engineering term: Anthropic
- Published source
- Anthropic Programmatic Tool Calling documentation
- ADPS editorial work
- ADPS places it between A1 Tool Dispatch and A2 Plan and Execute and distinguishes it from ReAct, CodeAct, and M5.
- Current standing
- Runtime-mechanism concept
Chronicle
- Recorded source
- Anthropic Programmatic Tool Calling documentation
- First published on ADPS