/** * 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 { buildDelete } from "../../intent/build-delete.js"; import { type PrimeDeps } from "../../lib/prime-schema.js"; import { DELETE_INPUT } from "../../schemas/input-schemas.js"; import { runTool } from "../../schemas/tool-adapter.js"; export interface SfGqlDeleteToolOptions { primeDeps?: PrimeDeps; } const inputSchema = DELETE_INPUT.shape; export function registerSfGqlDeleteTool( server: McpServer, opts: SfGqlDeleteToolOptions = {}, ): void { server.registerTool( "sf_gql_delete", { description: "Build a UIAPI delete mutation against a Salesforce org. Declares a typed input variable ($input: RecordDeleteInput!) and selects Id on the deleted record. The input type is schema-wide (not -specific) and the result is Id only. Returns rendered GraphQL, declared variables, generated TypeScript types, and validation warnings.", inputSchema, }, async (args) => runTool(() => buildDelete(args, opts.primeDeps)), ); }