/** * Copyright (c) 2026, Salesforce, Inc., * All rights reserved. * For full license text, see the LICENSE.txt file */ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; /** * Transport/dispatch bring-up stub: returns caller input verbatim, deliberately * bypassing the runTool/sanitizePaths/neutralizeControlChars chokepoint. Because * it reflects raw bytes it is registered only when GRAPHITI_ENABLE_ECHO === "1" * (see createServer) and is absent from the default published surface, pending * removal now that the sf_gql_* tools provide real coverage (W-23148363). */ export function registerEchoTool(server: McpServer): void { server.registerTool( "echo", { description: "Echo the input message back verbatim. Used to verify MCP transport and dispatch end-to-end before the typed sf_gql_* tools are wired in.", inputSchema: { message: z.string().describe("The message to echo back."), }, }, async ({ message }) => ({ content: [{ type: "text", text: message }], }), ); }