to2d

A space for ideas, notes, and ongoing work.

Tool Execution Context

Nov 2025

BrowserAgent Update

Most agent architectures treat tools as pure functions, but real automations need runtime context:

  • organization ID
  • feature flags
  • execution metadata
  • session state
  • environment info
  • prior tool outputs
  • domain-specific data

I added a lightweight toolExecutionContext layer to the ComputerUseAgent:

  • agent.execute() accepts toolExecutionContext
  • custom tools receive context as a second parameter in call()
  • built-in tools ignore it
  • ToolCollection propagates the context automatically

This enables context-aware tools without polluting prompts or creating hidden inputs.

Example:

await agent.execute("task", undefined, {
  toolExecutionContext: { orgId: "acme-001", env: "production" }
});
← Back to Open Source