Skip to content

Commit bf45aa5

Browse files
Improve generic 'Method not found' message for better debuggability
Co-Authored-By: Claude <[email protected]>
1 parent 2bb7f47 commit bf45aa5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/core/src/shared/protocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ export abstract class Protocol<SendRequestT extends Request, SendNotificationT e
689689
id: request.id,
690690
error: {
691691
code: ErrorCode.MethodNotFound,
692-
message: 'Method not found'
692+
message: `Method '${request.method}' not found`
693693
}
694694
};
695695

test/integration/test/server.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2394,7 +2394,7 @@ describe('Task-based execution', () => {
23942394

23952395
// Try to get a task when server doesn't have TaskStore
23962396
// The server will return a "Method not found" error
2397-
await expect(client.experimental.tasks.getTask('non-existent')).rejects.toThrow('Method not found');
2397+
await expect(client.experimental.tasks.getTask('non-existent')).rejects.toThrow("Method 'tasks/get' not found");
23982398
});
23992399

24002400
test('should automatically attach related-task metadata to nested requests during tool execution', async () => {

0 commit comments

Comments
 (0)