-
Notifications
You must be signed in to change notification settings - Fork 501
Closed
Labels
Milestone
Description
Is it possible to check which tools were called, and their inputs/outputs in a guardrail? My use case is as follows:
- The user creates an "agent" entity in our platform, configured to look at
person-1andperson-2 - Our platform runs an
Agentusing this SDK, telling it to use thequeryPersontool through MCP with the IDsperson-1andperson-2 - We receive results for both people
I'd like to ensure that the agent did in fact call the queryPerson tool, with person-1 and person-2 as parameters. This does happen 99% of the time, as we're explicitly telling the LLM to, but there are occasions where it doesn't and it seems like an output guardrail might be the appropriate place to catch this (and e.g. retry the agent, or return an error).
I have stepped through the parameters passed to my OutputGuardrail.execute function, but I can't seem to find any of the tool calls. They do appear in the result from the run function though, but it's too late to be used in a guardrail by then.