Skip to main content
Glama

Sentry MCP

Official
by getsentry
whoami.test.ts1.26 kB
import { describe, it, expect, vi, beforeEach } from "vitest"; import { getCurrentUser } from "./whoami"; import type { SentryApiService } from "../../../api-client"; describe("whoami agent tool", () => { let mockApiService: SentryApiService; beforeEach(() => { vi.clearAllMocks(); mockApiService = { getAuthenticatedUser: vi.fn(), } as unknown as SentryApiService; }); describe("getCurrentUser", () => { it("should return current user information", async () => { const mockUser = { id: "123", name: "John Doe", email: "john.doe@example.com", }; (mockApiService.getAuthenticatedUser as any).mockResolvedValue(mockUser); const result = await getCurrentUser(mockApiService); expect(result).toEqual({ id: "123", name: "John Doe", email: "john.doe@example.com", }); expect(mockApiService.getAuthenticatedUser).toHaveBeenCalledOnce(); }); it("should handle API errors gracefully", async () => { (mockApiService.getAuthenticatedUser as any).mockRejectedValue( new Error("Unauthorized"), ); await expect(getCurrentUser(mockApiService)).rejects.toThrow( "Unauthorized", ); }); }); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/getsentry/sentry-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server