@tryfinch/finch-api-mcp 6.27.0 → 6.29.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 (465) hide show
  1. package/README.md +77 -3
  2. package/compat.d.mts +52 -0
  3. package/compat.d.mts.map +1 -0
  4. package/compat.d.ts +52 -0
  5. package/compat.d.ts.map +1 -0
  6. package/compat.js +342 -0
  7. package/compat.js.map +1 -0
  8. package/compat.mjs +332 -0
  9. package/compat.mjs.map +1 -0
  10. package/dynamic-tools.d.mts +12 -0
  11. package/dynamic-tools.d.mts.map +1 -0
  12. package/dynamic-tools.d.ts +12 -0
  13. package/dynamic-tools.d.ts.map +1 -0
  14. package/dynamic-tools.js +133 -0
  15. package/dynamic-tools.js.map +1 -0
  16. package/dynamic-tools.mjs +130 -0
  17. package/dynamic-tools.mjs.map +1 -0
  18. package/index.js +40 -116
  19. package/index.js.map +1 -1
  20. package/index.mjs +42 -115
  21. package/index.mjs.map +1 -1
  22. package/options.d.mts +11 -0
  23. package/options.d.mts.map +1 -0
  24. package/options.d.ts +11 -0
  25. package/options.d.ts.map +1 -0
  26. package/options.js +337 -0
  27. package/options.js.map +1 -0
  28. package/options.mjs +331 -0
  29. package/options.mjs.map +1 -0
  30. package/package.json +6 -3
  31. package/server.d.mts +9 -2
  32. package/server.d.mts.map +1 -1
  33. package/server.d.ts +9 -2
  34. package/server.d.ts.map +1 -1
  35. package/server.js +34 -11
  36. package/server.js.map +1 -1
  37. package/server.mjs +31 -9
  38. package/server.mjs.map +1 -1
  39. package/src/compat.ts +429 -0
  40. package/src/dynamic-tools.ts +152 -0
  41. package/src/index.ts +42 -130
  42. package/src/options.ts +361 -0
  43. package/src/server.ts +46 -11
  44. package/src/tools/access-tokens/create-access-tokens.ts +2 -2
  45. package/src/tools/account/disconnect-account.ts +1 -2
  46. package/src/tools/account/introspect-account.ts +1 -2
  47. package/src/tools/connect/sessions/new-connect-sessions.ts +2 -2
  48. package/src/tools/connect/sessions/reauthenticate-connect-sessions.ts +2 -2
  49. package/src/tools/hris/benefits/create-hris-benefits.ts +38 -3
  50. package/src/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.ts +2 -2
  51. package/src/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.ts +2 -2
  52. package/src/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.ts +2 -2
  53. package/src/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.ts +2 -2
  54. package/src/tools/hris/benefits/list-hris-benefits.ts +1 -2
  55. package/src/tools/hris/benefits/list-supported-benefits-hris-benefits.ts +1 -2
  56. package/src/tools/hris/benefits/retrieve-hris-benefits.ts +2 -2
  57. package/src/tools/hris/benefits/update-hris-benefits.ts +2 -2
  58. package/src/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.ts +2 -2
  59. package/src/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.ts +2 -2
  60. package/src/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.ts +2 -2
  61. package/src/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.ts +1 -2
  62. package/src/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.ts +2 -2
  63. package/src/tools/hris/company/retrieve-hris-company.ts +1 -2
  64. package/src/tools/hris/directory/list-hris-directory.ts +2 -2
  65. package/src/tools/hris/directory/list-individuals-hris-directory.ts +2 -2
  66. package/src/tools/hris/documents/list-hris-documents.ts +2 -2
  67. package/src/tools/hris/documents/retreive-hris-documents.ts +2 -2
  68. package/src/tools/hris/employments/retrieve-many-hris-employments.ts +2 -2
  69. package/src/tools/hris/individuals/retrieve-many-hris-individuals.ts +2 -2
  70. package/src/tools/hris/pay-statements/retrieve-many-hris-pay-statements.ts +2 -2
  71. package/src/tools/hris/payments/list-hris-payments.ts +2 -2
  72. package/src/tools/index.ts +16 -6
  73. package/src/tools/jobs/automated/create-jobs-automated.ts +2 -2
  74. package/src/tools/jobs/automated/list-jobs-automated.ts +2 -2
  75. package/src/tools/jobs/automated/retrieve-jobs-automated.ts +2 -2
  76. package/src/tools/jobs/manual/retrieve-jobs-manual.ts +2 -2
  77. package/src/tools/payroll/pay-groups/list-payroll-pay-groups.ts +2 -2
  78. package/src/tools/payroll/pay-groups/retrieve-payroll-pay-groups.ts +2 -2
  79. package/src/tools/providers/list-providers.ts +1 -2
  80. package/src/tools/request-forwarding/forward-request-forwarding.ts +2 -2
  81. package/src/tools/sandbox/company/update-sandbox-company.ts +42 -37
  82. package/src/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.ts +2 -2
  83. package/src/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.ts +7 -2
  84. package/src/tools/sandbox/connections/create-sandbox-connections.ts +2 -2
  85. package/src/tools/sandbox/directory/create-sandbox-directory.ts +82 -74
  86. package/src/tools/sandbox/employment/update-sandbox-employment.ts +62 -54
  87. package/src/tools/sandbox/individual/update-sandbox-individual.ts +19 -14
  88. package/src/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.ts +1 -2
  89. package/src/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.ts +2 -2
  90. package/src/tools/sandbox/jobs/create-sandbox-jobs.ts +2 -2
  91. package/src/tools/sandbox/payment/create-sandbox-payment.ts +49 -41
  92. package/tools/access-tokens/create-access-tokens.d.mts +10 -2
  93. package/tools/access-tokens/create-access-tokens.d.mts.map +1 -1
  94. package/tools/access-tokens/create-access-tokens.d.ts +10 -2
  95. package/tools/access-tokens/create-access-tokens.d.ts.map +1 -1
  96. package/tools/access-tokens/create-access-tokens.js +1 -1
  97. package/tools/access-tokens/create-access-tokens.js.map +1 -1
  98. package/tools/access-tokens/create-access-tokens.mjs +1 -1
  99. package/tools/access-tokens/create-access-tokens.mjs.map +1 -1
  100. package/tools/account/disconnect-account.d.mts +10 -2
  101. package/tools/account/disconnect-account.d.mts.map +1 -1
  102. package/tools/account/disconnect-account.d.ts +10 -2
  103. package/tools/account/disconnect-account.d.ts.map +1 -1
  104. package/tools/account/disconnect-account.js +0 -1
  105. package/tools/account/disconnect-account.js.map +1 -1
  106. package/tools/account/disconnect-account.mjs +0 -1
  107. package/tools/account/disconnect-account.mjs.map +1 -1
  108. package/tools/account/introspect-account.d.mts +10 -2
  109. package/tools/account/introspect-account.d.mts.map +1 -1
  110. package/tools/account/introspect-account.d.ts +10 -2
  111. package/tools/account/introspect-account.d.ts.map +1 -1
  112. package/tools/account/introspect-account.js +0 -1
  113. package/tools/account/introspect-account.js.map +1 -1
  114. package/tools/account/introspect-account.mjs +0 -1
  115. package/tools/account/introspect-account.mjs.map +1 -1
  116. package/tools/connect/sessions/new-connect-sessions.d.mts +10 -2
  117. package/tools/connect/sessions/new-connect-sessions.d.mts.map +1 -1
  118. package/tools/connect/sessions/new-connect-sessions.d.ts +10 -2
  119. package/tools/connect/sessions/new-connect-sessions.d.ts.map +1 -1
  120. package/tools/connect/sessions/new-connect-sessions.js +1 -1
  121. package/tools/connect/sessions/new-connect-sessions.js.map +1 -1
  122. package/tools/connect/sessions/new-connect-sessions.mjs +1 -1
  123. package/tools/connect/sessions/new-connect-sessions.mjs.map +1 -1
  124. package/tools/connect/sessions/reauthenticate-connect-sessions.d.mts +10 -2
  125. package/tools/connect/sessions/reauthenticate-connect-sessions.d.mts.map +1 -1
  126. package/tools/connect/sessions/reauthenticate-connect-sessions.d.ts +10 -2
  127. package/tools/connect/sessions/reauthenticate-connect-sessions.d.ts.map +1 -1
  128. package/tools/connect/sessions/reauthenticate-connect-sessions.js +1 -1
  129. package/tools/connect/sessions/reauthenticate-connect-sessions.js.map +1 -1
  130. package/tools/connect/sessions/reauthenticate-connect-sessions.mjs +1 -1
  131. package/tools/connect/sessions/reauthenticate-connect-sessions.mjs.map +1 -1
  132. package/tools/hris/benefits/create-hris-benefits.d.mts +10 -2
  133. package/tools/hris/benefits/create-hris-benefits.d.mts.map +1 -1
  134. package/tools/hris/benefits/create-hris-benefits.d.ts +10 -2
  135. package/tools/hris/benefits/create-hris-benefits.d.ts.map +1 -1
  136. package/tools/hris/benefits/create-hris-benefits.js +37 -2
  137. package/tools/hris/benefits/create-hris-benefits.js.map +1 -1
  138. package/tools/hris/benefits/create-hris-benefits.mjs +37 -2
  139. package/tools/hris/benefits/create-hris-benefits.mjs.map +1 -1
  140. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.mts +10 -2
  141. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.mts.map +1 -1
  142. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.ts +10 -2
  143. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.ts.map +1 -1
  144. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.js.map +1 -1
  145. package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.mjs.map +1 -1
  146. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.mts +10 -2
  147. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.mts.map +1 -1
  148. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.ts +10 -2
  149. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.ts.map +1 -1
  150. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.js +1 -1
  151. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.js.map +1 -1
  152. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.mjs +1 -1
  153. package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.mjs.map +1 -1
  154. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.mts +10 -2
  155. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.mts.map +1 -1
  156. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.ts +10 -2
  157. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.ts.map +1 -1
  158. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.js.map +1 -1
  159. package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.mjs.map +1 -1
  160. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.mts +10 -2
  161. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.mts.map +1 -1
  162. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.ts +10 -2
  163. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.ts.map +1 -1
  164. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.js.map +1 -1
  165. package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.mjs.map +1 -1
  166. package/tools/hris/benefits/list-hris-benefits.d.mts +10 -2
  167. package/tools/hris/benefits/list-hris-benefits.d.mts.map +1 -1
  168. package/tools/hris/benefits/list-hris-benefits.d.ts +10 -2
  169. package/tools/hris/benefits/list-hris-benefits.d.ts.map +1 -1
  170. package/tools/hris/benefits/list-hris-benefits.js +0 -1
  171. package/tools/hris/benefits/list-hris-benefits.js.map +1 -1
  172. package/tools/hris/benefits/list-hris-benefits.mjs +0 -1
  173. package/tools/hris/benefits/list-hris-benefits.mjs.map +1 -1
  174. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.mts +10 -2
  175. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.mts.map +1 -1
  176. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.ts +10 -2
  177. package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.ts.map +1 -1
  178. package/tools/hris/benefits/list-supported-benefits-hris-benefits.js +0 -1
  179. package/tools/hris/benefits/list-supported-benefits-hris-benefits.js.map +1 -1
  180. package/tools/hris/benefits/list-supported-benefits-hris-benefits.mjs +0 -1
  181. package/tools/hris/benefits/list-supported-benefits-hris-benefits.mjs.map +1 -1
  182. package/tools/hris/benefits/retrieve-hris-benefits.d.mts +10 -2
  183. package/tools/hris/benefits/retrieve-hris-benefits.d.mts.map +1 -1
  184. package/tools/hris/benefits/retrieve-hris-benefits.d.ts +10 -2
  185. package/tools/hris/benefits/retrieve-hris-benefits.d.ts.map +1 -1
  186. package/tools/hris/benefits/retrieve-hris-benefits.js +1 -1
  187. package/tools/hris/benefits/retrieve-hris-benefits.js.map +1 -1
  188. package/tools/hris/benefits/retrieve-hris-benefits.mjs +1 -1
  189. package/tools/hris/benefits/retrieve-hris-benefits.mjs.map +1 -1
  190. package/tools/hris/benefits/update-hris-benefits.d.mts +10 -2
  191. package/tools/hris/benefits/update-hris-benefits.d.mts.map +1 -1
  192. package/tools/hris/benefits/update-hris-benefits.d.ts +10 -2
  193. package/tools/hris/benefits/update-hris-benefits.d.ts.map +1 -1
  194. package/tools/hris/benefits/update-hris-benefits.js.map +1 -1
  195. package/tools/hris/benefits/update-hris-benefits.mjs.map +1 -1
  196. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.mts +10 -2
  197. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.mts.map +1 -1
  198. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.ts +10 -2
  199. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.ts.map +1 -1
  200. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.js +1 -1
  201. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.js.map +1 -1
  202. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.mjs +1 -1
  203. package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.mjs.map +1 -1
  204. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.mts +10 -2
  205. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.mts.map +1 -1
  206. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.ts +10 -2
  207. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.ts.map +1 -1
  208. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.js +1 -1
  209. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.js.map +1 -1
  210. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.mjs +1 -1
  211. package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.mjs.map +1 -1
  212. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.mts +10 -2
  213. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.mts.map +1 -1
  214. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.ts +10 -2
  215. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.ts.map +1 -1
  216. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.js +1 -1
  217. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.js.map +1 -1
  218. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.mjs +1 -1
  219. package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.mjs.map +1 -1
  220. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.mts +10 -2
  221. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.mts.map +1 -1
  222. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.ts +10 -2
  223. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.ts.map +1 -1
  224. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.js +0 -1
  225. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.js.map +1 -1
  226. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.mjs +0 -1
  227. package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.mjs.map +1 -1
  228. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.mts +10 -2
  229. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.mts.map +1 -1
  230. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.ts +10 -2
  231. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.ts.map +1 -1
  232. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.js.map +1 -1
  233. package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.mjs.map +1 -1
  234. package/tools/hris/company/retrieve-hris-company.d.mts +10 -2
  235. package/tools/hris/company/retrieve-hris-company.d.mts.map +1 -1
  236. package/tools/hris/company/retrieve-hris-company.d.ts +10 -2
  237. package/tools/hris/company/retrieve-hris-company.d.ts.map +1 -1
  238. package/tools/hris/company/retrieve-hris-company.js +0 -1
  239. package/tools/hris/company/retrieve-hris-company.js.map +1 -1
  240. package/tools/hris/company/retrieve-hris-company.mjs +0 -1
  241. package/tools/hris/company/retrieve-hris-company.mjs.map +1 -1
  242. package/tools/hris/directory/list-hris-directory.d.mts +10 -2
  243. package/tools/hris/directory/list-hris-directory.d.mts.map +1 -1
  244. package/tools/hris/directory/list-hris-directory.d.ts +10 -2
  245. package/tools/hris/directory/list-hris-directory.d.ts.map +1 -1
  246. package/tools/hris/directory/list-hris-directory.js +1 -1
  247. package/tools/hris/directory/list-hris-directory.js.map +1 -1
  248. package/tools/hris/directory/list-hris-directory.mjs +1 -1
  249. package/tools/hris/directory/list-hris-directory.mjs.map +1 -1
  250. package/tools/hris/directory/list-individuals-hris-directory.d.mts +10 -2
  251. package/tools/hris/directory/list-individuals-hris-directory.d.mts.map +1 -1
  252. package/tools/hris/directory/list-individuals-hris-directory.d.ts +10 -2
  253. package/tools/hris/directory/list-individuals-hris-directory.d.ts.map +1 -1
  254. package/tools/hris/directory/list-individuals-hris-directory.js +1 -1
  255. package/tools/hris/directory/list-individuals-hris-directory.js.map +1 -1
  256. package/tools/hris/directory/list-individuals-hris-directory.mjs +1 -1
  257. package/tools/hris/directory/list-individuals-hris-directory.mjs.map +1 -1
  258. package/tools/hris/documents/list-hris-documents.d.mts +10 -2
  259. package/tools/hris/documents/list-hris-documents.d.mts.map +1 -1
  260. package/tools/hris/documents/list-hris-documents.d.ts +10 -2
  261. package/tools/hris/documents/list-hris-documents.d.ts.map +1 -1
  262. package/tools/hris/documents/list-hris-documents.js +1 -1
  263. package/tools/hris/documents/list-hris-documents.js.map +1 -1
  264. package/tools/hris/documents/list-hris-documents.mjs +1 -1
  265. package/tools/hris/documents/list-hris-documents.mjs.map +1 -1
  266. package/tools/hris/documents/retreive-hris-documents.d.mts +10 -2
  267. package/tools/hris/documents/retreive-hris-documents.d.mts.map +1 -1
  268. package/tools/hris/documents/retreive-hris-documents.d.ts +10 -2
  269. package/tools/hris/documents/retreive-hris-documents.d.ts.map +1 -1
  270. package/tools/hris/documents/retreive-hris-documents.js +1 -1
  271. package/tools/hris/documents/retreive-hris-documents.js.map +1 -1
  272. package/tools/hris/documents/retreive-hris-documents.mjs +1 -1
  273. package/tools/hris/documents/retreive-hris-documents.mjs.map +1 -1
  274. package/tools/hris/employments/retrieve-many-hris-employments.d.mts +10 -2
  275. package/tools/hris/employments/retrieve-many-hris-employments.d.mts.map +1 -1
  276. package/tools/hris/employments/retrieve-many-hris-employments.d.ts +10 -2
  277. package/tools/hris/employments/retrieve-many-hris-employments.d.ts.map +1 -1
  278. package/tools/hris/employments/retrieve-many-hris-employments.js +1 -1
  279. package/tools/hris/employments/retrieve-many-hris-employments.js.map +1 -1
  280. package/tools/hris/employments/retrieve-many-hris-employments.mjs +1 -1
  281. package/tools/hris/employments/retrieve-many-hris-employments.mjs.map +1 -1
  282. package/tools/hris/individuals/retrieve-many-hris-individuals.d.mts +10 -2
  283. package/tools/hris/individuals/retrieve-many-hris-individuals.d.mts.map +1 -1
  284. package/tools/hris/individuals/retrieve-many-hris-individuals.d.ts +10 -2
  285. package/tools/hris/individuals/retrieve-many-hris-individuals.d.ts.map +1 -1
  286. package/tools/hris/individuals/retrieve-many-hris-individuals.js +1 -1
  287. package/tools/hris/individuals/retrieve-many-hris-individuals.js.map +1 -1
  288. package/tools/hris/individuals/retrieve-many-hris-individuals.mjs +1 -1
  289. package/tools/hris/individuals/retrieve-many-hris-individuals.mjs.map +1 -1
  290. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.mts +10 -2
  291. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.mts.map +1 -1
  292. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.ts +10 -2
  293. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.ts.map +1 -1
  294. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.js +1 -1
  295. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.js.map +1 -1
  296. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.mjs +1 -1
  297. package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.mjs.map +1 -1
  298. package/tools/hris/payments/list-hris-payments.d.mts +10 -2
  299. package/tools/hris/payments/list-hris-payments.d.mts.map +1 -1
  300. package/tools/hris/payments/list-hris-payments.d.ts +10 -2
  301. package/tools/hris/payments/list-hris-payments.d.ts.map +1 -1
  302. package/tools/hris/payments/list-hris-payments.js +1 -1
  303. package/tools/hris/payments/list-hris-payments.js.map +1 -1
  304. package/tools/hris/payments/list-hris-payments.mjs +1 -1
  305. package/tools/hris/payments/list-hris-payments.mjs.map +1 -1
  306. package/tools/index.d.mts +1 -1
  307. package/tools/index.d.mts.map +1 -1
  308. package/tools/index.d.ts +1 -1
  309. package/tools/index.d.ts.map +1 -1
  310. package/tools/index.js +13 -7
  311. package/tools/index.js.map +1 -1
  312. package/tools/index.mjs +11 -5
  313. package/tools/index.mjs.map +1 -1
  314. package/tools/jobs/automated/create-jobs-automated.d.mts +10 -2
  315. package/tools/jobs/automated/create-jobs-automated.d.mts.map +1 -1
  316. package/tools/jobs/automated/create-jobs-automated.d.ts +10 -2
  317. package/tools/jobs/automated/create-jobs-automated.d.ts.map +1 -1
  318. package/tools/jobs/automated/create-jobs-automated.js +1 -1
  319. package/tools/jobs/automated/create-jobs-automated.js.map +1 -1
  320. package/tools/jobs/automated/create-jobs-automated.mjs +1 -1
  321. package/tools/jobs/automated/create-jobs-automated.mjs.map +1 -1
  322. package/tools/jobs/automated/list-jobs-automated.d.mts +10 -2
  323. package/tools/jobs/automated/list-jobs-automated.d.mts.map +1 -1
  324. package/tools/jobs/automated/list-jobs-automated.d.ts +10 -2
  325. package/tools/jobs/automated/list-jobs-automated.d.ts.map +1 -1
  326. package/tools/jobs/automated/list-jobs-automated.js +1 -1
  327. package/tools/jobs/automated/list-jobs-automated.js.map +1 -1
  328. package/tools/jobs/automated/list-jobs-automated.mjs +1 -1
  329. package/tools/jobs/automated/list-jobs-automated.mjs.map +1 -1
  330. package/tools/jobs/automated/retrieve-jobs-automated.d.mts +10 -2
  331. package/tools/jobs/automated/retrieve-jobs-automated.d.mts.map +1 -1
  332. package/tools/jobs/automated/retrieve-jobs-automated.d.ts +10 -2
  333. package/tools/jobs/automated/retrieve-jobs-automated.d.ts.map +1 -1
  334. package/tools/jobs/automated/retrieve-jobs-automated.js +1 -1
  335. package/tools/jobs/automated/retrieve-jobs-automated.js.map +1 -1
  336. package/tools/jobs/automated/retrieve-jobs-automated.mjs +1 -1
  337. package/tools/jobs/automated/retrieve-jobs-automated.mjs.map +1 -1
  338. package/tools/jobs/manual/retrieve-jobs-manual.d.mts +10 -2
  339. package/tools/jobs/manual/retrieve-jobs-manual.d.mts.map +1 -1
  340. package/tools/jobs/manual/retrieve-jobs-manual.d.ts +10 -2
  341. package/tools/jobs/manual/retrieve-jobs-manual.d.ts.map +1 -1
  342. package/tools/jobs/manual/retrieve-jobs-manual.js +1 -1
  343. package/tools/jobs/manual/retrieve-jobs-manual.js.map +1 -1
  344. package/tools/jobs/manual/retrieve-jobs-manual.mjs +1 -1
  345. package/tools/jobs/manual/retrieve-jobs-manual.mjs.map +1 -1
  346. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.mts +10 -2
  347. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.mts.map +1 -1
  348. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.ts +10 -2
  349. package/tools/payroll/pay-groups/list-payroll-pay-groups.d.ts.map +1 -1
  350. package/tools/payroll/pay-groups/list-payroll-pay-groups.js +1 -1
  351. package/tools/payroll/pay-groups/list-payroll-pay-groups.js.map +1 -1
  352. package/tools/payroll/pay-groups/list-payroll-pay-groups.mjs +1 -1
  353. package/tools/payroll/pay-groups/list-payroll-pay-groups.mjs.map +1 -1
  354. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.mts +10 -2
  355. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.mts.map +1 -1
  356. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.ts +10 -2
  357. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.ts.map +1 -1
  358. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.js +1 -1
  359. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.js.map +1 -1
  360. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.mjs +1 -1
  361. package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.mjs.map +1 -1
  362. package/tools/providers/list-providers.d.mts +10 -2
  363. package/tools/providers/list-providers.d.mts.map +1 -1
  364. package/tools/providers/list-providers.d.ts +10 -2
  365. package/tools/providers/list-providers.d.ts.map +1 -1
  366. package/tools/providers/list-providers.js +0 -1
  367. package/tools/providers/list-providers.js.map +1 -1
  368. package/tools/providers/list-providers.mjs +0 -1
  369. package/tools/providers/list-providers.mjs.map +1 -1
  370. package/tools/request-forwarding/forward-request-forwarding.d.mts +10 -2
  371. package/tools/request-forwarding/forward-request-forwarding.d.mts.map +1 -1
  372. package/tools/request-forwarding/forward-request-forwarding.d.ts +10 -2
  373. package/tools/request-forwarding/forward-request-forwarding.d.ts.map +1 -1
  374. package/tools/request-forwarding/forward-request-forwarding.js +1 -1
  375. package/tools/request-forwarding/forward-request-forwarding.js.map +1 -1
  376. package/tools/request-forwarding/forward-request-forwarding.mjs +1 -1
  377. package/tools/request-forwarding/forward-request-forwarding.mjs.map +1 -1
  378. package/tools/sandbox/company/update-sandbox-company.d.mts +10 -2
  379. package/tools/sandbox/company/update-sandbox-company.d.mts.map +1 -1
  380. package/tools/sandbox/company/update-sandbox-company.d.ts +10 -2
  381. package/tools/sandbox/company/update-sandbox-company.d.ts.map +1 -1
  382. package/tools/sandbox/company/update-sandbox-company.js +41 -36
  383. package/tools/sandbox/company/update-sandbox-company.js.map +1 -1
  384. package/tools/sandbox/company/update-sandbox-company.mjs +41 -36
  385. package/tools/sandbox/company/update-sandbox-company.mjs.map +1 -1
  386. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.mts +10 -2
  387. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.mts.map +1 -1
  388. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.ts +10 -2
  389. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.ts.map +1 -1
  390. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.js +1 -1
  391. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.js.map +1 -1
  392. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.mjs +1 -1
  393. package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.mjs.map +1 -1
  394. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.mts +10 -2
  395. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.mts.map +1 -1
  396. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.ts +10 -2
  397. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.ts.map +1 -1
  398. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.js +6 -1
  399. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.js.map +1 -1
  400. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.mjs +6 -1
  401. package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.mjs.map +1 -1
  402. package/tools/sandbox/connections/create-sandbox-connections.d.mts +10 -2
  403. package/tools/sandbox/connections/create-sandbox-connections.d.mts.map +1 -1
  404. package/tools/sandbox/connections/create-sandbox-connections.d.ts +10 -2
  405. package/tools/sandbox/connections/create-sandbox-connections.d.ts.map +1 -1
  406. package/tools/sandbox/connections/create-sandbox-connections.js +1 -1
  407. package/tools/sandbox/connections/create-sandbox-connections.js.map +1 -1
  408. package/tools/sandbox/connections/create-sandbox-connections.mjs +1 -1
  409. package/tools/sandbox/connections/create-sandbox-connections.mjs.map +1 -1
  410. package/tools/sandbox/directory/create-sandbox-directory.d.mts +10 -2
  411. package/tools/sandbox/directory/create-sandbox-directory.d.mts.map +1 -1
  412. package/tools/sandbox/directory/create-sandbox-directory.d.ts +10 -2
  413. package/tools/sandbox/directory/create-sandbox-directory.d.ts.map +1 -1
  414. package/tools/sandbox/directory/create-sandbox-directory.js +79 -71
  415. package/tools/sandbox/directory/create-sandbox-directory.js.map +1 -1
  416. package/tools/sandbox/directory/create-sandbox-directory.mjs +79 -71
  417. package/tools/sandbox/directory/create-sandbox-directory.mjs.map +1 -1
  418. package/tools/sandbox/employment/update-sandbox-employment.d.mts +10 -2
  419. package/tools/sandbox/employment/update-sandbox-employment.d.mts.map +1 -1
  420. package/tools/sandbox/employment/update-sandbox-employment.d.ts +10 -2
  421. package/tools/sandbox/employment/update-sandbox-employment.d.ts.map +1 -1
  422. package/tools/sandbox/employment/update-sandbox-employment.js +60 -52
  423. package/tools/sandbox/employment/update-sandbox-employment.js.map +1 -1
  424. package/tools/sandbox/employment/update-sandbox-employment.mjs +60 -52
  425. package/tools/sandbox/employment/update-sandbox-employment.mjs.map +1 -1
  426. package/tools/sandbox/individual/update-sandbox-individual.d.mts +10 -2
  427. package/tools/sandbox/individual/update-sandbox-individual.d.mts.map +1 -1
  428. package/tools/sandbox/individual/update-sandbox-individual.d.ts +10 -2
  429. package/tools/sandbox/individual/update-sandbox-individual.d.ts.map +1 -1
  430. package/tools/sandbox/individual/update-sandbox-individual.js +16 -11
  431. package/tools/sandbox/individual/update-sandbox-individual.js.map +1 -1
  432. package/tools/sandbox/individual/update-sandbox-individual.mjs +16 -11
  433. package/tools/sandbox/individual/update-sandbox-individual.mjs.map +1 -1
  434. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.mts +10 -2
  435. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.mts.map +1 -1
  436. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.ts +10 -2
  437. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.ts.map +1 -1
  438. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.js +0 -1
  439. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.js.map +1 -1
  440. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.mjs +0 -1
  441. package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.mjs.map +1 -1
  442. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.mts +10 -2
  443. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.mts.map +1 -1
  444. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.ts +10 -2
  445. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.ts.map +1 -1
  446. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.js +1 -1
  447. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.js.map +1 -1
  448. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.mjs +1 -1
  449. package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.mjs.map +1 -1
  450. package/tools/sandbox/jobs/create-sandbox-jobs.d.mts +10 -2
  451. package/tools/sandbox/jobs/create-sandbox-jobs.d.mts.map +1 -1
  452. package/tools/sandbox/jobs/create-sandbox-jobs.d.ts +10 -2
  453. package/tools/sandbox/jobs/create-sandbox-jobs.d.ts.map +1 -1
  454. package/tools/sandbox/jobs/create-sandbox-jobs.js +1 -1
  455. package/tools/sandbox/jobs/create-sandbox-jobs.js.map +1 -1
  456. package/tools/sandbox/jobs/create-sandbox-jobs.mjs +1 -1
  457. package/tools/sandbox/jobs/create-sandbox-jobs.mjs.map +1 -1
  458. package/tools/sandbox/payment/create-sandbox-payment.d.mts +10 -2
  459. package/tools/sandbox/payment/create-sandbox-payment.d.mts.map +1 -1
  460. package/tools/sandbox/payment/create-sandbox-payment.d.ts +10 -2
  461. package/tools/sandbox/payment/create-sandbox-payment.d.ts.map +1 -1
  462. package/tools/sandbox/payment/create-sandbox-payment.js +48 -40
  463. package/tools/sandbox/payment/create-sandbox-payment.js.map +1 -1
  464. package/tools/sandbox/payment/create-sandbox-payment.mjs +48 -40
  465. package/tools/sandbox/payment/create-sandbox-payment.mjs.map +1 -1
package/src/index.ts CHANGED
@@ -1,115 +1,24 @@
1
1
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
2
- import yargs from 'yargs';
3
- import { hideBin } from 'yargs/helpers';
4
- import { init, server } from './server';
5
- import { endpoints, Filter, query } from './tools';
2
+ import { init, selectTools, server } from './server';
3
+ import { Endpoint, endpoints } from './tools';
4
+ import { ParsedOptions, parseOptions } from './options';
6
5
 
7
6
  async function main() {
8
- const opts = yargs(hideBin(process.argv))
9
- .option('tool', {
10
- type: 'string',
11
- array: true,
12
- description: 'Include tools matching the specified names',
13
- })
14
- .option('resource', {
15
- type: 'string',
16
- array: true,
17
- description: 'Include tools matching the specified resources',
18
- })
19
- .option('operation', {
20
- type: 'string',
21
- array: true,
22
- choices: ['read', 'write'],
23
- description: 'Include tools matching the specified operations',
24
- })
25
- .option('tag', {
26
- type: 'string',
27
- array: true,
28
- description: 'Include tools with the specified tags',
29
- })
30
- .option('no-tool', {
31
- type: 'string',
32
- array: true,
33
- description: 'Exclude tools matching the specified names',
34
- })
35
- .option('no-resource', {
36
- type: 'string',
37
- array: true,
38
- description: 'Exclude tools matching the specified resources',
39
- })
40
- .option('no-operation', {
41
- type: 'string',
42
- array: true,
43
- description: 'Exclude tools matching the specified operations',
44
- })
45
- .option('no-tag', {
46
- type: 'string',
47
- array: true,
48
- description: 'Exclude tools with the specified tags',
49
- })
50
- .option('list', {
51
- type: 'boolean',
52
- description: 'List all tools and exit',
53
- })
54
- .help();
55
-
56
- for (const [command, desc] of examples()) {
57
- opts.example(command, desc);
58
- }
59
-
60
- const argv = opts.parseSync();
7
+ const options = parseOptionsOrError();
61
8
 
62
- if (argv.list) {
9
+ if (options.list) {
63
10
  listAllTools();
64
11
  return;
65
12
  }
66
- const filters: Filter[] = [];
67
13
 
68
- for (const tag of argv.tag || []) {
69
- filters.push({ type: 'tag', op: 'include', value: tag });
70
- }
71
-
72
- for (const tag of argv.noTag || []) {
73
- filters.push({ type: 'tag', op: 'exclude', value: tag });
74
- }
75
-
76
- for (const resource of argv.resource || []) {
77
- filters.push({ type: 'resource', op: 'include', value: resource });
78
- }
79
-
80
- for (const resource of argv.noResource || []) {
81
- filters.push({ type: 'resource', op: 'exclude', value: resource });
82
- }
83
-
84
- for (const tool of argv.tool || []) {
85
- filters.push({ type: 'tool', op: 'include', value: tool });
86
- }
87
-
88
- for (const tool of argv.noTool || []) {
89
- filters.push({ type: 'tool', op: 'exclude', value: tool });
90
- }
91
-
92
- for (const operation of argv.operation || []) {
93
- filters.push({ type: 'operation', op: 'include', value: operation });
94
- }
95
-
96
- for (const operation of argv.noOperation || []) {
97
- filters.push({ type: 'operation', op: 'exclude', value: operation });
98
- }
99
-
100
- const filteredEndpoints = query(filters, endpoints);
101
-
102
- if (filteredEndpoints.length === 0) {
103
- console.error('No tools match the provided filters.');
104
- process.exit(1);
105
- }
14
+ const includedTools = selectToolsOrError(endpoints, options);
106
15
 
107
16
  console.error(
108
- `MCP Server starting with ${filteredEndpoints.length} tools:`,
109
- filteredEndpoints.map((e) => e.tool.name),
17
+ `MCP Server starting with ${includedTools.length} tools:`,
18
+ includedTools.map((e) => e.tool.name),
110
19
  );
111
20
 
112
- init({ server, endpoints: filteredEndpoints });
21
+ init({ server, endpoints: includedTools });
113
22
 
114
23
  const transport = new StdioServerTransport();
115
24
  await server.connect(transport);
@@ -123,12 +32,39 @@ if (require.main === module) {
123
32
  });
124
33
  }
125
34
 
35
+ function parseOptionsOrError() {
36
+ try {
37
+ return parseOptions();
38
+ } catch (error) {
39
+ console.error('Error parsing options:', error);
40
+ process.exit(1);
41
+ }
42
+ }
43
+
44
+ function selectToolsOrError(endpoints: Endpoint[], options: ParsedOptions) {
45
+ try {
46
+ const includedTools = selectTools(endpoints, options);
47
+ if (includedTools.length === 0) {
48
+ console.error('No tools match the provided filters.');
49
+ process.exit(1);
50
+ }
51
+ return includedTools;
52
+ } catch (error) {
53
+ if (error instanceof Error) {
54
+ console.error('Error filtering tools:', error.message);
55
+ } else {
56
+ console.error('Error filtering tools:', error);
57
+ }
58
+ process.exit(1);
59
+ }
60
+ }
61
+
126
62
  function listAllTools() {
127
63
  if (endpoints.length === 0) {
128
- console.error('No tools available.');
64
+ console.log('No tools available.');
129
65
  return;
130
66
  }
131
- console.error('Available tools:\n');
67
+ console.log('Available tools:\n');
132
68
 
133
69
  // Group endpoints by resource
134
70
  const resourceGroups = new Map<string, typeof endpoints>();
@@ -146,7 +82,7 @@ function listAllTools() {
146
82
 
147
83
  // Display hierarchically by resource
148
84
  for (const resource of sortedResources) {
149
- console.error(`Resource: ${resource}`);
85
+ console.log(`Resource: ${resource}`);
150
86
 
151
87
  const resourceEndpoints = resourceGroups.get(resource)!;
152
88
  // Sort endpoints by tool name
@@ -158,33 +94,9 @@ function listAllTools() {
158
94
  metadata: { operation, tags },
159
95
  } = endpoint;
160
96
 
161
- console.error(` - ${tool.name} (${operation}) ${tags.length > 0 ? `tags: ${tags.join(', ')}` : ''}`);
162
- console.error(` Description: ${tool.description}`);
97
+ console.log(` - ${tool.name} (${operation}) ${tags.length > 0 ? `tags: ${tags.join(', ')}` : ''}`);
98
+ console.log(` Description: ${tool.description}`);
163
99
  }
164
- console.error('');
100
+ console.log('');
165
101
  }
166
102
  }
167
-
168
- function examples(): [string, string][] {
169
- const firstEndpoint = endpoints[0]!;
170
- const secondEndpoint =
171
- endpoints.find((e) => e.metadata.resource !== firstEndpoint.metadata.resource) || endpoints[1];
172
- const tag = endpoints.find((e) => e.metadata.tags.length > 0)?.metadata.tags[0];
173
- const otherEndpoint = secondEndpoint || firstEndpoint;
174
-
175
- return [
176
- [
177
- `--tool="${firstEndpoint.tool.name}" ${secondEndpoint ? `--tool="${secondEndpoint.tool.name}"` : ''}`,
178
- 'Include tools by name',
179
- ],
180
- [
181
- `--resource="${firstEndpoint.metadata.resource}" --operation="read"`,
182
- 'Filter by resource and operation',
183
- ],
184
- [
185
- `--resource="${otherEndpoint.metadata.resource}*" --no-tool="${otherEndpoint.tool.name}"`,
186
- 'Use resource wildcards and exclusions',
187
- ],
188
- ...(tag ? [[`--tag="${tag}"`, 'Filter based on tags'] as [string, string]] : []),
189
- ];
190
- }
package/src/options.ts ADDED
@@ -0,0 +1,361 @@
1
+ import yargs from 'yargs';
2
+ import { hideBin } from 'yargs/helpers';
3
+ import { endpoints, Filter } from './tools';
4
+ import { ClientCapabilities } from './compat';
5
+
6
+ type ClientType = 'openai-agents' | 'claude' | 'claude-code' | 'cursor';
7
+
8
+ // Client presets for compatibility
9
+ // Note that these could change over time as models get better, so this is
10
+ // a best effort.
11
+ const CLIENT_PRESETS: Record<ClientType, ClientCapabilities> = {
12
+ 'openai-agents': {
13
+ topLevelUnions: false,
14
+ validJson: true,
15
+ refs: true,
16
+ unions: true,
17
+ formats: true,
18
+ toolNameLength: undefined,
19
+ },
20
+ claude: {
21
+ topLevelUnions: true,
22
+ validJson: false,
23
+ refs: true,
24
+ unions: true,
25
+ formats: true,
26
+ toolNameLength: undefined,
27
+ },
28
+ 'claude-code': {
29
+ topLevelUnions: false,
30
+ validJson: true,
31
+ refs: true,
32
+ unions: true,
33
+ formats: true,
34
+ toolNameLength: undefined,
35
+ },
36
+ cursor: {
37
+ topLevelUnions: false,
38
+ validJson: true,
39
+ refs: false,
40
+ unions: false,
41
+ formats: false,
42
+ toolNameLength: 50,
43
+ },
44
+ };
45
+
46
+ export interface ParsedOptions {
47
+ includeDynamicTools: boolean | undefined;
48
+ includeAllTools: boolean | undefined;
49
+ filters: Filter[];
50
+ capabilities: ClientCapabilities;
51
+ list: boolean;
52
+ }
53
+
54
+ const CAPABILITY_CHOICES = [
55
+ 'top-level-unions',
56
+ 'valid-json',
57
+ 'refs',
58
+ 'unions',
59
+ 'formats',
60
+ 'tool-name-length',
61
+ ] as const;
62
+
63
+ type Capability = (typeof CAPABILITY_CHOICES)[number];
64
+
65
+ function parseCapabilityValue(cap: string): { name: Capability; value?: number } {
66
+ if (cap.startsWith('tool-name-length=')) {
67
+ const parts = cap.split('=');
68
+ if (parts.length === 2) {
69
+ const length = parseInt(parts[1]!, 10);
70
+ if (!isNaN(length)) {
71
+ return { name: 'tool-name-length', value: length };
72
+ }
73
+ throw new Error(`Invalid tool-name-length value: ${parts[1]}. Expected a number.`);
74
+ }
75
+ throw new Error(`Invalid format for tool-name-length. Expected tool-name-length=N.`);
76
+ }
77
+ if (!CAPABILITY_CHOICES.includes(cap as Capability)) {
78
+ throw new Error(`Unknown capability: ${cap}. Valid capabilities are: ${CAPABILITY_CHOICES.join(', ')}`);
79
+ }
80
+ return { name: cap as Capability };
81
+ }
82
+
83
+ export function parseOptions(): ParsedOptions {
84
+ const opts = yargs(hideBin(process.argv))
85
+ .option('tools', {
86
+ type: 'string',
87
+ array: true,
88
+ choices: ['dynamic', 'all'],
89
+ description: 'Use dynamic tools or all tools',
90
+ })
91
+ .option('no-tools', {
92
+ type: 'string',
93
+ array: true,
94
+ choices: ['dynamic', 'all'],
95
+ description: 'Do not use any dynamic or all tools',
96
+ })
97
+ .option('tool', {
98
+ type: 'string',
99
+ array: true,
100
+ description: 'Include tools matching the specified names',
101
+ })
102
+ .option('resource', {
103
+ type: 'string',
104
+ array: true,
105
+ description: 'Include tools matching the specified resources',
106
+ })
107
+ .option('operation', {
108
+ type: 'string',
109
+ array: true,
110
+ choices: ['read', 'write'],
111
+ description: 'Include tools matching the specified operations',
112
+ })
113
+ .option('tag', {
114
+ type: 'string',
115
+ array: true,
116
+ description: 'Include tools with the specified tags',
117
+ })
118
+ .option('no-tool', {
119
+ type: 'string',
120
+ array: true,
121
+ description: 'Exclude tools matching the specified names',
122
+ })
123
+ .option('no-resource', {
124
+ type: 'string',
125
+ array: true,
126
+ description: 'Exclude tools matching the specified resources',
127
+ })
128
+ .option('no-operation', {
129
+ type: 'string',
130
+ array: true,
131
+ description: 'Exclude tools matching the specified operations',
132
+ })
133
+ .option('no-tag', {
134
+ type: 'string',
135
+ array: true,
136
+ description: 'Exclude tools with the specified tags',
137
+ })
138
+ .option('list', {
139
+ type: 'boolean',
140
+ description: 'List all tools and exit',
141
+ })
142
+ .option('client', {
143
+ type: 'string',
144
+ choices: Object.keys(CLIENT_PRESETS),
145
+ description: 'Specify the MCP client being used',
146
+ })
147
+ .option('capability', {
148
+ type: 'string',
149
+ array: true,
150
+ description: 'Specify client capabilities',
151
+ coerce: (values: string[]) => {
152
+ return values.flatMap((v) => v.split(','));
153
+ },
154
+ })
155
+ .option('no-capability', {
156
+ type: 'string',
157
+ array: true,
158
+ description: 'Unset client capabilities',
159
+ choices: CAPABILITY_CHOICES,
160
+ coerce: (values: string[]) => {
161
+ return values.flatMap((v) => v.split(','));
162
+ },
163
+ })
164
+ .option('describe-capabilities', {
165
+ type: 'boolean',
166
+ description: 'Print detailed explanation of client capabilities and exit',
167
+ })
168
+ .help();
169
+
170
+ for (const [command, desc] of examples()) {
171
+ opts.example(command, desc);
172
+ }
173
+
174
+ const argv = opts.parseSync();
175
+
176
+ // Handle describe-capabilities flag
177
+ if (argv.describeCapabilities) {
178
+ console.log(getCapabilitiesExplanation());
179
+ process.exit(0);
180
+ }
181
+
182
+ const filters: Filter[] = [];
183
+
184
+ // Helper function to support comma-separated values
185
+ const splitValues = (values: string[] | undefined): string[] => {
186
+ if (!values) return [];
187
+ return values.flatMap((v) => v.split(','));
188
+ };
189
+
190
+ for (const tag of splitValues(argv.tag)) {
191
+ filters.push({ type: 'tag', op: 'include', value: tag });
192
+ }
193
+
194
+ for (const tag of splitValues(argv.noTag)) {
195
+ filters.push({ type: 'tag', op: 'exclude', value: tag });
196
+ }
197
+
198
+ for (const resource of splitValues(argv.resource)) {
199
+ filters.push({ type: 'resource', op: 'include', value: resource });
200
+ }
201
+
202
+ for (const resource of splitValues(argv.noResource)) {
203
+ filters.push({ type: 'resource', op: 'exclude', value: resource });
204
+ }
205
+
206
+ for (const tool of splitValues(argv.tool)) {
207
+ filters.push({ type: 'tool', op: 'include', value: tool });
208
+ }
209
+
210
+ for (const tool of splitValues(argv.noTool)) {
211
+ filters.push({ type: 'tool', op: 'exclude', value: tool });
212
+ }
213
+
214
+ for (const operation of splitValues(argv.operation)) {
215
+ filters.push({ type: 'operation', op: 'include', value: operation });
216
+ }
217
+
218
+ for (const operation of splitValues(argv.noOperation)) {
219
+ filters.push({ type: 'operation', op: 'exclude', value: operation });
220
+ }
221
+
222
+ // Parse client capabilities
223
+ const clientCapabilities: ClientCapabilities = {
224
+ topLevelUnions: true,
225
+ validJson: true,
226
+ refs: true,
227
+ unions: true,
228
+ formats: true,
229
+ toolNameLength: undefined,
230
+ };
231
+
232
+ // Apply client preset if specified
233
+ if (typeof argv.client === 'string') {
234
+ const clientKey = argv.client as ClientType;
235
+ if (CLIENT_PRESETS[clientKey]) {
236
+ Object.assign(clientCapabilities, CLIENT_PRESETS[clientKey]);
237
+ }
238
+ }
239
+
240
+ // Apply individual capability overrides
241
+ if (Array.isArray(argv.capability)) {
242
+ for (const cap of argv.capability) {
243
+ const parsedCap = parseCapabilityValue(cap);
244
+ if (parsedCap.name === 'top-level-unions') {
245
+ clientCapabilities.topLevelUnions = true;
246
+ } else if (parsedCap.name === 'valid-json') {
247
+ clientCapabilities.validJson = true;
248
+ } else if (parsedCap.name === 'refs') {
249
+ clientCapabilities.refs = true;
250
+ } else if (parsedCap.name === 'unions') {
251
+ clientCapabilities.unions = true;
252
+ } else if (parsedCap.name === 'formats') {
253
+ clientCapabilities.formats = true;
254
+ } else if (parsedCap.name === 'tool-name-length') {
255
+ clientCapabilities.toolNameLength = parsedCap.value;
256
+ }
257
+ }
258
+ }
259
+
260
+ // Handle no-capability options to unset capabilities
261
+ if (Array.isArray(argv.noCapability)) {
262
+ for (const cap of argv.noCapability) {
263
+ if (cap === 'top-level-unions') {
264
+ clientCapabilities.topLevelUnions = false;
265
+ } else if (cap === 'valid-json') {
266
+ clientCapabilities.validJson = false;
267
+ } else if (cap === 'refs') {
268
+ clientCapabilities.refs = false;
269
+ } else if (cap === 'unions') {
270
+ clientCapabilities.unions = false;
271
+ } else if (cap === 'formats') {
272
+ clientCapabilities.formats = false;
273
+ } else if (cap === 'tool-name-length') {
274
+ clientCapabilities.toolNameLength = undefined;
275
+ }
276
+ }
277
+ }
278
+
279
+ const explicitTools = Boolean(argv.tools || argv.noTools);
280
+ const includeDynamicTools =
281
+ explicitTools ? argv.tools?.includes('dynamic') && !argv.noTools?.includes('dynamic') : undefined;
282
+ const includeAllTools =
283
+ explicitTools ? argv.tools?.includes('all') && !argv.noTools?.includes('all') : undefined;
284
+
285
+ return {
286
+ includeDynamicTools,
287
+ includeAllTools,
288
+ filters,
289
+ capabilities: clientCapabilities,
290
+ list: argv.list || false,
291
+ };
292
+ }
293
+
294
+ function getCapabilitiesExplanation(): string {
295
+ return `
296
+ Client Capabilities Explanation:
297
+
298
+ Different Language Models (LLMs) and the MCP clients that use them have varying limitations in how they handle tool schemas. Capability flags allow you to inform the MCP server about these limitations.
299
+
300
+ When a capability flag is set to false, the MCP server will automatically adjust the tool schemas to work around that limitation, ensuring broader compatibility.
301
+
302
+ Available Capabilities:
303
+
304
+ # top-level-unions
305
+ Some clients/LLMs do not support JSON schemas with a union type (anyOf) at the root level. If a client lacks this capability, the MCP server splits tools with top-level unions into multiple separate tools, one for each variant in the union.
306
+
307
+ # refs
308
+ Some clients/LLMs do not support $ref pointers for schema reuse. If a client lacks this capability, the MCP server automatically inlines all references ($defs) directly into the schema. Properties that would cause circular references are removed during this process.
309
+
310
+ # valid-json
311
+ Some clients/LLMs may incorrectly send arguments as a JSON-encoded string instead of a proper JSON object. If a client *has* this capability, the MCP server will attempt to parse string values as JSON if the initial validation against the schema fails.
312
+
313
+ # unions
314
+ Some clients/LLMs do not support union types (anyOf) in JSON schemas. If a client lacks this capability, the MCP server removes all anyOf fields and uses only the first variant as the schema.
315
+
316
+ # formats
317
+ Some clients/LLMs do not support the 'format' keyword in JSON Schema specifications. If a client lacks this capability, the MCP server removes all format fields and appends the format information to the field's description in parentheses.
318
+
319
+ # tool-name-length=N
320
+ Some clients/LLMs impose a maximum length on tool names. If this capability is set, the MCP server will automatically truncate tool names exceeding the specified length (N), ensuring uniqueness by appending numbers if necessary.
321
+
322
+ Client Presets (--client):
323
+ Presets like '--client=openai-agents' or '--client=cursor' automatically configure these capabilities based on current known limitations of those clients, simplifying setup.
324
+
325
+ Current presets:
326
+ ${JSON.stringify(CLIENT_PRESETS, null, 2)}
327
+ `;
328
+ }
329
+
330
+ function examples(): [string, string][] {
331
+ const firstEndpoint = endpoints[0]!;
332
+ const secondEndpoint =
333
+ endpoints.find((e) => e.metadata.resource !== firstEndpoint.metadata.resource) || endpoints[1];
334
+ const tag = endpoints.find((e) => e.metadata.tags.length > 0)?.metadata.tags[0];
335
+ const otherEndpoint = secondEndpoint || firstEndpoint;
336
+
337
+ return [
338
+ [
339
+ `--tool="${firstEndpoint.tool.name}" ${secondEndpoint ? `--tool="${secondEndpoint.tool.name}"` : ''}`,
340
+ 'Include tools by name',
341
+ ],
342
+ [
343
+ `--resource="${firstEndpoint.metadata.resource}" --operation="read"`,
344
+ 'Filter by resource and operation',
345
+ ],
346
+ [
347
+ `--resource="${otherEndpoint.metadata.resource}*" --no-tool="${otherEndpoint.tool.name}"`,
348
+ 'Use resource wildcards and exclusions',
349
+ ],
350
+ [`--client="cursor"`, 'Adjust schemas to be more compatible with Cursor'],
351
+ [
352
+ `--capability="top-level-unions" --capability="tool-name-length=40"`,
353
+ 'Specify individual client capabilities',
354
+ ],
355
+ [
356
+ `--client="cursor" --no-capability="tool-name-length"`,
357
+ 'Use cursor client preset but remove tool name length limit',
358
+ ],
359
+ ...(tag ? [[`--tag="${tag}"`, 'Filter based on tags'] as [string, string]] : []),
360
+ ];
361
+ }
package/src/server.ts CHANGED
@@ -2,16 +2,24 @@
2
2
 
3
3
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
4
4
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
5
- import { endpoints, HandlerFunction } from './tools';
5
+ import { Endpoint, endpoints, HandlerFunction, query } from './tools';
6
6
  import { CallToolRequestSchema, ListToolsRequestSchema, Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import Finch from '@tryfinch/finch-api';
8
+ import {
9
+ applyCompatibilityTransformations,
10
+ ClientCapabilities,
11
+ defaultClientCapabilities,
12
+ parseEmbeddedJSON,
13
+ } from './compat';
14
+ import { dynamicTools } from './dynamic-tools';
15
+ import { ParsedOptions } from './options';
8
16
  export { endpoints } from './tools';
9
17
 
10
18
  // Create server instance
11
19
  export const server = new McpServer(
12
20
  {
13
21
  name: 'tryfinch_finch_api_api',
14
- version: '6.27.0',
22
+ version: '6.29.0',
15
23
  },
16
24
  {
17
25
  capabilities: {
@@ -28,42 +36,69 @@ export function init(params: {
28
36
  server: Server | McpServer;
29
37
  client?: Finch;
30
38
  endpoints?: { tool: Tool; handler: HandlerFunction }[];
39
+ capabilities?: Partial<ClientCapabilities>;
31
40
  }) {
32
41
  const server = params.server instanceof McpServer ? params.server.server : params.server;
33
42
  const providedEndpoints = params.endpoints || endpoints;
34
- const tools = providedEndpoints.map((endpoint) => endpoint.tool);
35
- const handlers = Object.fromEntries(
36
- providedEndpoints.map((endpoint) => [endpoint.tool.name, endpoint.handler]),
37
- );
43
+
44
+ const endpointMap = Object.fromEntries(providedEndpoints.map((endpoint) => [endpoint.tool.name, endpoint]));
38
45
 
39
46
  const client = params.client || new Finch({ accessToken: readEnv('FINCH_ACCESS_TOKEN') });
40
47
 
41
48
  server.setRequestHandler(ListToolsRequestSchema, async () => {
42
49
  return {
43
- tools,
50
+ tools: providedEndpoints.map((endpoint) => endpoint.tool),
44
51
  };
45
52
  });
46
53
 
47
54
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
48
55
  const { name, arguments: args } = request.params;
49
-
50
- const handler = handlers[name];
51
- if (!handler) {
56
+ const endpoint = endpointMap[name];
57
+ if (!endpoint) {
52
58
  throw new Error(`Unknown tool: ${name}`);
53
59
  }
54
60
 
55
- return executeHandler(handler, client, args);
61
+ return executeHandler(endpoint.tool, endpoint.handler, client, args, params.capabilities);
56
62
  });
57
63
  }
58
64
 
65
+ /**
66
+ * Selects the tools to include in the MCP Server based on the provided options.
67
+ */
68
+ export function selectTools(endpoints: Endpoint[], options: ParsedOptions) {
69
+ const filteredEndpoints = query(options.filters, endpoints);
70
+
71
+ const includedTools = filteredEndpoints;
72
+
73
+ if (options.includeAllTools && includedTools.length === 0) {
74
+ includedTools.push(...endpoints);
75
+ }
76
+
77
+ if (options.includeDynamicTools) {
78
+ includedTools.push(...dynamicTools(endpoints));
79
+ }
80
+
81
+ if (includedTools.length === 0) {
82
+ includedTools.push(...endpoints);
83
+ }
84
+
85
+ return applyCompatibilityTransformations(includedTools, options.capabilities);
86
+ }
87
+
59
88
  /**
60
89
  * Runs the provided handler with the given client and arguments.
61
90
  */
62
91
  export async function executeHandler(
92
+ tool: Tool,
63
93
  handler: HandlerFunction,
64
94
  client: Finch,
65
95
  args: Record<string, unknown> | undefined,
96
+ compatibilityOptions?: Partial<ClientCapabilities>,
66
97
  ) {
98
+ const options = { ...defaultClientCapabilities, ...compatibilityOptions };
99
+ if (options.validJson && args) {
100
+ args = args = parseEmbeddedJSON(args, tool.inputSchema);
101
+ }
67
102
  const result = await handler(client, args || {});
68
103
  return {
69
104
  content: [
@@ -32,8 +32,8 @@ export const tool: Tool = {
32
32
  },
33
33
  };
34
34
 
35
- export const handler = (client: Finch, args: any) => {
36
- const { ...body } = args;
35
+ export const handler = (client: Finch, args: Record<string, unknown> | undefined) => {
36
+ const body = args as any;
37
37
  return client.accessTokens.create(body);
38
38
  };
39
39
 
@@ -19,8 +19,7 @@ export const tool: Tool = {
19
19
  },
20
20
  };
21
21
 
22
- export const handler = (client: Finch, args: any) => {
23
- const {} = args;
22
+ export const handler = (client: Finch, args: Record<string, unknown> | undefined) => {
24
23
  return client.account.disconnect();
25
24
  };
26
25