diff --git a/src/shared/params.ts b/src/shared/params.ts index 4769974d..938a462b 100644 --- a/src/shared/params.ts +++ b/src/shared/params.ts @@ -46,9 +46,9 @@ export const baseAbsolutePathParam = z .refine(sanitizePath, 'Invalid path: Must be an absolute path and cannot contain path traversal sequences'); export const directoryParam = baseAbsolutePathParam.describe(`The directory to run this tool from. -AGENT INSTRUCTIONS: -We need to know where the user wants to run this tool from. -Look at your current Workspace Context to determine this filepath. -ALWAYS USE A FULL PATH TO THE DIRECTORY. -Unless the user explicitly asks for a different directory, or a new directory is created from the action of a tool, use this same directory for future tool calls. +Use the full absolute path to the root directory of the active project in the current IDE workspace context. + +This directory must be an absolute path to ensure consistent tool behavior. + +Unless the user explicitly specifies a different directory, or the action of another tool creates a new working directory, use the same project directory for subsequent tool calls. `); diff --git a/src/tools/metadata/sf-deploy-metadata.ts b/src/tools/metadata/sf-deploy-metadata.ts index 91109af9..3088c469 100644 --- a/src/tools/metadata/sf-deploy-metadata.ts +++ b/src/tools/metadata/sf-deploy-metadata.ts @@ -27,9 +27,13 @@ import { getConnection } from '../../shared/auth.js'; import { SfMcpServer } from '../../sf-mcp-server.js'; const deployMetadataParams = z.object({ - sourceDir: z + filePaths: z .array(z.string()) - .describe('Path to the local source files to deploy. Leave this unset if the user is vague about what to deploy.') + .describe( + `Path to the local source files to deploy. Leave this unset if the user is vague about what to deploy. +All file paths should be relative to the current directory. +` + ) .optional(), manifest: z.string().describe('Full file path for manifest (XML file) of components to deploy.').optional(), // `RunSpecifiedTests` is excluded on purpose because the tool sets this level when Apex tests to run are passed in. @@ -102,12 +106,12 @@ Deploy X to my org and run A,B and C apex tests. destructiveHint: true, openWorldHint: false, }, - async ({ sourceDir, usernameOrAlias, apexTests, apexTestLevel, directory, manifest }) => { + async ({ filePaths, usernameOrAlias, apexTests, apexTestLevel, directory, manifest }) => { if (apexTests && apexTestLevel) { return textResponse("You can't specify both `apexTests` and `apexTestLevel` parameters.", true); } - if (sourceDir && manifest) { + if (filePaths && manifest) { return textResponse("You can't specify both `sourceDir` and `manifest` parameters.", true); } @@ -125,7 +129,7 @@ Deploy X to my org and run A,B and C apex tests. const org = await Org.create({ connection }); - if (!sourceDir && !manifest && !(await org.tracksSource())) { + if (!filePaths && !manifest && !(await org.tracksSource())) { return textResponse( 'This org does not have source-tracking enabled or does not support source-tracking. You should specify the files or a manifest to deploy.', true @@ -140,7 +144,7 @@ Deploy X to my org and run A,B and C apex tests. subscribeSDREvents: true, }); - const componentSet = await buildDeployComponentSet(connection, project, stl, sourceDir, manifest); + const componentSet = await buildDeployComponentSet(connection, project, stl, filePaths, manifest); if (componentSet.size === 0) { // STL found no changes