Skip to main content
Glama
error-logging.interceptor.ts763 B
import { Injectable, NestInterceptor, ExecutionContext, CallHandler, Logger, } from '@nestjs/common'; import { Observable, throwError } from 'rxjs'; import { catchError } from 'rxjs/operators'; @Injectable() export class ErrorLoggingInterceptor implements NestInterceptor { private readonly logger = new Logger(ErrorLoggingInterceptor.name); intercept(_context: ExecutionContext, next: CallHandler): Observable<any> { return next.handle().pipe( catchError((error) => { this.logger.error('Error caught in interceptor:', { name: error.name, message: error.message, stack: error.stack, }); return throwError(() => error); }) ); } } export default ErrorLoggingInterceptor;

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/KasarLabs/snak'

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