# fix\(server\): agents only see preview and device tools when their access is on · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/a6c3bc1c8a11a4bdc2a73ccb60b07fc621f070bd)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: a6c3bc1c8a11a4bdc2a73ccb60b07fc621f070bd

Requested commit: a6c3bc1c8a11a4bdc2a73ccb60b07fc621f070bd

Commit: a6c3bc1c8a11a4bdc2a73ccb60b07fc621f070bd

Tree: 7d02f7a1cd301d2835d35d4284caf0d0aca0f0d9

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(server): agents only see preview and device tools when their access is on

Fresh provider sessions with browser or device access disabled were offered
preview_* and device_* tools that then failed on every call. Those
registrations now carry McpSchema.EnabledWhen, which reads the request's
McpInvocationContext, so tools/list and tools/call skip a capability the
credential does not grant. Handler checks stay in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

```

## Parents

- [f8cdae190c3806ab0227ba7c9a5edfc6a09916fb](https://git.cafe/pingdotgg/t3code/commit/f8cdae190c3806ab0227ba7c9a5edfc6a09916fb?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/a6c3bc1c8a11a4bdc2a73ccb60b07fc621f070bd?format=markdown)
