Skip to main content
Glama

Playwright MCP Server

by showfive
Echo.ts1.21 kB
import { McpError, ErrorCode, type CallToolRequest } from "@modelcontextprotocol/sdk/types.js"; import type { ToolHandler, ToolResponse } from "./types.js"; export const toolDefinition = { name: "echo", description: "入力されたメッセージをそのまま返します", inputSchema: { type: "object", properties: { message: { type: "string", description: "エコーするメッセージ" } }, required: ["message"] } } as const; async function echo(message: string): Promise<string> { if (typeof message !== 'string') { throw new McpError( ErrorCode.InvalidParams, 'Message must be a string' ); } return message; } export const echoHandler: ToolHandler = async (request: CallToolRequest): Promise<ToolResponse> => { const { message } = request.params.arguments as { message: string; }; try { const result = await echo(message); return { content: [ { type: "text", text: result } ] }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Echo failed: ${error instanceof Error ? error.message : String(error)}` ); } };

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/showfive/playwright-mcp-server'

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