Skip to content

Make externalToolDefinitions and externalToolDispatcher available on SessionConfig #411

@theblixguy

Description

@theblixguy

I'm working on a feature using the SDK where I would like to register my own tools and handle their execution externally (e.g. forwarding tool calls to another piece of software and returning the results back).

While digging into the SDK, I noticed that the SessionOptions in the SDK already has externalToolDefinitions and externalToolDispatcher fields that seem to do exactly this, where they get merged into the tools array alongside the built-in CLI and MCP tools and the dispatcher callback is called when the model invokes them.

Would it be possible to surface these two fields on the public SessionConfig? It would just be passing them through to the internal session, so no new logic is required since the all the plumbing is already there.

interface SessionConfig {
  // ... existing fields ...
  externalToolDefinitions?: ExternalToolDefinition[];
  externalToolDispatcher?: ExternalToolDispatcher;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions