Skip to content

[Feature Request]: Native support for Programmatic Tool Calling #12477

@yingfeng

Description

@yingfeng

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (Language Policy).
  • Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

Is your feature request related to a problem?

Currently, the outputs of Tools will be loaded into context directly, it will lead to several problems:
- Context pollution
- Latency
- Cost

Describe the feature you'd like

Key capabilities needed:

  • The Agent generates a script that orchestrates multiple tool calls in one run.
  • The script runs in a sandbox
  • Intermediate results stay in the sandbox and are not automatically ingested into the LLM context
sequenceDiagram
    participant Agent as LLM Context
    participant Sandbox as Code Runtime
    participant Tools as MCP Tools

    rect rgb(140, 140, 140)
    Note over Agent, Tools: Standard Approach (Current)
    Agent->>Tools: Call Tool A
    Tools-->>Agent: Return HUGE Payload (Tokens $$)
    Agent->>Tools: Call Tool B (using data from A)
    Tools-->>Agent: Return Result
    end

    rect rgb(120, 155, 120)
    Note over Agent, Tools: Proposed Code Execution Approach
    Agent->>Sandbox: Send Script (Call A, filter data, Call B)
    activate Sandbox
    Sandbox->>Tools: Execute A
    Sandbox->>Sandbox: Filter/Process Data (in memory)
    Sandbox->>Tools: Execute B
    deactivate Sandbox
    Sandbox-->>Agent: Return Final Answer OR Result Reference (Low Tokens)
    end
Loading

Metadata

Metadata

Assignees

Labels

💞 featureFeature request, pull request that fullfill a new feature.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions