Skip to main content
Glama

Meilisearch MCP Server

by devlimelabs
error-handler.ts1.07 kB
/** * Error handling utilities for Meilisearch API responses */ /** * Formats Meilisearch API errors for consistent error messaging * * @param error - The error from the API request * @returns A formatted error message */ export const handleApiError = (error: any): string => { // If it's an Axios error with a response if (error.isAxiosError && error.response) { const { status, data } = error.response; // Return formatted error with status code and response data return `Meilisearch API error (${status}): ${JSON.stringify(data)}`; } // If it's a network error or other error return `Error connecting to Meilisearch: ${error.message}`; }; /** * Creates a standardized error response object for MCP tools * * @param error - The error from the API request * @returns An MCP tool response object with error flag */ export const createErrorResponse = (error: any) => { return { isError: true, content: [{ type: "text", text: handleApiError(error) }], }; }; export default { handleApiError, createErrorResponse, };

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/devlimelabs/meilisearch-ts-mcp'

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