# agent: Return an error to the model when trying to use a tool that is disabled \(\#27928\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/961bfadad9d5492b233f924b3b30b22e73b283a8)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 961bfadad9d5492b233f924b3b30b22e73b283a8

Requested commit: 961bfadad9d5492b233f924b3b30b22e73b283a8

Commit: 961bfadad9d5492b233f924b3b30b22e73b283a8

Tree: 07be4660fc75bafc8c4bb8ad7fe7619346140036

Author: Marshall Bowers

Committer: GitHub

## Message

```
agent: Return an error to the model when trying to use a tool that is disabled (#27928)

This PR makes it so we return an error to the model if it tries to use a
tool that is not currently enabled:

<img width="628" alt="Screenshot 2025-04-02 at 11 10 55 AM"
src="https://github.com/user-attachments/assets/e4bdf01c-f0ea-4c9c-805a-11868bd9c771"
/>

This allows the model to adapt based on that:

<img width="637" alt="Screenshot 2025-04-02 at 11 08 38 AM"
src="https://github.com/user-attachments/assets/41016b47-933c-4dcb-b791-847be0548c8a"
/>

Release Notes:

- N/A
```

## Parents

- [2eed94ff23febdedf7fd359bf59a914b4b37b717](https://git.cafe/gitcafe/zed/commit/2eed94ff23febdedf7fd359bf59a914b4b37b717?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/961bfadad9d5492b233f924b3b30b22e73b283a8?format=markdown)
