Skip to content

Conditionally enable tools based on tool call history #1877

@dannyhorcajo

Description

@dannyhorcajo

Please read this first

  • Have you read the docs? Agents SDK docs
  • Have you searched for related issues? Others may have had similar requests

Question

I would like to dynamically enable certain tools / MCP server tools depending on whether other tools have been previously invoked. For example, query_db() should only be enabled if the agent has invoked the get_db_schema() tool previously during the conversation.

Is such behavior possible with this SDK? I have been thinking of using the run context for this, but it would get reset at each turn. I have been reading the documentation from A to Z, but I couldn't find anything of the kind.

Thank in advance!

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