Update contract ID terminology in get_contract_status tool#43
Merged
adith-dinesh merged 1 commit intomainfrom Mar 26, 2026
Merged
Update contract ID terminology in get_contract_status tool#43adith-dinesh merged 1 commit intomainfrom
adith-dinesh merged 1 commit intomainfrom
Conversation
adith-dinesh
approved these changes
Mar 26, 2026
Comment on lines
7
to
11
| inputSchema: { | ||
| type: 'object', | ||
| properties: { | ||
| contract_id: { | ||
| composite_id: { | ||
| type: 'string', |
There was a problem hiding this comment.
composite_id is now required and contract_id removed — should we keep contract_id as a legacy alias mapped to composite_id?
contract_id => composite_id
Finding type: Breaking Changes | Severity: 🔴 High
Want Baz to fix this for you? Activate Fixer
Prompt for AI Agents:
Before applying, verify this suggestion against the current code. In
src/tools/contracts/get_contract_status.ts around lines 7-11 (the
getContractStatusTool.inputSchema) and lines 21-27 (the GetContractStatusRequest
interface and getContractStatus function), preserve backward compatibility for legacy
callers that send contract_id. Change the input schema to accept both composite_id and
contract_id (or use a oneOf/anyOf rule so at least one is required), add contract_id to
the TypeScript request interface as optional, and in getContractStatus compute a
derivedCompositeId = request.composite_id ||
normalizeLegacyContractId(request.contract_id) where normalizeLegacyContractId returns
the value unchanged if it already matches /^[HT]-[0-9]+$/, and if it is a plain integer
string, prefixes it with 'T-'. Then use derivedCompositeId when building the endpoint
(`/v2.1/public/contracts/${derivedCompositeId}/status`). This will avoid breaking
existing integrations while supporting the new composite_id name.
sachin-spotdraft
pushed a commit
that referenced
this pull request
Mar 26, 2026
(cherry picked from commit 41b1287)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Clarify the contract status tool schema and
GetContractStatusRequestinterface by renamingcontract_idtocomposite_idand describing the T-123/H-123 format for template versus historical contracts. Align thegetContractStatusendpoint construction with the updated naming so the tool consistently referencescomposite_idwhen calling the SpotDraft API.Latest Contributors(1)