/** * 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 { buildList } from "../../intent/build-list.js"; import { type PrimeDeps } from "../../lib/prime-schema.js"; import { LIST_INPUT } from "../../schemas/input-schemas.js"; import { runTool } from "../../schemas/tool-adapter.js"; export interface SfGqlListToolOptions { primeDeps?: PrimeDeps; } const inputSchema = LIST_INPUT.shape; export function registerSfGqlListTool(server: McpServer, opts: SfGqlListToolOptions = {}): void { server.registerTool( "sf_gql_list", { description: "Build a UIAPI list query against a Salesforce org. Returns rendered GraphQL, declared variables, generated TypeScript types, and validation warnings.", inputSchema, }, async (args) => runTool(() => buildList(args, opts.primeDeps)), ); }