Skip to content

Commit 550a284

Browse files
committed
chore: it seems that resourceListChanged is mandatory
it seems that some agents won't detect changes in the resources until we tell them that the list also changed
1 parent 7dc6746 commit 550a284

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/resources/resource.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function ReactiveResource<Value, RelevantEvents extends readonly (keyof S
3838
for (const event of events) {
3939
this.session.on(event, (...args: SessionEvents[typeof event]) => {
4040
this.reduceApply(event, (args as unknown[])[0] as PayloadOf<typeof event>);
41-
this.triggerUpdate();
41+
void this.triggerUpdate();
4242
});
4343
}
4444
}
@@ -57,8 +57,9 @@ export function ReactiveResource<Value, RelevantEvents extends readonly (keyof S
5757
],
5858
});
5959

60-
private triggerUpdate() {
61-
void this.server.mcpServer.server.sendResourceUpdated({ uri });
60+
private async triggerUpdate() {
61+
await this.server.mcpServer.server.sendResourceUpdated({ uri });
62+
this.server.mcpServer.sendResourceListChanged();
6263
}
6364

6465
reduceApply(eventName: SomeEvent, ...event: PayloadOf<SomeEvent>[]): void {

0 commit comments

Comments
 (0)