@shippo/shippo-mcp 2.0.2 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/bin/mcp-server.js +1504 -718
  2. package/bin/mcp-server.js.map +36 -16
  3. package/esm/funcs/addressesCreateV1.d.ts +17 -0
  4. package/esm/funcs/addressesCreateV1.d.ts.map +1 -0
  5. package/esm/funcs/addressesCreateV1.js +86 -0
  6. package/esm/funcs/addressesCreateV1.js.map +1 -0
  7. package/esm/funcs/addressesCreateV2.d.ts +18 -0
  8. package/esm/funcs/addressesCreateV2.d.ts.map +1 -0
  9. package/esm/funcs/addressesCreateV2.js +93 -0
  10. package/esm/funcs/addressesCreateV2.js.map +1 -0
  11. package/esm/funcs/addressesParse.d.ts +24 -0
  12. package/esm/funcs/addressesParse.d.ts.map +1 -0
  13. package/esm/funcs/addressesParse.js +96 -0
  14. package/esm/funcs/addressesParse.js.map +1 -0
  15. package/esm/funcs/addressesValidateV2.d.ts +24 -0
  16. package/esm/funcs/addressesValidateV2.d.ts.map +1 -0
  17. package/esm/funcs/addressesValidateV2.js +105 -0
  18. package/esm/funcs/addressesValidateV2.js.map +1 -0
  19. package/esm/lib/config.d.ts +2 -2
  20. package/esm/lib/config.js +2 -2
  21. package/esm/mcp-server/mcp-server.js +1 -1
  22. package/esm/mcp-server/server.d.ts.map +1 -1
  23. package/esm/mcp-server/server.js +9 -3
  24. package/esm/mcp-server/server.js.map +1 -1
  25. package/esm/mcp-server/tools/addressesCreateV1.d.ts +7 -0
  26. package/esm/mcp-server/tools/addressesCreateV1.d.ts.map +1 -0
  27. package/esm/mcp-server/tools/addressesCreateV1.js +48 -0
  28. package/esm/mcp-server/tools/addressesCreateV1.js.map +1 -0
  29. package/esm/mcp-server/tools/addressesCreateV2.d.ts +7 -0
  30. package/esm/mcp-server/tools/addressesCreateV2.d.ts.map +1 -0
  31. package/esm/mcp-server/tools/addressesCreateV2.js +82 -0
  32. package/esm/mcp-server/tools/addressesCreateV2.js.map +1 -0
  33. package/esm/mcp-server/tools/addressesParse.d.ts +7 -0
  34. package/esm/mcp-server/tools/addressesParse.d.ts.map +1 -0
  35. package/esm/mcp-server/tools/addressesParse.js +66 -0
  36. package/esm/mcp-server/tools/addressesParse.js.map +1 -0
  37. package/esm/mcp-server/tools/addressesValidate.d.ts.map +1 -1
  38. package/esm/mcp-server/tools/addressesValidate.js +12 -3
  39. package/esm/mcp-server/tools/addressesValidate.js.map +1 -1
  40. package/esm/mcp-server/tools/addressesValidateV2.d.ts +7 -0
  41. package/esm/mcp-server/tools/addressesValidateV2.d.ts.map +1 -0
  42. package/esm/mcp-server/tools/addressesValidateV2.js +95 -0
  43. package/esm/mcp-server/tools/addressesValidateV2.js.map +1 -0
  44. package/esm/mcp-server/tools/ordersList.d.ts.map +1 -1
  45. package/esm/mcp-server/tools/ordersList.js +20 -2
  46. package/esm/mcp-server/tools/ordersList.js.map +1 -1
  47. package/esm/models/addressanalysisv2.d.ts +24 -0
  48. package/esm/models/addressanalysisv2.d.ts.map +1 -0
  49. package/esm/models/addressanalysisv2.js +22 -0
  50. package/esm/models/addressanalysisv2.js.map +1 -0
  51. package/esm/models/addresscreaterequestv2.d.ts +41 -0
  52. package/esm/models/addresscreaterequestv2.d.ts.map +1 -0
  53. package/esm/models/addresscreaterequestv2.js +35 -0
  54. package/esm/models/addresscreaterequestv2.js.map +1 -0
  55. package/esm/models/addressdatav2.d.ts +35 -0
  56. package/esm/models/addressdatav2.d.ts.map +1 -0
  57. package/esm/models/addressdatav2.js +32 -0
  58. package/esm/models/addressdatav2.js.map +1 -0
  59. package/esm/models/addressv2.d.ts +18 -0
  60. package/esm/models/addressv2.d.ts.map +1 -0
  61. package/esm/models/addressv2.js +17 -0
  62. package/esm/models/addressv2.js.map +1 -0
  63. package/esm/models/addressvalidationresultv2.d.ts +16 -0
  64. package/esm/models/addressvalidationresultv2.d.ts.map +1 -0
  65. package/esm/models/addressvalidationresultv2.js +15 -0
  66. package/esm/models/addressvalidationresultv2.js.map +1 -0
  67. package/esm/models/addresswithmetadataresponse.d.ts +13 -0
  68. package/esm/models/addresswithmetadataresponse.d.ts.map +1 -0
  69. package/esm/models/addresswithmetadataresponse.js +12 -0
  70. package/esm/models/addresswithmetadataresponse.js.map +1 -0
  71. package/esm/models/confidenceresult.d.ts +23 -0
  72. package/esm/models/confidenceresult.d.ts.map +1 -0
  73. package/esm/models/confidenceresult.js +20 -0
  74. package/esm/models/confidenceresult.js.map +1 -0
  75. package/esm/models/createaddressv2op.d.ts +30 -0
  76. package/esm/models/createaddressv2op.d.ts.map +1 -0
  77. package/esm/models/createaddressv2op.js +22 -0
  78. package/esm/models/createaddressv2op.js.map +1 -0
  79. package/esm/models/customsdeclarationcreaterequest.d.ts +27 -27
  80. package/esm/models/customsdeclarationcreaterequest.d.ts.map +1 -1
  81. package/esm/models/customsdeclarationcreaterequest.js +27 -27
  82. package/esm/models/customsdeclarationcreaterequest.js.map +1 -1
  83. package/esm/models/defaultparceltemplate.d.ts +2 -71
  84. package/esm/models/defaultparceltemplate.d.ts.map +1 -1
  85. package/esm/models/defaultparceltemplate.js +2 -62
  86. package/esm/models/defaultparceltemplate.js.map +1 -1
  87. package/esm/models/geocoordinates.d.ts +10 -0
  88. package/esm/models/geocoordinates.d.ts.map +1 -0
  89. package/esm/models/geocoordinates.js +9 -0
  90. package/esm/models/geocoordinates.js.map +1 -0
  91. package/esm/models/order.d.ts +1 -29
  92. package/esm/models/order.d.ts.map +1 -1
  93. package/esm/models/order.js +1 -25
  94. package/esm/models/order.js.map +1 -1
  95. package/esm/models/parseaddressop.d.ts +20 -0
  96. package/esm/models/parseaddressop.d.ts.map +1 -0
  97. package/esm/models/parseaddressop.js +25 -0
  98. package/esm/models/parseaddressop.js.map +1 -0
  99. package/esm/models/parsedaddress.d.ts +16 -0
  100. package/esm/models/parsedaddress.d.ts.map +1 -0
  101. package/esm/models/parsedaddress.js +15 -0
  102. package/esm/models/parsedaddress.js.map +1 -0
  103. package/esm/models/recommendedaddressv2.d.ts +21 -0
  104. package/esm/models/recommendedaddressv2.d.ts.map +1 -0
  105. package/esm/models/recommendedaddressv2.js +21 -0
  106. package/esm/models/recommendedaddressv2.js.map +1 -0
  107. package/esm/models/shipment.d.ts +1 -1
  108. package/esm/models/userparceltemplate.d.ts +5 -57
  109. package/esm/models/userparceltemplate.d.ts.map +1 -1
  110. package/esm/models/userparceltemplate.js +5 -49
  111. package/esm/models/userparceltemplate.js.map +1 -1
  112. package/esm/models/userparceltemplateupdaterequest.d.ts +4 -45
  113. package/esm/models/userparceltemplateupdaterequest.d.ts.map +1 -1
  114. package/esm/models/userparceltemplateupdaterequest.js +4 -38
  115. package/esm/models/userparceltemplateupdaterequest.js.map +1 -1
  116. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.d.ts +4 -45
  117. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.d.ts.map +1 -1
  118. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.js +4 -38
  119. package/esm/models/userparceltemplatewithoutcarriertemplatecreaterequest.js.map +1 -1
  120. package/esm/models/validateaddressv2op.d.ts +265 -0
  121. package/esm/models/validateaddressv2op.d.ts.map +1 -0
  122. package/esm/models/validateaddressv2op.js +258 -0
  123. package/esm/models/validateaddressv2op.js.map +1 -0
  124. package/esm/models/validationresultv2.d.ts +15 -0
  125. package/esm/models/validationresultv2.d.ts.map +1 -0
  126. package/esm/models/validationresultv2.js +14 -0
  127. package/esm/models/validationresultv2.js.map +1 -0
  128. package/manifest.json +17 -5
  129. package/package.json +1 -1
  130. package/src/funcs/{addressesCreate.ts → addressesCreateV1.ts} +1 -1
  131. package/src/funcs/addressesCreateV2.ts +178 -0
  132. package/src/funcs/addressesParse.ts +178 -0
  133. package/src/funcs/addressesValidateV2.ts +188 -0
  134. package/src/lib/config.ts +2 -2
  135. package/src/mcp-server/mcp-server.ts +1 -1
  136. package/src/mcp-server/server.ts +9 -3
  137. package/src/mcp-server/tools/addressesCreateV1.ts +58 -0
  138. package/src/mcp-server/tools/addressesCreateV2.ts +92 -0
  139. package/src/mcp-server/tools/addressesParse.ts +76 -0
  140. package/src/mcp-server/tools/addressesValidate.ts +12 -3
  141. package/src/mcp-server/tools/addressesValidateV2.ts +105 -0
  142. package/src/mcp-server/tools/ordersList.ts +20 -2
  143. package/src/models/addressanalysisv2.ts +41 -0
  144. package/src/models/addresscreaterequestv2.ts +64 -0
  145. package/src/models/addressdatav2.ts +56 -0
  146. package/src/models/addressv2.ts +34 -0
  147. package/src/models/addressvalidationresultv2.ts +34 -0
  148. package/src/models/addresswithmetadataresponse.ts +25 -0
  149. package/src/models/confidenceresult.ts +36 -0
  150. package/src/models/createaddressv2op.ts +73 -0
  151. package/src/models/customsdeclarationcreaterequest.ts +54 -54
  152. package/src/models/defaultparceltemplate.ts +5 -122
  153. package/src/models/geocoordinates.ts +18 -0
  154. package/src/models/order.ts +2 -61
  155. package/src/models/parseaddressop.ts +44 -0
  156. package/src/models/parsedaddress.ts +32 -0
  157. package/src/models/recommendedaddressv2.ts +43 -0
  158. package/src/models/userparceltemplate.ts +11 -90
  159. package/src/models/userparceltemplateupdaterequest.ts +9 -62
  160. package/src/models/userparceltemplatewithoutcarriertemplatecreaterequest.ts +9 -70
  161. package/src/models/validateaddressv2op.ts +319 -0
  162. package/src/models/validationresultv2.ts +29 -0
  163. package/src/mcp-server/tools/addressesCreate.ts +0 -74
@@ -0,0 +1,178 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { ShippoSDKCore } from "../core.js";
6
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import { APIError } from "../models/errors/apierror.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
+ import {
23
+ ParseAddressRequest,
24
+ ParseAddressRequest$zodSchema,
25
+ ParseAddressResponse,
26
+ ParseAddressResponse$zodSchema,
27
+ } from "../models/parseaddressop.js";
28
+ import { APICall, APIPromise } from "../types/async.js";
29
+ import { Result } from "../types/fp.js";
30
+
31
+ /**
32
+ * Parse an address string
33
+ *
34
+ * @remarks
35
+ * Parses an unstructured address string into a structured address object.
36
+ * The parser extracts address components like street, city, state, postal code, country, email, and phone.
37
+ *
38
+ * For best results:
39
+ * - Use a comma (,) as a delimiter between address parts
40
+ * - Follow this order: address_line_1, address_line_2, city_locality, state_province, postal_code, country_code
41
+ * - Phone and email can be in any part of the string
42
+ *
43
+ * Example input: "Shippo 731 Market St #200, San Francisco, CA 94103 US shippo@shippo.com +1-555-999-8888"
44
+ */
45
+ export function addressesParse(
46
+ client$: ShippoSDKCore,
47
+ request: ParseAddressRequest,
48
+ options?: RequestOptions,
49
+ ): APIPromise<
50
+ Result<
51
+ ParseAddressResponse,
52
+ | APIError
53
+ | SDKValidationError
54
+ | UnexpectedClientError
55
+ | InvalidRequestError
56
+ | RequestAbortedError
57
+ | RequestTimeoutError
58
+ | ConnectionError
59
+ >
60
+ > {
61
+ return new APIPromise($do(
62
+ client$,
63
+ request,
64
+ options,
65
+ ));
66
+ }
67
+
68
+ async function $do(
69
+ client$: ShippoSDKCore,
70
+ request: ParseAddressRequest,
71
+ options?: RequestOptions,
72
+ ): Promise<
73
+ [
74
+ Result<
75
+ ParseAddressResponse,
76
+ | APIError
77
+ | SDKValidationError
78
+ | UnexpectedClientError
79
+ | InvalidRequestError
80
+ | RequestAbortedError
81
+ | RequestTimeoutError
82
+ | ConnectionError
83
+ >,
84
+ APICall,
85
+ ]
86
+ > {
87
+ const parsed$ = safeParse(
88
+ request,
89
+ (value$) => ParseAddressRequest$zodSchema.parse(value$),
90
+ "Input validation failed",
91
+ );
92
+ if (!parsed$.ok) {
93
+ return [parsed$, { status: "invalid" }];
94
+ }
95
+ const payload$ = parsed$.value;
96
+ const body$ = null;
97
+ const path$ = pathToFunc("/v2/addresses/parse")();
98
+ const query$ = encodeFormQuery({
99
+ "address": payload$.address,
100
+ });
101
+
102
+ const headers$ = new Headers(compactMap({
103
+ Accept: "application/json",
104
+ "SHIPPO-API-VERSION": encodeSimple(
105
+ "SHIPPO-API-VERSION",
106
+ client$._options.shippoApiVersion,
107
+ { explode: false, charEncoding: "none" },
108
+ ),
109
+ }));
110
+ const securityInput = await extractSecurity(client$._options.security);
111
+ const requestSecurity = resolveGlobalSecurity(securityInput);
112
+
113
+ const context = {
114
+ options: client$._options,
115
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
116
+ operationID: "ParseAddress",
117
+ oAuth2Scopes: null,
118
+ resolvedSecurity: requestSecurity,
119
+ securitySource: client$._options.security,
120
+ retryConfig: options?.retries
121
+ || client$._options.retryConfig
122
+ || { strategy: "none" },
123
+ retryCodes: options?.retryCodes || [
124
+ "429",
125
+ "500",
126
+ "502",
127
+ "503",
128
+ "504",
129
+ ],
130
+ };
131
+
132
+ const requestRes = client$._createRequest(context, {
133
+ security: requestSecurity,
134
+ method: "GET",
135
+ baseURL: options?.serverURL,
136
+ path: path$,
137
+ headers: headers$,
138
+ query: query$,
139
+ body: body$,
140
+ userAgent: client$._options.userAgent,
141
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs
142
+ || -1,
143
+ }, options);
144
+ if (!requestRes.ok) {
145
+ return [requestRes, { status: "invalid" }];
146
+ }
147
+ const req$ = requestRes.value;
148
+
149
+ const doResult = await client$._do(req$, {
150
+ context,
151
+ errorCodes: [],
152
+ retryConfig: context.retryConfig,
153
+ retryCodes: context.retryCodes,
154
+ });
155
+ if (!doResult.ok) {
156
+ return [doResult, { status: "request-error", request: req$ }];
157
+ }
158
+ const response = doResult.value;
159
+ const responseFields$ = {
160
+ HttpMeta: { Response: response, Request: req$ },
161
+ };
162
+
163
+ const [result$] = await M.match<
164
+ ParseAddressResponse,
165
+ | APIError
166
+ | SDKValidationError
167
+ | UnexpectedClientError
168
+ | InvalidRequestError
169
+ | RequestAbortedError
170
+ | RequestTimeoutError
171
+ | ConnectionError
172
+ >(
173
+ M.json(200, ParseAddressResponse$zodSchema, { key: "ParsedAddress" }),
174
+ M.json(400, ParseAddressResponse$zodSchema, { key: "BadRequest" }),
175
+ )(response, req$, { extraFields: responseFields$ });
176
+
177
+ return [result$, { status: "complete", request: req$, response }];
178
+ }
@@ -0,0 +1,188 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { ShippoSDKCore } from "../core.js";
6
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import { APIError } from "../models/errors/apierror.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
+ import {
23
+ ValidateAddressV2Request,
24
+ ValidateAddressV2Request$zodSchema,
25
+ ValidateAddressV2Response,
26
+ ValidateAddressV2Response$zodSchema,
27
+ } from "../models/validateaddressv2op.js";
28
+ import { APICall, APIPromise } from "../types/async.js";
29
+ import { Result } from "../types/fp.js";
30
+
31
+ /**
32
+ * Validate an address (v2)
33
+ *
34
+ * @remarks
35
+ * Returns validation test results along with a recommended address.
36
+ * Validates both US and international addresses.
37
+ *
38
+ * **US required combinations:**
39
+ * - state_province + city_locality + address_line_1
40
+ * - OR address_line_1 + postal_code
41
+ *
42
+ * **International required combinations:**
43
+ * - city_locality + address_line_1
44
+ */
45
+ export function addressesValidateV2(
46
+ client$: ShippoSDKCore,
47
+ request: ValidateAddressV2Request,
48
+ options?: RequestOptions,
49
+ ): APIPromise<
50
+ Result<
51
+ ValidateAddressV2Response,
52
+ | APIError
53
+ | SDKValidationError
54
+ | UnexpectedClientError
55
+ | InvalidRequestError
56
+ | RequestAbortedError
57
+ | RequestTimeoutError
58
+ | ConnectionError
59
+ >
60
+ > {
61
+ return new APIPromise($do(
62
+ client$,
63
+ request,
64
+ options,
65
+ ));
66
+ }
67
+
68
+ async function $do(
69
+ client$: ShippoSDKCore,
70
+ request: ValidateAddressV2Request,
71
+ options?: RequestOptions,
72
+ ): Promise<
73
+ [
74
+ Result<
75
+ ValidateAddressV2Response,
76
+ | APIError
77
+ | SDKValidationError
78
+ | UnexpectedClientError
79
+ | InvalidRequestError
80
+ | RequestAbortedError
81
+ | RequestTimeoutError
82
+ | ConnectionError
83
+ >,
84
+ APICall,
85
+ ]
86
+ > {
87
+ const parsed$ = safeParse(
88
+ request,
89
+ (value$) => ValidateAddressV2Request$zodSchema.parse(value$),
90
+ "Input validation failed",
91
+ );
92
+ if (!parsed$.ok) {
93
+ return [parsed$, { status: "invalid" }];
94
+ }
95
+ const payload$ = parsed$.value;
96
+ const body$ = null;
97
+ const path$ = pathToFunc("/v2/addresses/validate")();
98
+ const query$ = encodeFormQuery({
99
+ "address_line_1": payload$.address_line_1,
100
+ "address_line_2": payload$.address_line_2,
101
+ "city_locality": payload$.city_locality,
102
+ "country_code": payload$.country_code,
103
+ "name": payload$.name,
104
+ "organization": payload$.organization,
105
+ "postal_code": payload$.postal_code,
106
+ "state_province": payload$.state_province,
107
+ });
108
+
109
+ const headers$ = new Headers(compactMap({
110
+ Accept: "application/json",
111
+ "SHIPPO-API-VERSION": encodeSimple(
112
+ "SHIPPO-API-VERSION",
113
+ client$._options.shippoApiVersion,
114
+ { explode: false, charEncoding: "none" },
115
+ ),
116
+ }));
117
+ const securityInput = await extractSecurity(client$._options.security);
118
+ const requestSecurity = resolveGlobalSecurity(securityInput);
119
+
120
+ const context = {
121
+ options: client$._options,
122
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
123
+ operationID: "ValidateAddressV2",
124
+ oAuth2Scopes: null,
125
+ resolvedSecurity: requestSecurity,
126
+ securitySource: client$._options.security,
127
+ retryConfig: options?.retries
128
+ || client$._options.retryConfig
129
+ || { strategy: "none" },
130
+ retryCodes: options?.retryCodes || [
131
+ "429",
132
+ "500",
133
+ "502",
134
+ "503",
135
+ "504",
136
+ ],
137
+ };
138
+
139
+ const requestRes = client$._createRequest(context, {
140
+ security: requestSecurity,
141
+ method: "GET",
142
+ baseURL: options?.serverURL,
143
+ path: path$,
144
+ headers: headers$,
145
+ query: query$,
146
+ body: body$,
147
+ userAgent: client$._options.userAgent,
148
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs
149
+ || -1,
150
+ }, options);
151
+ if (!requestRes.ok) {
152
+ return [requestRes, { status: "invalid" }];
153
+ }
154
+ const req$ = requestRes.value;
155
+
156
+ const doResult = await client$._do(req$, {
157
+ context,
158
+ errorCodes: [],
159
+ retryConfig: context.retryConfig,
160
+ retryCodes: context.retryCodes,
161
+ });
162
+ if (!doResult.ok) {
163
+ return [doResult, { status: "request-error", request: req$ }];
164
+ }
165
+ const response = doResult.value;
166
+ const responseFields$ = {
167
+ HttpMeta: { Response: response, Request: req$ },
168
+ };
169
+
170
+ const [result$] = await M.match<
171
+ ValidateAddressV2Response,
172
+ | APIError
173
+ | SDKValidationError
174
+ | UnexpectedClientError
175
+ | InvalidRequestError
176
+ | RequestAbortedError
177
+ | RequestTimeoutError
178
+ | ConnectionError
179
+ >(
180
+ M.json(200, ValidateAddressV2Response$zodSchema, {
181
+ key: "AddressValidationResultV2",
182
+ }),
183
+ M.json(422, ValidateAddressV2Response$zodSchema, { key: "object" }),
184
+ M.nil("5XX", ValidateAddressV2Response$zodSchema),
185
+ )(response, req$, { extraFields: responseFields$ });
186
+
187
+ return [result$, { status: "complete", request: req$, response }];
188
+ }
package/src/lib/config.ts CHANGED
@@ -67,8 +67,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
67
67
  export const SDK_METADATA = {
68
68
  language: "typescript",
69
69
  openapiDocVersion: "2018-02-08",
70
- sdkVersion: "2.0.2",
70
+ sdkVersion: "2.0.8",
71
71
  genVersion: "2.788.5",
72
72
  userAgent:
73
- "speakeasy-sdk/mcp-typescript 2.0.2 2.788.5 2018-02-08 @shippo/shippo-mcp",
73
+ "speakeasy-sdk/mcp-typescript 2.0.8 2.788.5 2018-02-08 @shippo/shippo-mcp",
74
74
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "2.0.2",
22
+ currentVersion: "2.0.8",
23
23
  },
24
24
  });
25
25
 
@@ -13,10 +13,13 @@ import {
13
13
  } from "./resources.js";
14
14
  import { MCPScope } from "./scopes.js";
15
15
  import { createRegisterTool } from "./tools.js";
16
- import { tool$addressesCreate } from "./tools/addressesCreate.js";
16
+ import { tool$addressesCreateV1 } from "./tools/addressesCreateV1.js";
17
+ import { tool$addressesCreateV2 } from "./tools/addressesCreateV2.js";
17
18
  import { tool$addressesGet } from "./tools/addressesGet.js";
18
19
  import { tool$addressesList } from "./tools/addressesList.js";
20
+ import { tool$addressesParse } from "./tools/addressesParse.js";
19
21
  import { tool$addressesValidate } from "./tools/addressesValidate.js";
22
+ import { tool$addressesValidateV2 } from "./tools/addressesValidateV2.js";
20
23
  import { tool$batchesAddShipments } from "./tools/batchesAddShipments.js";
21
24
  import { tool$batchesCreate } from "./tools/batchesCreate.js";
22
25
  import { tool$batchesGet } from "./tools/batchesGet.js";
@@ -96,7 +99,7 @@ export function createMCPServer(deps: {
96
99
  }) {
97
100
  const server = new McpServer({
98
101
  name: "ShippoSDK",
99
- version: "2.0.2",
102
+ version: "2.0.8",
100
103
  });
101
104
 
102
105
  const getClient = deps.getSDK || (() =>
@@ -141,9 +144,12 @@ export function createMCPServer(deps: {
141
144
  void register; // suppress unused warnings
142
145
 
143
146
  tool(tool$addressesList);
144
- tool(tool$addressesCreate);
147
+ tool(tool$addressesCreateV1);
145
148
  tool(tool$addressesGet);
146
149
  tool(tool$addressesValidate);
150
+ tool(tool$addressesParse);
151
+ tool(tool$addressesValidateV2);
152
+ tool(tool$addressesCreateV2);
147
153
  tool(tool$batchesCreate);
148
154
  tool(tool$batchesGet);
149
155
  tool(tool$batchesAddShipments);
@@ -0,0 +1,58 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { addressesCreateV1 } from "../../funcs/addressesCreateV1.js";
6
+ import { AddressCreateRequest$zodSchema } from "../../models/addresscreaterequest.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: AddressCreateRequest$zodSchema,
11
+ };
12
+
13
+ export const tool$addressesCreateV1: ToolDefinition<typeof args> = {
14
+ name: "addresses-create-v1",
15
+ description:
16
+ `**DEPRECATED - Use \`addresses-create-v2\` instead for cleaner API format.**
17
+
18
+ This is the legacy v1 address creation endpoint. It uses different field names
19
+ (street1, city, state, zip) compared to the newer v2 format.
20
+
21
+ **Prefer \`addresses-create-v2\`** which uses standardized field names:
22
+ - \`address_line_1\` instead of \`street1\`
23
+ - \`city_locality\` instead of \`city\`
24
+ - \`state_province\` instead of \`state\`
25
+ - \`postal_code\` instead of \`zip\`
26
+
27
+ **For address validation, use \`addresses-validate-v2\`.**
28
+
29
+ Only use this tool if you specifically need v1 API compatibility.
30
+ `,
31
+ scopes: ["write"],
32
+ annotations: {
33
+ "title": "",
34
+ "destructiveHint": false,
35
+ "idempotentHint": false,
36
+ "openWorldHint": false,
37
+ "readOnlyHint": false,
38
+ },
39
+ args,
40
+ tool: async (client, args, ctx) => {
41
+ const [result, apiCall] = await addressesCreateV1(
42
+ client,
43
+ args.request,
44
+ { fetchOptions: { signal: ctx.signal } },
45
+ ).$inspect();
46
+
47
+ if (!result.ok) {
48
+ return {
49
+ content: [{ type: "text", text: result.error.message }],
50
+ isError: true,
51
+ };
52
+ }
53
+
54
+ const value = result.value;
55
+
56
+ return formatResult(value, apiCall);
57
+ },
58
+ };
@@ -0,0 +1,92 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { addressesCreateV2 } from "../../funcs/addressesCreateV2.js";
6
+ import { AddressCreateRequestV2$zodSchema } from "../../models/addresscreaterequestv2.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: AddressCreateRequestV2$zodSchema,
11
+ };
12
+
13
+ export const tool$addressesCreateV2: ToolDefinition<typeof args> = {
14
+ name: "addresses-create-v2",
15
+ description:
16
+ `**PRIMARY ADDRESS CREATION TOOL** - Use this tool to create and save address records.
17
+
18
+ This is the recommended v2 endpoint for creating addresses with a cleaner, standardized format.
19
+
20
+ **Required Fields:**
21
+ - \`name\`: The addressee's name (max 64 chars)
22
+ - \`address_line_1\`: Street address (1-100 chars)
23
+ - \`country_code\`: ISO 3166 country code (2 chars, e.g., "US")
24
+
25
+ **Optional Fields:**
26
+ - \`organization\`: Company/organization name
27
+ - \`email\`: Email address
28
+ - \`phone\`: Phone number
29
+ - \`address_line_2\`: Apt, suite, unit, etc.
30
+ - \`city_locality\`: City name
31
+ - \`state_province\`: State/province abbreviation
32
+ - \`postal_code\`: ZIP/postal code
33
+ - \`address_type\`: unknown, residential, commercial, po_box, military
34
+
35
+ **Example Request:**
36
+ \`\`\`json
37
+ {
38
+ "name": "Wilson",
39
+ "organization": "Shippo",
40
+ "email": "user@shippo.com",
41
+ "phone": "+1-4155550132",
42
+ "address_line_1": "731 Market Street",
43
+ "address_line_2": "#200",
44
+ "city_locality": "San Francisco",
45
+ "state_province": "CA",
46
+ "postal_code": "94103",
47
+ "country_code": "US",
48
+ "address_type": "commercial"
49
+ }
50
+ \`\`\`
51
+
52
+ **Response includes:**
53
+ - \`id\`: Unique address identifier for future reference
54
+ - \`address\`: The saved address data
55
+ - \`created_at\`/\`updated_at\`: Timestamps
56
+
57
+ **Use Cases:**
58
+ - Save addresses for reuse in shipments
59
+ - Build an address book
60
+ - Store customer shipping addresses
61
+
62
+ **For address validation, use \`addresses-validate-v2\`** which provides
63
+ confidence scores, geo coordinates, and recommended corrections.
64
+ `,
65
+ scopes: ["write"],
66
+ annotations: {
67
+ "title": "",
68
+ "destructiveHint": false,
69
+ "idempotentHint": false,
70
+ "openWorldHint": false,
71
+ "readOnlyHint": false,
72
+ },
73
+ args,
74
+ tool: async (client, args, ctx) => {
75
+ const [result, apiCall] = await addressesCreateV2(
76
+ client,
77
+ args.request,
78
+ { fetchOptions: { signal: ctx.signal } },
79
+ ).$inspect();
80
+
81
+ if (!result.ok) {
82
+ return {
83
+ content: [{ type: "text", text: result.error.message }],
84
+ isError: true,
85
+ };
86
+ }
87
+
88
+ const value = result.value;
89
+
90
+ return formatResult(value, apiCall);
91
+ },
92
+ };
@@ -0,0 +1,76 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { addressesParse } from "../../funcs/addressesParse.js";
6
+ import { ParseAddressRequest$zodSchema } from "../../models/parseaddressop.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: ParseAddressRequest$zodSchema,
11
+ };
12
+
13
+ export const tool$addressesParse: ToolDefinition<typeof args> = {
14
+ name: "addresses-parse",
15
+ description:
16
+ `**ADDRESS PARSER** - Converts an unstructured address string into a structured address object.
17
+
18
+ Use this tool when you have a single address string (like from customer input, emails,
19
+ or CSV imports) and need to parse it into structured components.
20
+
21
+ **Input Format Tips:**
22
+ - Use commas (,) as delimiters between address parts
23
+ - Follow this order: street address, city, state, postal code, country
24
+ - Phone and email can be anywhere in the string
25
+
26
+ **Example Input:**
27
+ "Shippo 731 Market St #200, San Francisco, CA 94103 US shippo@shippo.com +1-555-999-8888"
28
+
29
+ **Example Output:**
30
+ \`\`\`json
31
+ {
32
+ "address_line_1": "731 MARKET ST",
33
+ "address_line_2": "#200",
34
+ "city_locality": "SAN FRANCISCO",
35
+ "state_province": "CA",
36
+ "postal_code": "94103",
37
+ "country_code": "US",
38
+ "email": "shippo@shippo.com",
39
+ "phone": "+1-555-999-8888"
40
+ }
41
+ \`\`\`
42
+
43
+ **Use Cases:**
44
+ - Parse addresses from customer contact forms
45
+ - Extract structured data from email signatures
46
+ - Process bulk address imports
47
+ - Clean up poorly formatted address data
48
+ `,
49
+ scopes: ["read"],
50
+ annotations: {
51
+ "title": "",
52
+ "destructiveHint": false,
53
+ "idempotentHint": false,
54
+ "openWorldHint": false,
55
+ "readOnlyHint": false,
56
+ },
57
+ args,
58
+ tool: async (client, args, ctx) => {
59
+ const [result, apiCall] = await addressesParse(
60
+ client,
61
+ args.request,
62
+ { fetchOptions: { signal: ctx.signal } },
63
+ ).$inspect();
64
+
65
+ if (!result.ok) {
66
+ return {
67
+ content: [{ type: "text", text: result.error.message }],
68
+ isError: true,
69
+ };
70
+ }
71
+
72
+ const value = result.value;
73
+
74
+ return formatResult(value, apiCall);
75
+ },
76
+ };
@@ -13,10 +13,19 @@ const args = {
13
13
  export const tool$addressesValidate: ToolDefinition<typeof args> = {
14
14
  name: "addresses-validate-existing",
15
15
  description:
16
- `**SECONDARY VALIDATION TOOL** - Validates an already created address using its ID.
16
+ `**DEPRECATED - Use \`addresses-validate-v2\` instead for better validation results.**
17
17
 
18
- Use this tool only when you have an existing address ID and need to re-validate it.
19
- For new address validation, prefer the addresses-create tool with validate=true.
18
+ This v1 endpoint validates an already created address using its ID.
19
+ It only works on addresses that have been saved to Shippo's address book.
20
+
21
+ **Prefer \`addresses-validate-v2\`** which:
22
+ - Validates any address (no need to create first)
23
+ - Returns confidence scores (high/medium/low)
24
+ - Provides recommended address corrections
25
+ - Returns geo coordinates (latitude/longitude)
26
+ - Identifies residential vs commercial addresses
27
+
28
+ Only use this tool if you specifically need to re-validate an existing address record by ID.
20
29
  `,
21
30
  scopes: ["read", "validation"],
22
31
  annotations: {