@tryfinch/finch-api-mcp 6.31.0 → 8.0.0

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 (549) hide show
  1. package/README.md +46 -259
  2. package/code-tool-types.d.mts +16 -0
  3. package/code-tool-types.d.mts.map +1 -0
  4. package/code-tool-types.d.ts +16 -0
  5. package/code-tool-types.d.ts.map +1 -0
  6. package/code-tool-types.js +4 -0
  7. package/code-tool-types.js.map +1 -0
  8. package/code-tool-types.mjs +3 -0
  9. package/code-tool-types.mjs.map +1 -0
  10. package/code-tool.d.mts +12 -0
  11. package/code-tool.d.mts.map +1 -0
  12. package/code-tool.d.ts +12 -0
  13. package/code-tool.d.ts.map +1 -0
  14. package/code-tool.js +55 -0
  15. package/code-tool.js.map +1 -0
  16. package/code-tool.mjs +52 -0
  17. package/code-tool.mjs.map +1 -0
  18. package/docs-search-tool.d.mts +50 -0
  19. package/docs-search-tool.d.mts.map +1 -0
  20. package/docs-search-tool.d.ts +50 -0
  21. package/docs-search-tool.d.ts.map +1 -0
  22. package/docs-search-tool.js +51 -0
  23. package/docs-search-tool.js.map +1 -0
  24. package/docs-search-tool.mjs +47 -0
  25. package/docs-search-tool.mjs.map +1 -0
  26. package/headers.d.mts +4 -0
  27. package/headers.d.mts.map +1 -0
  28. package/headers.d.ts +4 -0
  29. package/headers.d.ts.map +1 -0
  30. package/headers.js +31 -0
  31. package/headers.js.map +1 -0
  32. package/headers.mjs +27 -0
  33. package/headers.mjs.map +1 -0
  34. package/http.d.mts +9 -0
  35. package/http.d.mts.map +1 -0
  36. package/http.d.ts +9 -0
  37. package/http.d.ts.map +1 -0
  38. package/http.js +91 -0
  39. package/http.js.map +1 -0
  40. package/http.mjs +83 -0
  41. package/http.mjs.map +1 -0
  42. package/index.d.mts +1 -0
  43. package/index.d.ts +1 -0
  44. package/index.js +14 -45
  45. package/index.js.map +1 -1
  46. package/index.mjs +17 -47
  47. package/index.mjs.map +1 -1
  48. package/options.d.mts +10 -10
  49. package/options.d.mts.map +1 -1
  50. package/options.d.ts +10 -10
  51. package/options.d.ts.map +1 -1
  52. package/options.js +42 -307
  53. package/options.js.map +1 -1
  54. package/options.mjs +40 -306
  55. package/options.mjs.map +1 -1
  56. package/package.json +121 -12
  57. package/server.d.mts +11 -19
  58. package/server.d.mts.map +1 -1
  59. package/server.d.ts +11 -19
  60. package/server.d.ts.map +1 -1
  61. package/server.js +67 -49
  62. package/server.js.map +1 -1
  63. package/server.mjs +65 -47
  64. package/server.mjs.map +1 -1
  65. package/src/code-tool-types.ts +18 -0
  66. package/src/code-tool.ts +65 -0
  67. package/src/docs-search-tool.ts +59 -0
  68. package/src/headers.ts +35 -0
  69. package/src/http.ts +109 -0
  70. package/src/index.ts +21 -62
  71. package/src/options.ts +57 -326
  72. package/src/server.ts +85 -65
  73. package/src/stdio.ts +12 -0
  74. package/src/types.ts +115 -0
  75. package/stdio.d.mts +2 -0
  76. package/stdio.d.mts.map +1 -0
  77. package/stdio.d.ts +2 -0
  78. package/stdio.d.ts.map +1 -0
  79. package/stdio.js +14 -0
  80. package/stdio.js.map +1 -0
  81. package/stdio.mjs +10 -0
  82. package/stdio.mjs.map +1 -0
  83. package/types.d.mts +52 -0
  84. package/types.d.mts.map +1 -0
  85. package/types.d.ts +52 -0
  86. package/types.d.ts.map +1 -0
  87. package/types.js +58 -0
  88. package/types.js.map +1 -0
  89. package/types.mjs +53 -0
  90. package/types.mjs.map +1 -0
  91. package/compat.d.mts +0 -52
  92. package/compat.d.mts.map +0 -1
  93. package/compat.d.ts +0 -52
  94. package/compat.d.ts.map +0 -1
  95. package/compat.js +0 -342
  96. package/compat.js.map +0 -1
  97. package/compat.mjs +0 -332
  98. package/compat.mjs.map +0 -1
  99. package/dynamic-tools.d.mts +0 -12
  100. package/dynamic-tools.d.mts.map +0 -1
  101. package/dynamic-tools.d.ts +0 -12
  102. package/dynamic-tools.d.ts.map +0 -1
  103. package/dynamic-tools.js +0 -133
  104. package/dynamic-tools.js.map +0 -1
  105. package/dynamic-tools.mjs +0 -130
  106. package/dynamic-tools.mjs.map +0 -1
  107. package/src/compat.ts +0 -429
  108. package/src/dynamic-tools.ts +0 -152
  109. package/src/tools/access-tokens/create-access-tokens.ts +0 -40
  110. package/src/tools/account/disconnect-account.ts +0 -26
  111. package/src/tools/account/introspect-account.ts +0 -26
  112. package/src/tools/connect/sessions/new-connect-sessions.ts +0 -83
  113. package/src/tools/connect/sessions/reauthenticate-connect-sessions.ts +0 -60
  114. package/src/tools/hris/benefits/create-hris-benefits.ts +0 -102
  115. package/src/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.ts +0 -101
  116. package/src/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.ts +0 -31
  117. package/src/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.ts +0 -36
  118. package/src/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.ts +0 -38
  119. package/src/tools/hris/benefits/list-hris-benefits.ts +0 -26
  120. package/src/tools/hris/benefits/list-supported-benefits-hris-benefits.ts +0 -26
  121. package/src/tools/hris/benefits/retrieve-hris-benefits.ts +0 -31
  122. package/src/tools/hris/benefits/update-hris-benefits.ts +0 -35
  123. package/src/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.ts +0 -58
  124. package/src/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.ts +0 -78
  125. package/src/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.ts +0 -32
  126. package/src/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.ts +0 -27
  127. package/src/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.ts +0 -35
  128. package/src/tools/hris/company/retrieve-hris-company.ts +0 -26
  129. package/src/tools/hris/directory/list-hris-directory.ts +0 -36
  130. package/src/tools/hris/directory/list-individuals-hris-directory.ts +0 -36
  131. package/src/tools/hris/documents/list-hris-documents.ts +0 -53
  132. package/src/tools/hris/documents/retreive-hris-documents.ts +0 -32
  133. package/src/tools/hris/employments/retrieve-many-hris-employments.ts +0 -43
  134. package/src/tools/hris/individuals/retrieve-many-hris-individuals.ts +0 -52
  135. package/src/tools/hris/pay-statements/retrieve-many-hris-pay-statements.ts +0 -51
  136. package/src/tools/hris/payments/list-hris-payments.ts +0 -38
  137. package/src/tools/index.ts +0 -175
  138. package/src/tools/jobs/automated/create-jobs-automated.ts +0 -59
  139. package/src/tools/jobs/automated/list-jobs-automated.ts +0 -37
  140. package/src/tools/jobs/automated/retrieve-jobs-automated.ts +0 -31
  141. package/src/tools/jobs/manual/retrieve-jobs-manual.ts +0 -32
  142. package/src/tools/payroll/pay-groups/list-payroll-pay-groups.ts +0 -37
  143. package/src/tools/payroll/pay-groups/retrieve-payroll-pay-groups.ts +0 -31
  144. package/src/tools/providers/list-providers.ts +0 -26
  145. package/src/tools/request-forwarding/forward-request-forwarding.ts +0 -54
  146. package/src/tools/sandbox/company/update-sandbox-company.ts +0 -164
  147. package/src/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.ts +0 -48
  148. package/src/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.ts +0 -39
  149. package/src/tools/sandbox/connections/create-sandbox-connections.ts +0 -48
  150. package/src/tools/sandbox/directory/create-sandbox-directory.ts +0 -303
  151. package/src/tools/sandbox/employment/update-sandbox-employment.ts +0 -223
  152. package/src/tools/sandbox/individual/update-sandbox-individual.ts +0 -154
  153. package/src/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.ts +0 -26
  154. package/src/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.ts +0 -36
  155. package/src/tools/sandbox/jobs/create-sandbox-jobs.ts +0 -33
  156. package/src/tools/sandbox/payment/create-sandbox-payment.ts +0 -308
  157. package/src/tools.ts +0 -1
  158. package/tools/access-tokens/create-access-tokens.d.mts +0 -32
  159. package/tools/access-tokens/create-access-tokens.d.mts.map +0 -1
  160. package/tools/access-tokens/create-access-tokens.d.ts +0 -32
  161. package/tools/access-tokens/create-access-tokens.d.ts.map +0 -1
  162. package/tools/access-tokens/create-access-tokens.js +0 -37
  163. package/tools/access-tokens/create-access-tokens.js.map +0 -1
  164. package/tools/access-tokens/create-access-tokens.mjs +0 -33
  165. package/tools/access-tokens/create-access-tokens.mjs.map +0 -1
  166. package/tools/account/disconnect-account.d.mts +0 -32
  167. package/tools/account/disconnect-account.d.mts.map +0 -1
  168. package/tools/account/disconnect-account.d.ts +0 -32
  169. package/tools/account/disconnect-account.d.ts.map +0 -1
  170. package/tools/account/disconnect-account.js +0 -23
  171. package/tools/account/disconnect-account.js.map +0 -1
  172. package/tools/account/disconnect-account.mjs +0 -19
  173. package/tools/account/disconnect-account.mjs.map +0 -1
  174. package/tools/account/introspect-account.d.mts +0 -32
  175. package/tools/account/introspect-account.d.mts.map +0 -1
  176. package/tools/account/introspect-account.d.ts +0 -32
  177. package/tools/account/introspect-account.d.ts.map +0 -1
  178. package/tools/account/introspect-account.js +0 -23
  179. package/tools/account/introspect-account.js.map +0 -1
  180. package/tools/account/introspect-account.mjs +0 -19
  181. package/tools/account/introspect-account.mjs.map +0 -1
  182. package/tools/connect/sessions/new-connect-sessions.d.mts +0 -32
  183. package/tools/connect/sessions/new-connect-sessions.d.mts.map +0 -1
  184. package/tools/connect/sessions/new-connect-sessions.d.ts +0 -32
  185. package/tools/connect/sessions/new-connect-sessions.d.ts.map +0 -1
  186. package/tools/connect/sessions/new-connect-sessions.js +0 -80
  187. package/tools/connect/sessions/new-connect-sessions.js.map +0 -1
  188. package/tools/connect/sessions/new-connect-sessions.mjs +0 -76
  189. package/tools/connect/sessions/new-connect-sessions.mjs.map +0 -1
  190. package/tools/connect/sessions/reauthenticate-connect-sessions.d.mts +0 -32
  191. package/tools/connect/sessions/reauthenticate-connect-sessions.d.mts.map +0 -1
  192. package/tools/connect/sessions/reauthenticate-connect-sessions.d.ts +0 -32
  193. package/tools/connect/sessions/reauthenticate-connect-sessions.d.ts.map +0 -1
  194. package/tools/connect/sessions/reauthenticate-connect-sessions.js +0 -57
  195. package/tools/connect/sessions/reauthenticate-connect-sessions.js.map +0 -1
  196. package/tools/connect/sessions/reauthenticate-connect-sessions.mjs +0 -53
  197. package/tools/connect/sessions/reauthenticate-connect-sessions.mjs.map +0 -1
  198. package/tools/hris/benefits/create-hris-benefits.d.mts +0 -32
  199. package/tools/hris/benefits/create-hris-benefits.d.mts.map +0 -1
  200. package/tools/hris/benefits/create-hris-benefits.d.ts +0 -32
  201. package/tools/hris/benefits/create-hris-benefits.d.ts.map +0 -1
  202. package/tools/hris/benefits/create-hris-benefits.js +0 -97
  203. package/tools/hris/benefits/create-hris-benefits.js.map +0 -1
  204. package/tools/hris/benefits/create-hris-benefits.mjs +0 -93
  205. package/tools/hris/benefits/create-hris-benefits.mjs.map +0 -1
  206. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.mts +0 -32
  207. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.mts.map +0 -1
  208. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.ts +0 -32
  209. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.ts.map +0 -1
  210. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.js +0 -94
  211. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.js.map +0 -1
  212. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.mjs +0 -90
  213. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.mjs.map +0 -1
  214. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.mts +0 -32
  215. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.mts.map +0 -1
  216. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.ts +0 -32
  217. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.ts.map +0 -1
  218. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.js +0 -28
  219. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.js.map +0 -1
  220. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.mjs +0 -24
  221. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.mjs.map +0 -1
  222. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.mts +0 -32
  223. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.mts.map +0 -1
  224. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.ts +0 -32
  225. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.ts.map +0 -1
  226. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.js +0 -32
  227. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.js.map +0 -1
  228. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.mjs +0 -28
  229. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.mjs.map +0 -1
  230. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.mts +0 -32
  231. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.mts.map +0 -1
  232. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.ts +0 -32
  233. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.ts.map +0 -1
  234. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.js +0 -35
  235. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.js.map +0 -1
  236. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.mjs +0 -31
  237. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.mjs.map +0 -1
  238. package/tools/hris/benefits/list-hris-benefits.d.mts +0 -32
  239. package/tools/hris/benefits/list-hris-benefits.d.mts.map +0 -1
  240. package/tools/hris/benefits/list-hris-benefits.d.ts +0 -32
  241. package/tools/hris/benefits/list-hris-benefits.d.ts.map +0 -1
  242. package/tools/hris/benefits/list-hris-benefits.js +0 -23
  243. package/tools/hris/benefits/list-hris-benefits.js.map +0 -1
  244. package/tools/hris/benefits/list-hris-benefits.mjs +0 -19
  245. package/tools/hris/benefits/list-hris-benefits.mjs.map +0 -1
  246. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.mts +0 -32
  247. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.mts.map +0 -1
  248. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.ts +0 -32
  249. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.ts.map +0 -1
  250. package/tools/hris/benefits/list-supported-benefits-hris-benefits.js +0 -23
  251. package/tools/hris/benefits/list-supported-benefits-hris-benefits.js.map +0 -1
  252. package/tools/hris/benefits/list-supported-benefits-hris-benefits.mjs +0 -19
  253. package/tools/hris/benefits/list-supported-benefits-hris-benefits.mjs.map +0 -1
  254. package/tools/hris/benefits/retrieve-hris-benefits.d.mts +0 -32
  255. package/tools/hris/benefits/retrieve-hris-benefits.d.mts.map +0 -1
  256. package/tools/hris/benefits/retrieve-hris-benefits.d.ts +0 -32
  257. package/tools/hris/benefits/retrieve-hris-benefits.d.ts.map +0 -1
  258. package/tools/hris/benefits/retrieve-hris-benefits.js +0 -28
  259. package/tools/hris/benefits/retrieve-hris-benefits.js.map +0 -1
  260. package/tools/hris/benefits/retrieve-hris-benefits.mjs +0 -24
  261. package/tools/hris/benefits/retrieve-hris-benefits.mjs.map +0 -1
  262. package/tools/hris/benefits/update-hris-benefits.d.mts +0 -32
  263. package/tools/hris/benefits/update-hris-benefits.d.mts.map +0 -1
  264. package/tools/hris/benefits/update-hris-benefits.d.ts +0 -32
  265. package/tools/hris/benefits/update-hris-benefits.d.ts.map +0 -1
  266. package/tools/hris/benefits/update-hris-benefits.js +0 -32
  267. package/tools/hris/benefits/update-hris-benefits.js.map +0 -1
  268. package/tools/hris/benefits/update-hris-benefits.mjs +0 -28
  269. package/tools/hris/benefits/update-hris-benefits.mjs.map +0 -1
  270. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.mts +0 -32
  271. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.mts.map +0 -1
  272. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.ts +0 -32
  273. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.ts.map +0 -1
  274. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.js +0 -51
  275. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.js.map +0 -1
  276. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.mjs +0 -47
  277. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.mjs.map +0 -1
  278. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.mts +0 -32
  279. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.mts.map +0 -1
  280. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.ts +0 -32
  281. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.ts.map +0 -1
  282. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.js +0 -73
  283. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.js.map +0 -1
  284. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.mjs +0 -69
  285. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.mjs.map +0 -1
  286. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.mts +0 -32
  287. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.mts.map +0 -1
  288. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.ts +0 -32
  289. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.ts.map +0 -1
  290. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.js +0 -28
  291. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.js.map +0 -1
  292. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.mjs +0 -24
  293. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.mjs.map +0 -1
  294. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.mts +0 -32
  295. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.mts.map +0 -1
  296. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.ts +0 -32
  297. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.ts.map +0 -1
  298. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.js +0 -23
  299. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.js.map +0 -1
  300. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.mjs +0 -19
  301. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.mjs.map +0 -1
  302. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.mts +0 -32
  303. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.mts.map +0 -1
  304. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.ts +0 -32
  305. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.ts.map +0 -1
  306. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.js +0 -31
  307. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.js.map +0 -1
  308. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.mjs +0 -27
  309. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.mjs.map +0 -1
  310. package/tools/hris/company/retrieve-hris-company.d.mts +0 -32
  311. package/tools/hris/company/retrieve-hris-company.d.mts.map +0 -1
  312. package/tools/hris/company/retrieve-hris-company.d.ts +0 -32
  313. package/tools/hris/company/retrieve-hris-company.d.ts.map +0 -1
  314. package/tools/hris/company/retrieve-hris-company.js +0 -23
  315. package/tools/hris/company/retrieve-hris-company.js.map +0 -1
  316. package/tools/hris/company/retrieve-hris-company.mjs +0 -19
  317. package/tools/hris/company/retrieve-hris-company.mjs.map +0 -1
  318. package/tools/hris/directory/list-hris-directory.d.mts +0 -32
  319. package/tools/hris/directory/list-hris-directory.d.mts.map +0 -1
  320. package/tools/hris/directory/list-hris-directory.d.ts +0 -32
  321. package/tools/hris/directory/list-hris-directory.d.ts.map +0 -1
  322. package/tools/hris/directory/list-hris-directory.js +0 -33
  323. package/tools/hris/directory/list-hris-directory.js.map +0 -1
  324. package/tools/hris/directory/list-hris-directory.mjs +0 -29
  325. package/tools/hris/directory/list-hris-directory.mjs.map +0 -1
  326. package/tools/hris/directory/list-individuals-hris-directory.d.mts +0 -32
  327. package/tools/hris/directory/list-individuals-hris-directory.d.mts.map +0 -1
  328. package/tools/hris/directory/list-individuals-hris-directory.d.ts +0 -32
  329. package/tools/hris/directory/list-individuals-hris-directory.d.ts.map +0 -1
  330. package/tools/hris/directory/list-individuals-hris-directory.js +0 -33
  331. package/tools/hris/directory/list-individuals-hris-directory.js.map +0 -1
  332. package/tools/hris/directory/list-individuals-hris-directory.mjs +0 -29
  333. package/tools/hris/directory/list-individuals-hris-directory.mjs.map +0 -1
  334. package/tools/hris/documents/list-hris-documents.d.mts +0 -32
  335. package/tools/hris/documents/list-hris-documents.d.mts.map +0 -1
  336. package/tools/hris/documents/list-hris-documents.d.ts +0 -32
  337. package/tools/hris/documents/list-hris-documents.d.ts.map +0 -1
  338. package/tools/hris/documents/list-hris-documents.js +0 -48
  339. package/tools/hris/documents/list-hris-documents.js.map +0 -1
  340. package/tools/hris/documents/list-hris-documents.mjs +0 -44
  341. package/tools/hris/documents/list-hris-documents.mjs.map +0 -1
  342. package/tools/hris/documents/retreive-hris-documents.d.mts +0 -32
  343. package/tools/hris/documents/retreive-hris-documents.d.mts.map +0 -1
  344. package/tools/hris/documents/retreive-hris-documents.d.ts +0 -32
  345. package/tools/hris/documents/retreive-hris-documents.d.ts.map +0 -1
  346. package/tools/hris/documents/retreive-hris-documents.js +0 -28
  347. package/tools/hris/documents/retreive-hris-documents.js.map +0 -1
  348. package/tools/hris/documents/retreive-hris-documents.mjs +0 -24
  349. package/tools/hris/documents/retreive-hris-documents.mjs.map +0 -1
  350. package/tools/hris/employments/retrieve-many-hris-employments.d.mts +0 -32
  351. package/tools/hris/employments/retrieve-many-hris-employments.d.mts.map +0 -1
  352. package/tools/hris/employments/retrieve-many-hris-employments.d.ts +0 -32
  353. package/tools/hris/employments/retrieve-many-hris-employments.d.ts.map +0 -1
  354. package/tools/hris/employments/retrieve-many-hris-employments.js +0 -39
  355. package/tools/hris/employments/retrieve-many-hris-employments.js.map +0 -1
  356. package/tools/hris/employments/retrieve-many-hris-employments.mjs +0 -35
  357. package/tools/hris/employments/retrieve-many-hris-employments.mjs.map +0 -1
  358. package/tools/hris/individuals/retrieve-many-hris-individuals.d.mts +0 -32
  359. package/tools/hris/individuals/retrieve-many-hris-individuals.d.mts.map +0 -1
  360. package/tools/hris/individuals/retrieve-many-hris-individuals.d.ts +0 -32
  361. package/tools/hris/individuals/retrieve-many-hris-individuals.d.ts.map +0 -1
  362. package/tools/hris/individuals/retrieve-many-hris-individuals.js +0 -49
  363. package/tools/hris/individuals/retrieve-many-hris-individuals.js.map +0 -1
  364. package/tools/hris/individuals/retrieve-many-hris-individuals.mjs +0 -45
  365. package/tools/hris/individuals/retrieve-many-hris-individuals.mjs.map +0 -1
  366. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.mts +0 -32
  367. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.mts.map +0 -1
  368. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.ts +0 -32
  369. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.ts.map +0 -1
  370. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.js +0 -47
  371. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.js.map +0 -1
  372. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.mjs +0 -43
  373. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.mjs.map +0 -1
  374. package/tools/hris/payments/list-hris-payments.d.mts +0 -32
  375. package/tools/hris/payments/list-hris-payments.d.mts.map +0 -1
  376. package/tools/hris/payments/list-hris-payments.d.ts +0 -32
  377. package/tools/hris/payments/list-hris-payments.d.ts.map +0 -1
  378. package/tools/hris/payments/list-hris-payments.js +0 -35
  379. package/tools/hris/payments/list-hris-payments.js.map +0 -1
  380. package/tools/hris/payments/list-hris-payments.mjs +0 -31
  381. package/tools/hris/payments/list-hris-payments.mjs.map +0 -1
  382. package/tools/index.d.mts +0 -21
  383. package/tools/index.d.mts.map +0 -1
  384. package/tools/index.d.ts +0 -21
  385. package/tools/index.d.ts.map +0 -1
  386. package/tools/index.js +0 -146
  387. package/tools/index.js.map +0 -1
  388. package/tools/index.mjs +0 -139
  389. package/tools/index.mjs.map +0 -1
  390. package/tools/jobs/automated/create-jobs-automated.d.mts +0 -32
  391. package/tools/jobs/automated/create-jobs-automated.d.mts.map +0 -1
  392. package/tools/jobs/automated/create-jobs-automated.d.ts +0 -32
  393. package/tools/jobs/automated/create-jobs-automated.d.ts.map +0 -1
  394. package/tools/jobs/automated/create-jobs-automated.js +0 -55
  395. package/tools/jobs/automated/create-jobs-automated.js.map +0 -1
  396. package/tools/jobs/automated/create-jobs-automated.mjs +0 -51
  397. package/tools/jobs/automated/create-jobs-automated.mjs.map +0 -1
  398. package/tools/jobs/automated/list-jobs-automated.d.mts +0 -32
  399. package/tools/jobs/automated/list-jobs-automated.d.mts.map +0 -1
  400. package/tools/jobs/automated/list-jobs-automated.d.ts +0 -32
  401. package/tools/jobs/automated/list-jobs-automated.d.ts.map +0 -1
  402. package/tools/jobs/automated/list-jobs-automated.js +0 -33
  403. package/tools/jobs/automated/list-jobs-automated.js.map +0 -1
  404. package/tools/jobs/automated/list-jobs-automated.mjs +0 -29
  405. package/tools/jobs/automated/list-jobs-automated.mjs.map +0 -1
  406. package/tools/jobs/automated/retrieve-jobs-automated.d.mts +0 -32
  407. package/tools/jobs/automated/retrieve-jobs-automated.d.mts.map +0 -1
  408. package/tools/jobs/automated/retrieve-jobs-automated.d.ts +0 -32
  409. package/tools/jobs/automated/retrieve-jobs-automated.d.ts.map +0 -1
  410. package/tools/jobs/automated/retrieve-jobs-automated.js +0 -28
  411. package/tools/jobs/automated/retrieve-jobs-automated.js.map +0 -1
  412. package/tools/jobs/automated/retrieve-jobs-automated.mjs +0 -24
  413. package/tools/jobs/automated/retrieve-jobs-automated.mjs.map +0 -1
  414. package/tools/jobs/manual/retrieve-jobs-manual.d.mts +0 -32
  415. package/tools/jobs/manual/retrieve-jobs-manual.d.mts.map +0 -1
  416. package/tools/jobs/manual/retrieve-jobs-manual.d.ts +0 -32
  417. package/tools/jobs/manual/retrieve-jobs-manual.d.ts.map +0 -1
  418. package/tools/jobs/manual/retrieve-jobs-manual.js +0 -28
  419. package/tools/jobs/manual/retrieve-jobs-manual.js.map +0 -1
  420. package/tools/jobs/manual/retrieve-jobs-manual.mjs +0 -24
  421. package/tools/jobs/manual/retrieve-jobs-manual.mjs.map +0 -1
  422. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.mts +0 -32
  423. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.mts.map +0 -1
  424. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.ts +0 -32
  425. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.ts.map +0 -1
  426. package/tools/payroll/pay-groups/list-payroll-pay-groups.js +0 -34
  427. package/tools/payroll/pay-groups/list-payroll-pay-groups.js.map +0 -1
  428. package/tools/payroll/pay-groups/list-payroll-pay-groups.mjs +0 -30
  429. package/tools/payroll/pay-groups/list-payroll-pay-groups.mjs.map +0 -1
  430. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.mts +0 -32
  431. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.mts.map +0 -1
  432. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.ts +0 -32
  433. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.ts.map +0 -1
  434. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.js +0 -28
  435. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.js.map +0 -1
  436. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.mjs +0 -24
  437. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.mjs.map +0 -1
  438. package/tools/providers/list-providers.d.mts +0 -32
  439. package/tools/providers/list-providers.d.mts.map +0 -1
  440. package/tools/providers/list-providers.d.ts +0 -32
  441. package/tools/providers/list-providers.d.ts.map +0 -1
  442. package/tools/providers/list-providers.js +0 -23
  443. package/tools/providers/list-providers.js.map +0 -1
  444. package/tools/providers/list-providers.mjs +0 -19
  445. package/tools/providers/list-providers.mjs.map +0 -1
  446. package/tools/request-forwarding/forward-request-forwarding.d.mts +0 -32
  447. package/tools/request-forwarding/forward-request-forwarding.d.mts.map +0 -1
  448. package/tools/request-forwarding/forward-request-forwarding.d.ts +0 -32
  449. package/tools/request-forwarding/forward-request-forwarding.d.ts.map +0 -1
  450. package/tools/request-forwarding/forward-request-forwarding.js +0 -45
  451. package/tools/request-forwarding/forward-request-forwarding.js.map +0 -1
  452. package/tools/request-forwarding/forward-request-forwarding.mjs +0 -41
  453. package/tools/request-forwarding/forward-request-forwarding.mjs.map +0 -1
  454. package/tools/sandbox/company/update-sandbox-company.d.mts +0 -32
  455. package/tools/sandbox/company/update-sandbox-company.d.mts.map +0 -1
  456. package/tools/sandbox/company/update-sandbox-company.d.ts +0 -32
  457. package/tools/sandbox/company/update-sandbox-company.d.ts.map +0 -1
  458. package/tools/sandbox/company/update-sandbox-company.js +0 -159
  459. package/tools/sandbox/company/update-sandbox-company.js.map +0 -1
  460. package/tools/sandbox/company/update-sandbox-company.mjs +0 -155
  461. package/tools/sandbox/company/update-sandbox-company.mjs.map +0 -1
  462. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.mts +0 -32
  463. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.mts.map +0 -1
  464. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.ts +0 -32
  465. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.ts.map +0 -1
  466. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.js +0 -44
  467. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.js.map +0 -1
  468. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.mjs +0 -40
  469. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.mjs.map +0 -1
  470. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.mts +0 -32
  471. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.mts.map +0 -1
  472. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.ts +0 -32
  473. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.ts.map +0 -1
  474. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.js +0 -35
  475. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.js.map +0 -1
  476. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.mjs +0 -31
  477. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.mjs.map +0 -1
  478. package/tools/sandbox/connections/create-sandbox-connections.d.mts +0 -32
  479. package/tools/sandbox/connections/create-sandbox-connections.d.mts.map +0 -1
  480. package/tools/sandbox/connections/create-sandbox-connections.d.ts +0 -32
  481. package/tools/sandbox/connections/create-sandbox-connections.d.ts.map +0 -1
  482. package/tools/sandbox/connections/create-sandbox-connections.js +0 -44
  483. package/tools/sandbox/connections/create-sandbox-connections.js.map +0 -1
  484. package/tools/sandbox/connections/create-sandbox-connections.mjs +0 -40
  485. package/tools/sandbox/connections/create-sandbox-connections.mjs.map +0 -1
  486. package/tools/sandbox/directory/create-sandbox-directory.d.mts +0 -32
  487. package/tools/sandbox/directory/create-sandbox-directory.d.mts.map +0 -1
  488. package/tools/sandbox/directory/create-sandbox-directory.d.ts +0 -32
  489. package/tools/sandbox/directory/create-sandbox-directory.d.ts.map +0 -1
  490. package/tools/sandbox/directory/create-sandbox-directory.js +0 -292
  491. package/tools/sandbox/directory/create-sandbox-directory.js.map +0 -1
  492. package/tools/sandbox/directory/create-sandbox-directory.mjs +0 -288
  493. package/tools/sandbox/directory/create-sandbox-directory.mjs.map +0 -1
  494. package/tools/sandbox/employment/update-sandbox-employment.d.mts +0 -32
  495. package/tools/sandbox/employment/update-sandbox-employment.d.mts.map +0 -1
  496. package/tools/sandbox/employment/update-sandbox-employment.d.ts +0 -32
  497. package/tools/sandbox/employment/update-sandbox-employment.d.ts.map +0 -1
  498. package/tools/sandbox/employment/update-sandbox-employment.js +0 -215
  499. package/tools/sandbox/employment/update-sandbox-employment.js.map +0 -1
  500. package/tools/sandbox/employment/update-sandbox-employment.mjs +0 -211
  501. package/tools/sandbox/employment/update-sandbox-employment.mjs.map +0 -1
  502. package/tools/sandbox/individual/update-sandbox-individual.d.mts +0 -32
  503. package/tools/sandbox/individual/update-sandbox-individual.d.mts.map +0 -1
  504. package/tools/sandbox/individual/update-sandbox-individual.d.ts +0 -32
  505. package/tools/sandbox/individual/update-sandbox-individual.d.ts.map +0 -1
  506. package/tools/sandbox/individual/update-sandbox-individual.js +0 -149
  507. package/tools/sandbox/individual/update-sandbox-individual.js.map +0 -1
  508. package/tools/sandbox/individual/update-sandbox-individual.mjs +0 -145
  509. package/tools/sandbox/individual/update-sandbox-individual.mjs.map +0 -1
  510. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.mts +0 -32
  511. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.mts.map +0 -1
  512. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.ts +0 -32
  513. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.ts.map +0 -1
  514. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.js +0 -23
  515. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.js.map +0 -1
  516. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.mjs +0 -19
  517. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.mjs.map +0 -1
  518. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.mts +0 -32
  519. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.mts.map +0 -1
  520. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.ts +0 -32
  521. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.ts.map +0 -1
  522. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.js +0 -33
  523. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.js.map +0 -1
  524. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.mjs +0 -29
  525. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.mjs.map +0 -1
  526. package/tools/sandbox/jobs/create-sandbox-jobs.d.mts +0 -32
  527. package/tools/sandbox/jobs/create-sandbox-jobs.d.mts.map +0 -1
  528. package/tools/sandbox/jobs/create-sandbox-jobs.d.ts +0 -32
  529. package/tools/sandbox/jobs/create-sandbox-jobs.d.ts.map +0 -1
  530. package/tools/sandbox/jobs/create-sandbox-jobs.js +0 -30
  531. package/tools/sandbox/jobs/create-sandbox-jobs.js.map +0 -1
  532. package/tools/sandbox/jobs/create-sandbox-jobs.mjs +0 -26
  533. package/tools/sandbox/jobs/create-sandbox-jobs.mjs.map +0 -1
  534. package/tools/sandbox/payment/create-sandbox-payment.d.mts +0 -32
  535. package/tools/sandbox/payment/create-sandbox-payment.d.mts.map +0 -1
  536. package/tools/sandbox/payment/create-sandbox-payment.d.ts +0 -32
  537. package/tools/sandbox/payment/create-sandbox-payment.d.ts.map +0 -1
  538. package/tools/sandbox/payment/create-sandbox-payment.js +0 -300
  539. package/tools/sandbox/payment/create-sandbox-payment.js.map +0 -1
  540. package/tools/sandbox/payment/create-sandbox-payment.mjs +0 -296
  541. package/tools/sandbox/payment/create-sandbox-payment.mjs.map +0 -1
  542. package/tools.d.mts +0 -2
  543. package/tools.d.mts.map +0 -1
  544. package/tools.d.ts +0 -2
  545. package/tools.d.ts.map +0 -1
  546. package/tools.js +0 -18
  547. package/tools.js.map +0 -1
  548. package/tools.mjs +0 -2
  549. package/tools.mjs.map +0 -1
package/src/compat.ts DELETED
@@ -1,429 +0,0 @@
1
- import { Tool } from '@modelcontextprotocol/sdk/types.js';
2
- import { Endpoint } from './tools';
3
-
4
- export interface ClientCapabilities {
5
- topLevelUnions: boolean;
6
- validJson: boolean;
7
- refs: boolean;
8
- unions: boolean;
9
- formats: boolean;
10
- toolNameLength: number | undefined;
11
- }
12
-
13
- export const defaultClientCapabilities: ClientCapabilities = {
14
- topLevelUnions: true,
15
- validJson: true,
16
- refs: true,
17
- unions: true,
18
- formats: true,
19
- toolNameLength: undefined,
20
- };
21
-
22
- /**
23
- * Attempts to parse strings into JSON objects
24
- */
25
- export function parseEmbeddedJSON(args: Record<string, unknown>, schema: Record<string, unknown>) {
26
- let updated = false;
27
- const newArgs: Record<string, unknown> = Object.assign({}, args);
28
-
29
- for (const [key, value] of Object.entries(newArgs)) {
30
- if (typeof value === 'string') {
31
- try {
32
- const parsed = JSON.parse(value);
33
- newArgs[key] = parsed;
34
- updated = true;
35
- } catch (e) {
36
- // Not valid JSON, leave as is
37
- }
38
- }
39
- }
40
-
41
- if (updated) {
42
- return newArgs;
43
- }
44
-
45
- return args;
46
- }
47
-
48
- export type JSONSchema = {
49
- type?: string;
50
- properties?: Record<string, JSONSchema>;
51
- required?: string[];
52
- anyOf?: JSONSchema[];
53
- $ref?: string;
54
- $defs?: Record<string, JSONSchema>;
55
- [key: string]: any;
56
- };
57
-
58
- /**
59
- * Truncates tool names to the specified length while ensuring uniqueness.
60
- * If truncation would cause duplicate names, appends a number to make them unique.
61
- */
62
- export function truncateToolNames(names: string[], maxLength: number): Map<string, string> {
63
- if (maxLength <= 0) {
64
- return new Map();
65
- }
66
-
67
- const renameMap = new Map<string, string>();
68
- const usedNames = new Set<string>();
69
-
70
- const toTruncate = names.filter((name) => name.length > maxLength);
71
-
72
- if (toTruncate.length === 0) {
73
- return renameMap;
74
- }
75
-
76
- const willCollide =
77
- new Set(toTruncate.map((name) => name.slice(0, maxLength - 1))).size < toTruncate.length;
78
-
79
- if (!willCollide) {
80
- for (const name of toTruncate) {
81
- const truncatedName = name.slice(0, maxLength);
82
- renameMap.set(name, truncatedName);
83
- }
84
- } else {
85
- const baseLength = maxLength - 1;
86
-
87
- for (const name of toTruncate) {
88
- const baseName = name.slice(0, baseLength);
89
- let counter = 1;
90
-
91
- while (usedNames.has(baseName + counter)) {
92
- counter++;
93
- }
94
-
95
- const finalName = baseName + counter;
96
- renameMap.set(name, finalName);
97
- usedNames.add(finalName);
98
- }
99
- }
100
-
101
- return renameMap;
102
- }
103
-
104
- /**
105
- * Removes top-level unions from a tool by splitting it into multiple tools,
106
- * one for each variant in the union.
107
- */
108
- export function removeTopLevelUnions(tool: Tool): Tool[] {
109
- const inputSchema = tool.inputSchema as JSONSchema;
110
- const variants = inputSchema.anyOf;
111
-
112
- if (!variants || !Array.isArray(variants) || variants.length === 0) {
113
- return [tool];
114
- }
115
-
116
- const defs = inputSchema.$defs || {};
117
-
118
- return variants.map((variant, index) => {
119
- const variantSchema: JSONSchema = {
120
- ...inputSchema,
121
- ...variant,
122
- type: 'object',
123
- properties: {
124
- ...(inputSchema.properties || {}),
125
- ...(variant.properties || {}),
126
- },
127
- };
128
-
129
- delete variantSchema.anyOf;
130
-
131
- if (!variantSchema['description']) {
132
- variantSchema['description'] = tool.description;
133
- }
134
-
135
- const usedDefs = findUsedDefs(variant, defs);
136
- if (Object.keys(usedDefs).length > 0) {
137
- variantSchema.$defs = usedDefs;
138
- } else {
139
- delete variantSchema.$defs;
140
- }
141
-
142
- return {
143
- ...tool,
144
- name: `${tool.name}_${toSnakeCase(variant['title'] || `variant${index + 1}`)}`,
145
- description: variant['description'] || tool.description,
146
- inputSchema: variantSchema,
147
- } as Tool;
148
- });
149
- }
150
-
151
- function findUsedDefs(schema: JSONSchema, defs: Record<string, JSONSchema>): Record<string, JSONSchema> {
152
- const usedDefs: Record<string, JSONSchema> = {};
153
-
154
- if (typeof schema !== 'object' || schema === null) {
155
- return usedDefs;
156
- }
157
-
158
- if (schema.$ref) {
159
- const refParts = schema.$ref.split('/');
160
- if (refParts[0] === '#' && refParts[1] === '$defs' && refParts[2]) {
161
- const defName = refParts[2];
162
- const def = defs[defName];
163
- if (def) {
164
- usedDefs[defName] = def;
165
- Object.assign(usedDefs, findUsedDefs(def, defs));
166
- }
167
- }
168
- return usedDefs;
169
- }
170
-
171
- for (const key in schema) {
172
- if (key !== '$defs' && typeof schema[key] === 'object' && schema[key] !== null) {
173
- Object.assign(usedDefs, findUsedDefs(schema[key] as JSONSchema, defs));
174
- }
175
- }
176
-
177
- return usedDefs;
178
- }
179
-
180
- /**
181
- * Inlines all $refs in a schema, eliminating $defs.
182
- * If a circular reference is detected, the circular property is removed.
183
- */
184
- export function inlineRefs(schema: JSONSchema): JSONSchema {
185
- if (!schema || typeof schema !== 'object') {
186
- return schema;
187
- }
188
-
189
- const clonedSchema = { ...schema };
190
- const defs: Record<string, JSONSchema> = schema.$defs || {};
191
-
192
- delete clonedSchema.$defs;
193
-
194
- const result = inlineRefsRecursive(clonedSchema, defs, new Set<string>());
195
- // The top level can never be null
196
- return result === null ? {} : result;
197
- }
198
-
199
- function inlineRefsRecursive(
200
- schema: JSONSchema,
201
- defs: Record<string, JSONSchema>,
202
- refPath: Set<string>,
203
- ): JSONSchema | null {
204
- if (!schema || typeof schema !== 'object') {
205
- return schema;
206
- }
207
-
208
- if (Array.isArray(schema)) {
209
- return schema.map((item) => {
210
- const processed = inlineRefsRecursive(item, defs, refPath);
211
- return processed === null ? {} : processed;
212
- }) as JSONSchema;
213
- }
214
-
215
- const result = { ...schema };
216
-
217
- if ('$ref' in result && typeof result.$ref === 'string') {
218
- if (result.$ref.startsWith('#/$defs/')) {
219
- const refName = result.$ref.split('/').pop() as string;
220
- const def = defs[refName];
221
-
222
- // If we've already seen this ref in our path, we have a circular reference
223
- if (refPath.has(result.$ref)) {
224
- // For circular references, we completely remove the property
225
- // by returning null. The parent will remove it.
226
- return null;
227
- }
228
-
229
- if (def) {
230
- const newRefPath = new Set(refPath);
231
- newRefPath.add(result.$ref);
232
-
233
- const inlinedDef = inlineRefsRecursive({ ...def }, defs, newRefPath);
234
-
235
- if (inlinedDef === null) {
236
- return { ...result };
237
- }
238
-
239
- // Merge the inlined definition with the original schema's properties
240
- // but preserve things like description, etc.
241
- const { $ref, ...rest } = result;
242
- return { ...inlinedDef, ...rest };
243
- }
244
- }
245
-
246
- // Keep external refs as-is
247
- return result;
248
- }
249
-
250
- for (const key in result) {
251
- if (result[key] && typeof result[key] === 'object') {
252
- const processed = inlineRefsRecursive(result[key] as JSONSchema, defs, refPath);
253
- if (processed === null) {
254
- // Remove properties that would cause circular references
255
- delete result[key];
256
- } else {
257
- result[key] = processed;
258
- }
259
- }
260
- }
261
-
262
- return result;
263
- }
264
-
265
- /**
266
- * Removes anyOf fields from a schema, using only the first variant.
267
- */
268
- export function removeAnyOf(schema: JSONSchema): JSONSchema {
269
- if (!schema || typeof schema !== 'object') {
270
- return schema;
271
- }
272
-
273
- if (Array.isArray(schema)) {
274
- return schema.map((item) => removeAnyOf(item)) as JSONSchema;
275
- }
276
-
277
- const result = { ...schema };
278
-
279
- if ('anyOf' in result && Array.isArray(result.anyOf) && result.anyOf.length > 0) {
280
- const firstVariant = result.anyOf[0];
281
-
282
- if (firstVariant && typeof firstVariant === 'object') {
283
- // Special handling for properties to ensure deep merge
284
- if (firstVariant.properties && result.properties) {
285
- result.properties = {
286
- ...result.properties,
287
- ...(firstVariant.properties as Record<string, JSONSchema>),
288
- };
289
- } else if (firstVariant.properties) {
290
- result.properties = { ...firstVariant.properties };
291
- }
292
-
293
- for (const key in firstVariant) {
294
- if (key !== 'properties') {
295
- result[key] = firstVariant[key];
296
- }
297
- }
298
- }
299
-
300
- delete result.anyOf;
301
- }
302
-
303
- for (const key in result) {
304
- if (result[key] && typeof result[key] === 'object') {
305
- result[key] = removeAnyOf(result[key] as JSONSchema);
306
- }
307
- }
308
-
309
- return result;
310
- }
311
-
312
- /**
313
- * Removes format fields from a schema and appends them to the description.
314
- */
315
- export function removeFormats(schema: JSONSchema, formatsCapability: boolean): JSONSchema {
316
- if (formatsCapability) {
317
- return schema;
318
- }
319
-
320
- if (!schema || typeof schema !== 'object') {
321
- return schema;
322
- }
323
-
324
- if (Array.isArray(schema)) {
325
- return schema.map((item) => removeFormats(item, formatsCapability)) as JSONSchema;
326
- }
327
-
328
- const result = { ...schema };
329
-
330
- if ('format' in result && typeof result['format'] === 'string') {
331
- const formatStr = `(format: "${result['format']}")`;
332
-
333
- if ('description' in result && typeof result['description'] === 'string') {
334
- result['description'] = `${result['description']} ${formatStr}`;
335
- } else {
336
- result['description'] = formatStr;
337
- }
338
-
339
- delete result['format'];
340
- }
341
-
342
- for (const key in result) {
343
- if (result[key] && typeof result[key] === 'object') {
344
- result[key] = removeFormats(result[key] as JSONSchema, formatsCapability);
345
- }
346
- }
347
-
348
- return result;
349
- }
350
-
351
- /**
352
- * Applies all compatibility transformations to the endpoints based on the provided capabilities.
353
- */
354
- export function applyCompatibilityTransformations(
355
- endpoints: Endpoint[],
356
- capabilities: ClientCapabilities,
357
- ): Endpoint[] {
358
- let transformedEndpoints = [...endpoints];
359
-
360
- // Handle top-level unions first as this changes tool names
361
- if (!capabilities.topLevelUnions) {
362
- const newEndpoints: Endpoint[] = [];
363
-
364
- for (const endpoint of transformedEndpoints) {
365
- const variantTools = removeTopLevelUnions(endpoint.tool);
366
-
367
- if (variantTools.length === 1) {
368
- newEndpoints.push(endpoint);
369
- } else {
370
- for (const variantTool of variantTools) {
371
- newEndpoints.push({
372
- ...endpoint,
373
- tool: variantTool,
374
- });
375
- }
376
- }
377
- }
378
-
379
- transformedEndpoints = newEndpoints;
380
- }
381
-
382
- if (capabilities.toolNameLength) {
383
- const toolNames = transformedEndpoints.map((endpoint) => endpoint.tool.name);
384
- const renameMap = truncateToolNames(toolNames, capabilities.toolNameLength);
385
-
386
- transformedEndpoints = transformedEndpoints.map((endpoint) => ({
387
- ...endpoint,
388
- tool: {
389
- ...endpoint.tool,
390
- name: renameMap.get(endpoint.tool.name) ?? endpoint.tool.name,
391
- },
392
- }));
393
- }
394
-
395
- if (!capabilities.refs || !capabilities.unions || !capabilities.formats) {
396
- transformedEndpoints = transformedEndpoints.map((endpoint) => {
397
- let schema = endpoint.tool.inputSchema as JSONSchema;
398
-
399
- if (!capabilities.refs) {
400
- schema = inlineRefs(schema);
401
- }
402
-
403
- if (!capabilities.unions) {
404
- schema = removeAnyOf(schema);
405
- }
406
-
407
- if (!capabilities.formats) {
408
- schema = removeFormats(schema, capabilities.formats);
409
- }
410
-
411
- return {
412
- ...endpoint,
413
- tool: {
414
- ...endpoint.tool,
415
- inputSchema: schema as typeof endpoint.tool.inputSchema,
416
- },
417
- };
418
- });
419
- }
420
-
421
- return transformedEndpoints;
422
- }
423
-
424
- function toSnakeCase(str: string): string {
425
- return str
426
- .replace(/\s+/g, '_')
427
- .replace(/([a-z])([A-Z])/g, '$1_$2')
428
- .toLowerCase();
429
- }
@@ -1,152 +0,0 @@
1
- import Finch from '@tryfinch/finch-api';
2
- import { Endpoint } from './tools';
3
- import { zodToJsonSchema } from 'zod-to-json-schema';
4
- import { z } from 'zod';
5
- import { Cabidela } from '@cloudflare/cabidela';
6
-
7
- function zodToInputSchema(schema: z.ZodSchema) {
8
- return {
9
- type: 'object' as const,
10
- ...(zodToJsonSchema(schema) as any),
11
- };
12
- }
13
-
14
- /**
15
- * A list of tools that expose all the endpoints in the API dynamically.
16
- *
17
- * Instead of exposing every endpoint as it's own tool, which uses up too many tokens for LLMs to use at once,
18
- * we expose a single tool that can be used to search for endpoints by name, resource, operation, or tag, and then
19
- * a generic endpoint that can be used to invoke any endpoint with the provided arguments.
20
- *
21
- * @param endpoints - The endpoints to include in the list.
22
- */
23
- export function dynamicTools(endpoints: Endpoint[]): Endpoint[] {
24
- const listEndpointsSchema = z.object({
25
- search_query: z
26
- .string()
27
- .optional()
28
- .describe(
29
- 'An optional search query to filter the endpoints by. Provide a partial name, resource, operation, or tag to filter the endpoints returned.',
30
- ),
31
- });
32
-
33
- const listEndpointsTool = {
34
- metadata: {
35
- resource: 'dynamic_tools',
36
- operation: 'read' as const,
37
- tags: [],
38
- },
39
- tool: {
40
- name: 'list_api_endpoints',
41
- description: 'List or search for all endpoints in the Finch Node API',
42
- inputSchema: zodToInputSchema(listEndpointsSchema),
43
- },
44
- handler: async (client: Finch, args: Record<string, unknown> | undefined) => {
45
- const query = args && listEndpointsSchema.parse(args).search_query?.trim();
46
-
47
- const filteredEndpoints =
48
- query && query.length > 0 ?
49
- endpoints.filter((endpoint) => {
50
- const fieldsToMatch = [
51
- endpoint.tool.name,
52
- endpoint.metadata.resource,
53
- endpoint.metadata.operation,
54
- ...endpoint.metadata.tags,
55
- ];
56
- return fieldsToMatch.some((field) => field.toLowerCase().includes(query.toLowerCase()));
57
- })
58
- : endpoints;
59
-
60
- return {
61
- tools: filteredEndpoints.map(({ tool, metadata }) => ({
62
- name: tool.name,
63
- description: tool.description,
64
- resource: metadata.resource,
65
- operation: metadata.operation,
66
- tags: metadata.tags,
67
- })),
68
- };
69
- },
70
- };
71
-
72
- const getEndpointSchema = z.object({
73
- endpoint: z.string().describe('The name of the endpoint to get the schema for.'),
74
- });
75
- const getEndpointTool = {
76
- metadata: {
77
- resource: 'dynamic_tools',
78
- operation: 'read' as const,
79
- tags: [],
80
- },
81
- tool: {
82
- name: 'get_api_endpoint_schema',
83
- description:
84
- 'Get the schema for an endpoint in the Finch Node API. You can use the schema returned by this tool to invoke an endpoint with the `invoke_api_endpoint` tool.',
85
- inputSchema: zodToInputSchema(getEndpointSchema),
86
- },
87
- handler: async (client: Finch, args: Record<string, unknown> | undefined) => {
88
- if (!args) {
89
- throw new Error('No endpoint provided');
90
- }
91
- const endpointName = getEndpointSchema.parse(args).endpoint;
92
-
93
- const endpoint = endpoints.find((e) => e.tool.name === endpointName);
94
- if (!endpoint) {
95
- throw new Error(`Endpoint ${endpointName} not found`);
96
- }
97
- return endpoint.tool;
98
- },
99
- };
100
-
101
- const invokeEndpointSchema = z.object({
102
- endpoint_name: z.string().describe('The name of the endpoint to invoke.'),
103
- args: z
104
- .record(z.string(), z.any())
105
- .describe(
106
- 'The arguments to pass to the endpoint. This must match the schema returned by the `get_api_endpoint_schema` tool.',
107
- ),
108
- });
109
-
110
- const invokeEndpointTool = {
111
- metadata: {
112
- resource: 'dynamic_tools',
113
- operation: 'write' as const,
114
- tags: [],
115
- },
116
- tool: {
117
- name: 'invoke_api_endpoint',
118
- description:
119
- 'Invoke an endpoint in the Finch Node API. Note: use the `list_api_endpoints` tool to get the list of endpoints and `get_api_endpoint_schema` tool to get the schema for an endpoint.',
120
- inputSchema: zodToInputSchema(invokeEndpointSchema),
121
- },
122
- handler: async (client: Finch, args: Record<string, unknown> | undefined) => {
123
- if (!args) {
124
- throw new Error('No endpoint provided');
125
- }
126
- const { success, data, error } = invokeEndpointSchema.safeParse(args);
127
- if (!success) {
128
- throw new Error(`Invalid arguments for endpoint. ${error?.format()}`);
129
- }
130
- const { endpoint_name, args: endpointArgs } = data;
131
-
132
- const endpoint = endpoints.find((e) => e.tool.name === endpoint_name);
133
- if (!endpoint) {
134
- throw new Error(
135
- `Endpoint ${endpoint_name} not found. Use the \`list_api_endpoints\` tool to get the list of available endpoints.`,
136
- );
137
- }
138
-
139
- try {
140
- // Try to validate the arguments for a better error message
141
- const cabidela = new Cabidela(endpoint.tool.inputSchema, { fullErrors: true });
142
- cabidela.validate(endpointArgs);
143
- } catch (error) {
144
- throw new Error(`Invalid arguments for endpoint ${endpoint_name}:\n${error}`);
145
- }
146
-
147
- return endpoint.handler(client, endpointArgs);
148
- },
149
- };
150
-
151
- return [getEndpointTool, listEndpointsTool, invokeEndpointTool];
152
- }
@@ -1,40 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { Tool } from '@modelcontextprotocol/sdk/types.js';
4
- import type { Metadata } from '../';
5
- import Finch from '@tryfinch/finch-api';
6
-
7
- export const metadata: Metadata = {
8
- resource: 'access_tokens',
9
- operation: 'write',
10
- tags: [],
11
- };
12
-
13
- export const tool: Tool = {
14
- name: 'create_access_tokens',
15
- description: 'Exchange the authorization code for an access token',
16
- inputSchema: {
17
- type: 'object',
18
- properties: {
19
- code: {
20
- type: 'string',
21
- },
22
- client_id: {
23
- type: 'string',
24
- },
25
- client_secret: {
26
- type: 'string',
27
- },
28
- redirect_uri: {
29
- type: 'string',
30
- },
31
- },
32
- },
33
- };
34
-
35
- export const handler = (client: Finch, args: Record<string, unknown> | undefined) => {
36
- const body = args as any;
37
- return client.accessTokens.create(body);
38
- };
39
-
40
- export default { metadata, tool, handler };
@@ -1,26 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { Tool } from '@modelcontextprotocol/sdk/types.js';
4
- import type { Metadata } from '../';
5
- import Finch from '@tryfinch/finch-api';
6
-
7
- export const metadata: Metadata = {
8
- resource: 'account',
9
- operation: 'write',
10
- tags: [],
11
- };
12
-
13
- export const tool: Tool = {
14
- name: 'disconnect_account',
15
- description: 'Disconnect one or more `access_token`s from your application.',
16
- inputSchema: {
17
- type: 'object',
18
- properties: {},
19
- },
20
- };
21
-
22
- export const handler = (client: Finch, args: Record<string, unknown> | undefined) => {
23
- return client.account.disconnect();
24
- };
25
-
26
- export default { metadata, tool, handler };
@@ -1,26 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { Tool } from '@modelcontextprotocol/sdk/types.js';
4
- import type { Metadata } from '../';
5
- import Finch from '@tryfinch/finch-api';
6
-
7
- export const metadata: Metadata = {
8
- resource: 'account',
9
- operation: 'read',
10
- tags: [],
11
- };
12
-
13
- export const tool: Tool = {
14
- name: 'introspect_account',
15
- description: 'Read account information associated with an `access_token`',
16
- inputSchema: {
17
- type: 'object',
18
- properties: {},
19
- },
20
- };
21
-
22
- export const handler = (client: Finch, args: Record<string, unknown> | undefined) => {
23
- return client.account.introspect();
24
- };
25
-
26
- export default { metadata, tool, handler };