Skip to main content
Glama

MCP Server RubyGems

by 6
utils.ts979 B
import { type McpToolResponse } from './types.js'; /** * Extracts a readable error message from any error object * * @param error - The error object * @returns A string representation of the error */ function getErrorMessage(error: unknown): string { return error instanceof Error ? error.message : String(error); } /** * Creates a standardized error response * * @param error - The error object * @param prefix - Optional prefix for the error message * @returns An MCP tool response with error information */ export function createErrorResponse( error: unknown, prefix: string = '' ): McpToolResponse { const errorMessage = getErrorMessage(error); const fullMessage = prefix ? `${prefix}: ${errorMessage}` : errorMessage; return { content: [ { type: 'text', text: JSON.stringify( { error: true, message: fullMessage, }, null, 2 ), }, ], }; }

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/6/mcp-server-rubygems'

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