Tools should return only the minimum amount of data required to complete a task. The response should contain only information that the user is allowed to see or is already aware of.
LLMs should not be trusted to safely ignore sensitive fields in an API response. Any data returned by a tool could potentially be exposed in the model’s output, so responses must be carefully restricted.
Responses should be structured in a way that is simple and easy for the model to interpret. If structured data must be returned, ensure the prompt clearly instructs the model how to interpret it.
Where possible, provide clear, human-readable responses rather than raw structured data.
For example, instead of returning:
{
"status":"paid",
"paid":"£0.00"
}
return something clearer such as:
{
"status":"There was no balance to pay for this item"
}
This reduces ambiguity and helps the model produce more accurate responses.
LLMs have limited context windows, meaning they can only retain a certain amount of the conversation at any given time.
Tool responses are added to this context. Returning large amounts of unnecessary data will: