/** * 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 { buildCreate } from "../../intent/build-create.js"; import { type PrimeDeps } from "../../lib/prime-schema.js"; import { CREATE_INPUT } from "../../schemas/input-schemas.js"; import { runTool } from "../../schemas/tool-adapter.js"; export interface SfGqlCreateToolOptions { primeDeps?: PrimeDeps; } const inputSchema = CREATE_INPUT.shape; export function registerSfGqlCreateTool( server: McpServer, opts: SfGqlCreateToolOptions = {}, ): void { server.registerTool( "sf_gql_create", { description: "Build a UIAPI create mutation against a Salesforce org. Declares a typed input variable ($input: CreateInput!) and selects return fields on the created record. Returns rendered GraphQL, declared variables, generated TypeScript types, and validation warnings.", inputSchema, }, async (args) => runTool(() => buildCreate(args, opts.primeDeps)), ); }