Skip to content

Expose tool_use_id in can_use_tool callback #376

@nishikantparmariam1

Description

@nishikantparmariam1

In my case, I’ve implemented the can_use_tool callback. When it is invoked multiple times in parallel such as when two sub-agents request permission at the same time - both calls may reference the same tool name. In that situation, there’s no way to identify which sub‑agent triggered a given can_use_tool call. If I could access the tool_use_id for each call, I could read the corresponding ToolUse message and determine its parent_tool_use_id, which would let me map each request back to its originating sub‑agent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions