Skip to content

feat: plugin: add plugin tool execution for PTC#8020

Closed
yuguorui wants to merge 1 commit into
anomalyco:devfrom
yuguorui:feat/programmatic-tool-calling
Closed

feat: plugin: add plugin tool execution for PTC#8020
yuguorui wants to merge 1 commit into
anomalyco:devfrom
yuguorui:feat/programmatic-tool-calling

Conversation

@yuguorui

Copy link
Copy Markdown
Contributor

What does this PR do?

Programmatic Tool Calling (PTC)[1] lets code invoke tools directly in the execution environment, cutting model round-trips, latency, and tokens. Without an execution API, models could not programmatically invoke tools and had to fall back to provider-native tool calling, which blocks PTC on other models.

Introduce a tool execution API to run a tool by id with session/message context, provider/agent filtering, and permission gating, returning title/output/metadata.

Regenerate the JS SDK (v1/v2) to expose the new execute API and types so plugins can implement PTC regardless of the underlying model provider.

[1] https://platform.claude.com/cookbook/tool-use-programmatic-tool-calling-ptc

How did you verify your code works?

I've writing a POC plugin to wrap the tools into async javascript functions, and the model is able to create 10k TODOs with the new interface.

Because it currently depends on a local SDK version, it has not been released yet. I will complete it as soon as possible and open-source it under the MIT license.

image

Programmatic Tool Calling (PTC)[1] lets code invoke tools directly in the
execution environment, cutting model round-trips, latency, and tokens. Without
an execution API, models could not programmatically invoke tools and had to
fall back to provider-native tool calling, which blocks PTC on other models.

Introduce a tool execution API to run a tool by id with session/message
context, provider/agent filtering, and permission gating, returning
title/output/metadata.

Regenerate the JS SDK (v1/v2) to expose the new execute API and types so
plugins can implement PTC regardless of the underlying model provider.

Signed-off-by: yuguorui <yuguorui@pku.edu.cn>
[1] https://platform.claude.com/cookbook/tool-use-programmatic-tool-calling-ptc
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@yuguorui yuguorui closed this Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant