Skip to content

Update contract ID terminology in get_contract_status tool#43

Merged
adith-dinesh merged 1 commit intomainfrom
fix-contract-status-input
Mar 26, 2026
Merged

Update contract ID terminology in get_contract_status tool#43
adith-dinesh merged 1 commit intomainfrom
fix-contract-status-input

Conversation

@kundanrao8507
Copy link
Copy Markdown
Contributor

@kundanrao8507 kundanrao8507 commented Mar 26, 2026

User description

  • Changed 'contract_id' to 'composite_id' in the input schema and request interface for clarity.
  • Updated descriptions to specify the expected format for composite IDs (T-123 for templates, H-123 for historical contracts).
  • Adjusted the endpoint construction to reflect the new naming convention.

Generated description

Below is a concise technical summary of the changes proposed in this PR:
Clarify the contract status tool schema and GetContractStatusRequest interface by renaming contract_id to composite_id and describing the T-123/H-123 format for template versus historical contracts. Align the getContractStatus endpoint construction with the updated naming so the tool consistently references composite_id when calling the SpotDraft API.

Latest Contributors(1)
UserCommitDate
achuth10chore: Refactor projec...February 05, 2026
This pull request is reviewed by Baz. Review like a pro on (Baz).

@sachin-spotdraft sachin-spotdraft added the size/s < 100 lines of changes label Mar 26, 2026
@adith-dinesh adith-dinesh merged commit 41b1287 into main Mar 26, 2026
7 checks passed
Comment on lines 7 to 11
inputSchema: {
type: 'object',
properties: {
contract_id: {
composite_id: {
type: 'string',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix in Cursor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s < 100 lines of changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants