Skip to main content
AI-агентыИнтеграция APIАвтоматизация

Programmatic Tool Calling by Anthropic: Cheaper Agents, Fewer Failures

Anthropic has launched Programmatic Tool Calling in public beta for Claude Sonnet 4.6 and Opus 4.6. Tools are now invoked via executable Python code rather than JSON chains. For business, this means cheaper, more reliable agents with fewer tokens and delays, simplifying Claude's integration with external APIs.

Technical Context: What Anthropic Actually Pushed to Prod

I took a close look at Programmatic Tool Calling (PTC) in the Anthropic documentation, and I liked the main thing: they stopped forcing the model to play “ping-pong” outputting JSON for every tool call. Now Claude can write and execute Python code, which already contains loops, conditions, data transformations, and error handling.

PTC is available in public beta along with Claude Sonnet 4.6 and Opus 4.6 on the Claude Developer Platform and via API. Based on the pricing I see in the release: Sonnet 4.6 is $3/$15 per million tokens (input/output), and Opus 4.6 is $5/$25.

The technical mechanism is enabled at the tool level: you tag a tool as suitable for code_execution and define who can call it (e.g., allowed_callers). As a result, Claude imports and invokes your tools directly from Python, returning the final result to the model rather than a raw 50KB table.

Anthropic claims savings of up to 98% on tokens for multi-step scenarios. I believe the magnitude of these figures: when you stop dragging tool JSON responses back and forth into the context, cost and latency drop dramatically.

Impact on Business and Automation: What Changes in Architecture

With PTC, my standard AI architecture for agentic solutions changes. Previously in production, I almost always built an orchestration layer (in a service or workflow engine) because “model + JSON tool calls” handles long chains poorly: context swells, retries break logic, and costs become unpredictable.

Now, part of the orchestration can be legally and controllably moved into executable code generated by Claude. For AI automation, this means more stable scenarios like: “export data → clean → aggregate → check conditions → write to ERP/CRM → generate report” without dozens of communication rounds between the model and tools.

Teams that build agents around data—finance, logistics, procurement, plan-fact analysis, support with deep integrations—will win. Those who tried to “save” on engineering and relied on prompt magic will lose: PTC makes the system more powerful but requires discipline in tools, access schemes, and observability.

From our experience at Nahornyi AI Lab, the critical moment is not the tool call itself, but the data contract and error management. PTC finally allows us to describe retries, deduplication, limits, backoff, and validation not in the “model's reasoning,” but in explicit code that is easier to test and version.

Strategic Analysis: Why This Pulls the Market Toward “Code-First” Agents

I see PTC not just as a new Claude feature, but as a paradigm shift: the agent becomes less of a chatbot that occasionally calls functions, and more of a generator of executable “micro-pipelines.” This is closer to how business actually works: lots of conditions, exceptions, formats, and messy data.

In AI implementation projects, we usually hit two bottlenecks: token costs and unpredictability with edge cases. PTC hits both. Raw data stays out of context, and the model returns a compact result; meanwhile, branching and loops happen in code, not through multiple JSON exchanges.

My non-obvious forecast: in 6–12 months, a “proper” prod-agent will be evaluated not by its prompt, but by the quality of its tool library, code execution policies, and observability. That is, the competitive advantage will be the AI solution architecture: execution sandbox, leak control, call tracing, and strict input/output contracts.

I also wouldn't try to enable PTC “everywhere.” For simple single-call tasks, the old tool use might be faster to implement. But as soon as a table with thousands of rows, multiple APIs, and conditional logic appears, I will plan PTC as the baseline orchestration mechanism in my solutions.

This analysis was prepared by Vadim Nahornyi—Lead Practitioner at Nahornyi AI Lab specializing in AI architecture, agents, and AI automation in the real sector. If you want to build AI automation with Claude in production (ERP/CRM integrations, document flow, financial control, analytics), I invite you to discuss the task: I will assemble the target architecture, assess code execution risks, and propose an implementation plan tailored to your KPIs.

Share this article