Skip to content

fix: correct .default() misuse, API payload typo, and wrong tool name#450

Open
ZLeventer wants to merge 1 commit into
salesforcecli:mainfrom
ZLeventer:fix/bugs-default-value-typo-wrong-tool-name
Open

fix: correct .default() misuse, API payload typo, and wrong tool name#450
ZLeventer wants to merge 1 commit into
salesforcecli:mainfrom
ZLeventer:fix/bugs-default-value-typo-wrong-tool-name

Conversation

@ZLeventer
Copy link
Copy Markdown

Summary

Three bug fixes in tool definitions:

1. testRunId uses .default() instead of .describe() (run_apex_test.ts)

The testRunId parameter uses .default('an id of an in-progress, or completed apex test run') — this sets the literal description string as the default value instead of documenting the parameter. If no testRunId is provided, zod will populate it with that description string rather than leaving it undefined.

Fix: Change .default() to .describe().

2. 'metadatadata' typo in OrgSnapshot API payload (create_org_snapshot.ts)

The Content field sent to the Salesforce OrgSnapshot.create() API is 'metadatadata' instead of 'metadata'. This could cause the API call to fail or behave unexpectedly.

Fix: Change 'metadatadata' to 'metadata'.

3. Wrong tool name in agent instructions (sfDevopsListWorkItems.ts)

The tool description references 'sf-list-all-orgs' but the actual registered tool name is 'list_all_orgs'. An LLM following these instructions would attempt to call a nonexistent tool.

Fix: Change 'sf-list-all-orgs' to 'list_all_orgs'.

Test plan

  • Verify testRunId param no longer has a default value (was description string, now uses .describe())
  • Verify create_org_snapshot sends correct Content: 'metadata' to Salesforce API
  • Verify list_devops_center_work_items tool description references correct tool name list_all_orgs

… reference

- run_apex_test.ts: change testRunId from .default() to .describe() —
  the description string was being used as the default value, meaning
  if no testRunId was provided, it would default to the literal string
  "an id of an in-progress, or completed apex test run"

- create_org_snapshot.ts: fix 'metadatadata' → 'metadata' in the
  OrgSnapshot.create() API payload (Content field)

- sfDevopsListWorkItems.ts: fix tool name reference from
  'sf-list-all-orgs' → 'list_all_orgs' to match the actual registered
  tool name, preventing agents from calling a nonexistent tool
@ZLeventer ZLeventer requested review from a team as code owners April 24, 2026 13:36
@ZLeventer
Copy link
Copy Markdown
Author

I've signed the Salesforce CLA — recheck should pass now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant