Enable javascript in your browser for better experience. Need to know to enable it? Go here.

Programmatic tool calling

Published : Nov 04, 2026
Nov 2026
Assess ?

Programmatic tool calling is a tool-use pattern where the model writes code instead of issuing one tool call at a time. Rather than making a round-trip through the model for each operation, it combines tool calls into a program that runs in an execution environment, looping, filtering and shaping results. Only the selected results or the final output are returned to the model’s context.

The concept appears in several implementations, although the naming is still unsettled. Cloudflare and Pi call it Code Mode; Anthropic calls it programmatic tool calling; and an earlier Anthropic engineering article describes code execution with MCP. DeepSeek Harness (DSH) also provides a closely related PTC Mode.

Implementations differ mainly in where the execution environment runs: in a model provider’s container, the agent harness or, more recently, through a Code Mode MCP server. The latter allows MCP clients to use programmatic tool calling without implementing their own execution runtime. However, it can reduce the granularity of client-side approvals, so authorization and approval for individual operations must still be enforced by the server and its tool handlers.

Download the PDF

 

 

 

English | Português

Sign up for the Technology Radar newsletter

 

 

Subscribe now

Visit our archive to read the previous volumes