Skip to main content
Glama

Convex MCP server

Official
by get-convex
usePagination.ts591 B
import { useState } from "react"; export function usePagination<T>({ items, itemsPerPage, }: { items: T[]; itemsPerPage: number; }) { const totalPages = Math.ceil(items.length / itemsPerPage); const [currentPageUnsafe, setCurrentPage] = useState(1); const currentPage = Math.max(1, Math.min(currentPageUnsafe, totalPages)); const startIndex = (currentPage - 1) * itemsPerPage; const endIndex = startIndex + itemsPerPage; const visibleItems = items.slice(startIndex, endIndex); return { visibleItems, totalPages, currentPage, setCurrentPage, }; }

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/get-convex/convex-backend'

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