Skip to content

Commit fccf8a4

Browse files
Improve generic 'Method not found' message for better debuggability
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 00249ce commit fccf8a4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

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
@@ -2392,7 +2392,7 @@ describe('Task-based execution', () => {
23922392

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

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

0 commit comments

Comments
 (0)