Skip to main content
Glama

Readwise MCP Server

by IAmAlexander
base.ts816 B
import type { Logger } from '../utils/logger-interface.js'; import { toMCPResponse } from '../utils/response.js'; import type { MCPResponse, ValidationResult } from '../mcp/types.js'; export abstract class BaseMCPTool<TParams, TResult> { abstract readonly name: string; abstract readonly description: string; abstract readonly parameters: Record<string, any>; protected readonly logger: Logger; constructor(logger: Logger) { this.logger = logger; } validate(_params: TParams): ValidationResult { return { valid: true, errors: [], success: true } as any; } abstract execute(params: TParams): Promise<{ result: TResult }>; async executeAsMCP(params: TParams): Promise<MCPResponse> { const result = await this.execute(params); return toMCPResponse(result.result as any); } }

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/IAmAlexander/readwise-mcp'

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