Skip to content

Commit 843b2cd

Browse files
committed
review stripe tools metadata
1 parent 507adc7 commit 843b2cd

File tree

8 files changed

+20
-17
lines changed

8 files changed

+20
-17
lines changed

apps/sim/tools/stripe/capture_charge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const stripeCaptureChargeTool: ToolConfig<CaptureChargeParams, ChargeResp
7575
status: { type: 'string', description: 'Current state of the resource' },
7676
amount: { type: 'number', description: 'Amount in smallest currency unit (e.g., cents)' },
7777
currency: { type: 'string', description: 'Three-letter ISO currency code (lowercase)' },
78-
paid: { type: 'string', description: 'Stripe unique identifier' },
78+
paid: { type: 'boolean', description: 'Whether payment has been received' },
7979
},
8080
},
8181
},

apps/sim/tools/stripe/create_customer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ export const stripeCreateCustomerTool: ToolConfig<CreateCustomerParams, Customer
9898
customer: data,
9999
metadata: {
100100
id: data.id,
101-
email: data.email,
102-
name: data.name,
101+
email: data.email ?? null,
102+
name: data.name ?? null,
103103
},
104104
},
105105
}
@@ -115,8 +115,8 @@ export const stripeCreateCustomerTool: ToolConfig<CreateCustomerParams, Customer
115115
description: 'Customer metadata',
116116
properties: {
117117
id: { type: 'string', description: 'Stripe unique identifier' },
118-
email: { type: 'string', description: 'Customer email address' },
119-
name: { type: 'string', description: 'Display name' },
118+
email: { type: 'string', description: 'Customer email address', optional: true },
119+
name: { type: 'string', description: 'Display name', optional: true },
120120
},
121121
},
122122
},

apps/sim/tools/stripe/create_price.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const stripeCreatePriceTool: ToolConfig<CreatePriceParams, PriceResponse>
9494
metadata: {
9595
id: data.id,
9696
product: data.product,
97-
unit_amount: data.unit_amount,
97+
unit_amount: data.unit_amount ?? null,
9898
currency: data.currency,
9999
},
100100
},
@@ -115,6 +115,7 @@ export const stripeCreatePriceTool: ToolConfig<CreatePriceParams, PriceResponse>
115115
unit_amount: {
116116
type: 'number',
117117
description: 'Amount in smallest currency unit (e.g., cents)',
118+
optional: true,
118119
},
119120
currency: { type: 'string', description: 'Three-letter ISO currency code (lowercase)' },
120121
},

apps/sim/tools/stripe/retrieve_charge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const stripeRetrieveChargeTool: ToolConfig<RetrieveChargeParams, ChargeRe
6262
status: { type: 'string', description: 'Current state of the resource' },
6363
amount: { type: 'number', description: 'Amount in smallest currency unit (e.g., cents)' },
6464
currency: { type: 'string', description: 'Three-letter ISO currency code (lowercase)' },
65-
paid: { type: 'string', description: 'Stripe unique identifier' },
65+
paid: { type: 'boolean', description: 'Whether payment has been received' },
6666
},
6767
},
6868
},

apps/sim/tools/stripe/retrieve_customer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ export const stripeRetrieveCustomerTool: ToolConfig<RetrieveCustomerParams, Cust
3939
customer: data,
4040
metadata: {
4141
id: data.id,
42-
email: data.email,
43-
name: data.name,
42+
email: data.email ?? null,
43+
name: data.name ?? null,
4444
},
4545
},
4646
}
@@ -57,8 +57,8 @@ export const stripeRetrieveCustomerTool: ToolConfig<RetrieveCustomerParams, Cust
5757

5858
properties: {
5959
id: { type: 'string', description: 'Stripe unique identifier' },
60-
email: { type: 'string', description: 'Customer email address' },
61-
name: { type: 'string', description: 'Display name' },
60+
email: { type: 'string', description: 'Customer email address', optional: true },
61+
name: { type: 'string', description: 'Display name', optional: true },
6262
},
6363
},
6464
},

apps/sim/tools/stripe/retrieve_price.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const stripeRetrievePriceTool: ToolConfig<RetrievePriceParams, PriceRespo
4040
metadata: {
4141
id: data.id,
4242
product: data.product,
43-
unit_amount: data.unit_amount,
43+
unit_amount: data.unit_amount ?? null,
4444
currency: data.currency,
4545
},
4646
},
@@ -62,6 +62,7 @@ export const stripeRetrievePriceTool: ToolConfig<RetrievePriceParams, PriceRespo
6262
unit_amount: {
6363
type: 'number',
6464
description: 'Amount in smallest currency unit (e.g., cents)',
65+
optional: true,
6566
},
6667
currency: { type: 'string', description: 'Three-letter ISO currency code (lowercase)' },
6768
},

apps/sim/tools/stripe/update_customer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ export const stripeUpdateCustomerTool: ToolConfig<UpdateCustomerParams, Customer
9797
customer: data,
9898
metadata: {
9999
id: data.id,
100-
email: data.email,
101-
name: data.name,
100+
email: data.email ?? null,
101+
name: data.name ?? null,
102102
},
103103
},
104104
}
@@ -114,8 +114,8 @@ export const stripeUpdateCustomerTool: ToolConfig<UpdateCustomerParams, Customer
114114
description: 'Customer metadata',
115115
properties: {
116116
id: { type: 'string', description: 'Stripe unique identifier' },
117-
email: { type: 'string', description: 'Customer email address' },
118-
name: { type: 'string', description: 'Display name' },
117+
email: { type: 'string', description: 'Customer email address', optional: true },
118+
name: { type: 'string', description: 'Display name', optional: true },
119119
},
120120
},
121121
},

apps/sim/tools/stripe/update_price.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const stripeUpdatePriceTool: ToolConfig<UpdatePriceParams, PriceResponse>
6565
metadata: {
6666
id: data.id,
6767
product: data.product,
68-
unit_amount: data.unit_amount,
68+
unit_amount: data.unit_amount ?? null,
6969
currency: data.currency,
7070
},
7171
},
@@ -86,6 +86,7 @@ export const stripeUpdatePriceTool: ToolConfig<UpdatePriceParams, PriceResponse>
8686
unit_amount: {
8787
type: 'number',
8888
description: 'Amount in smallest currency unit (e.g., cents)',
89+
optional: true,
8990
},
9091
currency: { type: 'string', description: 'Three-letter ISO currency code (lowercase)' },
9192
},

0 commit comments

Comments
 (0)