Skip to main content
Glama

mcp-google-sheets

analytics-hooks.ts980 B
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { useContext } from 'react'; import { analyticsApi } from '@/features/platform-admin/lib/analytics-api'; import { RefreshAnalyticsContext } from '../components/refresh-analytics-provider'; const queryKey = ['analytics']; export const platformAnalyticsHooks = { useAnalytics: () => { const { data, isLoading } = useQuery({ queryKey, queryFn: () => analyticsApi.get(), }); return { data, isLoading }; }, useRefreshAnalytics: () => { const queryClient = useQueryClient(); const { setIsRefreshing } = useContext(RefreshAnalyticsContext); return useMutation({ mutationFn: async () => { setIsRefreshing(true); return analyticsApi.refresh(); }, onSuccess: (result) => { setIsRefreshing(false); queryClient.setQueryData(queryKey, result); }, retry: true, retryDelay: 1000, }); }, };

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/activepieces/activepieces'

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