@tryfinch/finch-api-mcp 6.31.0 → 7.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.
- package/README.md +85 -10
- package/code-tool-types.d.mts +16 -0
- package/code-tool-types.d.mts.map +1 -0
- package/code-tool-types.d.ts +16 -0
- package/code-tool-types.d.ts.map +1 -0
- package/code-tool-types.js +4 -0
- package/code-tool-types.js.map +1 -0
- package/code-tool-types.mjs +3 -0
- package/code-tool-types.mjs.map +1 -0
- package/code-tool.d.mts +54 -0
- package/code-tool.d.mts.map +1 -0
- package/code-tool.d.ts +54 -0
- package/code-tool.d.ts.map +1 -0
- package/code-tool.js +54 -0
- package/code-tool.js.map +1 -0
- package/code-tool.mjs +51 -0
- package/code-tool.mjs.map +1 -0
- package/compat.d.mts +6 -0
- package/compat.d.mts.map +1 -1
- package/compat.d.ts +6 -0
- package/compat.d.ts.map +1 -1
- package/compat.js +52 -7
- package/compat.js.map +1 -1
- package/compat.mjs +52 -6
- package/compat.mjs.map +1 -1
- package/docs-search-tool.d.mts +50 -0
- package/docs-search-tool.d.mts.map +1 -0
- package/docs-search-tool.d.ts +50 -0
- package/docs-search-tool.d.ts.map +1 -0
- package/docs-search-tool.js +51 -0
- package/docs-search-tool.js.map +1 -0
- package/docs-search-tool.mjs +47 -0
- package/docs-search-tool.mjs.map +1 -0
- package/dynamic-tools.d.mts +2 -2
- package/dynamic-tools.d.mts.map +1 -1
- package/dynamic-tools.d.ts +2 -2
- package/dynamic-tools.d.ts.map +1 -1
- package/dynamic-tools.js +11 -9
- package/dynamic-tools.js.map +1 -1
- package/dynamic-tools.mjs +11 -9
- package/dynamic-tools.mjs.map +1 -1
- package/filtering.d.mts +3 -0
- package/filtering.d.mts.map +1 -0
- package/filtering.d.ts +3 -0
- package/filtering.d.ts.map +1 -0
- package/filtering.js +24 -0
- package/filtering.js.map +1 -0
- package/filtering.mjs +16 -0
- package/filtering.mjs.map +1 -0
- package/headers.d.mts +4 -0
- package/headers.d.mts.map +1 -0
- package/headers.d.ts +4 -0
- package/headers.d.ts.map +1 -0
- package/headers.js +31 -0
- package/headers.js.map +1 -0
- package/headers.mjs +27 -0
- package/headers.mjs.map +1 -0
- package/http.d.mts +9 -0
- package/http.d.mts.map +1 -0
- package/http.d.ts +9 -0
- package/http.d.ts.map +1 -0
- package/http.js +108 -0
- package/http.js.map +1 -0
- package/http.mjs +100 -0
- package/http.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/index.js +15 -10
- package/index.js.map +1 -1
- package/index.mjs +18 -12
- package/index.mjs.map +1 -1
- package/options.d.mts +17 -8
- package/options.d.mts.map +1 -1
- package/options.d.ts +17 -8
- package/options.d.ts.map +1 -1
- package/options.js +151 -61
- package/options.js.map +1 -1
- package/options.mjs +149 -60
- package/options.mjs.map +1 -1
- package/package.json +161 -12
- package/server.d.mts +12 -15
- package/server.d.mts.map +1 -1
- package/server.d.ts +12 -15
- package/server.d.ts.map +1 -1
- package/server.js +107 -36
- package/server.js.map +1 -1
- package/server.mjs +105 -36
- package/server.mjs.map +1 -1
- package/src/code-tool-types.ts +18 -0
- package/src/code-tool.ts +64 -0
- package/src/compat.ts +60 -6
- package/src/docs-search-tool.ts +59 -0
- package/src/dynamic-tools.ts +13 -12
- package/src/filtering.ts +18 -0
- package/src/headers.ts +35 -0
- package/src/http.ts +127 -0
- package/src/index.ts +20 -14
- package/src/options.ts +185 -73
- package/src/server.ts +128 -48
- package/src/stdio.ts +13 -0
- package/src/tools/access-tokens/create-access-tokens.ts +30 -5
- package/src/tools/account/disconnect-account.ts +28 -5
- package/src/tools/account/introspect-account.ts +30 -5
- package/src/tools/connect/sessions/new-connect-sessions.ts +46 -14
- package/src/tools/connect/sessions/reauthenticate-connect-sessions.ts +32 -9
- package/src/tools/hris/benefits/create-hris-benefits.ts +45 -18
- package/src/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.ts +55 -10
- package/src/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.ts +37 -5
- package/src/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.ts +36 -5
- package/src/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.ts +37 -5
- package/src/tools/hris/benefits/list-hris-benefits.ts +38 -5
- package/src/tools/hris/benefits/list-supported-benefits-hris-benefits.ts +38 -5
- package/src/tools/hris/benefits/retrieve-hris-benefits.ts +37 -5
- package/src/tools/hris/benefits/update-hris-benefits.ts +35 -5
- package/src/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.ts +35 -5
- package/src/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.ts +35 -7
- package/src/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.ts +36 -5
- package/src/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.ts +37 -5
- package/src/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.ts +37 -5
- package/src/tools/hris/company/retrieve-hris-company.ts +37 -5
- package/src/tools/hris/directory/list-hris-directory.ts +36 -5
- package/src/tools/hris/documents/list-hris-documents.ts +34 -5
- package/src/tools/hris/documents/retreive-hris-documents.ts +36 -5
- package/src/tools/hris/employments/retrieve-many-hris-employments.ts +24 -3
- package/src/tools/hris/individuals/retrieve-many-hris-individuals.ts +34 -7
- package/src/tools/hris/pay-statements/retrieve-many-hris-pay-statements.ts +24 -3
- package/src/tools/hris/payments/list-hris-payments.ts +36 -5
- package/src/tools/index.ts +6 -20
- package/src/tools/jobs/automated/create-jobs-automated.ts +28 -5
- package/src/tools/jobs/automated/list-jobs-automated.ts +27 -5
- package/src/tools/jobs/automated/retrieve-jobs-automated.ts +28 -5
- package/src/tools/jobs/manual/retrieve-jobs-manual.ts +27 -5
- package/src/tools/payroll/pay-groups/list-payroll-pay-groups.ts +36 -5
- package/src/tools/payroll/pay-groups/retrieve-payroll-pay-groups.ts +37 -5
- package/src/tools/providers/list-providers.ts +31 -5
- package/src/tools/request-forwarding/forward-request-forwarding.ts +31 -9
- package/src/tools/sandbox/company/update-sandbox-company.ts +37 -9
- package/src/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.ts +28 -5
- package/src/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.ts +29 -6
- package/src/tools/sandbox/connections/create-sandbox-connections.ts +26 -5
- package/src/tools/sandbox/directory/create-sandbox-directory.ts +28 -12
- package/src/tools/sandbox/employment/update-sandbox-employment.ts +20 -7
- package/src/tools/sandbox/individual/update-sandbox-individual.ts +30 -7
- package/src/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.ts +32 -5
- package/src/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.ts +30 -5
- package/src/tools/sandbox/jobs/create-sandbox-jobs.ts +26 -5
- package/src/tools/sandbox/payment/create-sandbox-payment.ts +89 -173
- package/src/tools/types.ts +115 -0
- package/stdio.d.mts +3 -0
- package/stdio.d.mts.map +1 -0
- package/stdio.d.ts +3 -0
- package/stdio.d.ts.map +1 -0
- package/stdio.js +14 -0
- package/stdio.js.map +1 -0
- package/stdio.mjs +10 -0
- package/stdio.mjs.map +1 -0
- package/tools/access-tokens/create-access-tokens.d.mts +26 -7
- package/tools/access-tokens/create-access-tokens.d.mts.map +1 -1
- package/tools/access-tokens/create-access-tokens.d.ts +26 -7
- package/tools/access-tokens/create-access-tokens.d.ts.map +1 -1
- package/tools/access-tokens/create-access-tokens.js +32 -4
- package/tools/access-tokens/create-access-tokens.js.map +1 -1
- package/tools/access-tokens/create-access-tokens.mjs +29 -4
- package/tools/access-tokens/create-access-tokens.mjs.map +1 -1
- package/tools/account/disconnect-account.d.mts +26 -7
- package/tools/account/disconnect-account.d.mts.map +1 -1
- package/tools/account/disconnect-account.d.ts +26 -7
- package/tools/account/disconnect-account.d.ts.map +1 -1
- package/tools/account/disconnect-account.js +30 -4
- package/tools/account/disconnect-account.js.map +1 -1
- package/tools/account/disconnect-account.mjs +27 -4
- package/tools/account/disconnect-account.mjs.map +1 -1
- package/tools/account/introspect-account.d.mts +26 -7
- package/tools/account/introspect-account.d.mts.map +1 -1
- package/tools/account/introspect-account.d.ts +26 -7
- package/tools/account/introspect-account.d.ts.map +1 -1
- package/tools/account/introspect-account.js +32 -4
- package/tools/account/introspect-account.js.map +1 -1
- package/tools/account/introspect-account.mjs +29 -4
- package/tools/account/introspect-account.mjs.map +1 -1
- package/tools/connect/sessions/new-connect-sessions.d.mts +26 -7
- package/tools/connect/sessions/new-connect-sessions.d.mts.map +1 -1
- package/tools/connect/sessions/new-connect-sessions.d.ts +26 -7
- package/tools/connect/sessions/new-connect-sessions.d.ts.map +1 -1
- package/tools/connect/sessions/new-connect-sessions.js +47 -13
- package/tools/connect/sessions/new-connect-sessions.js.map +1 -1
- package/tools/connect/sessions/new-connect-sessions.mjs +44 -13
- package/tools/connect/sessions/new-connect-sessions.mjs.map +1 -1
- package/tools/connect/sessions/reauthenticate-connect-sessions.d.mts +26 -7
- package/tools/connect/sessions/reauthenticate-connect-sessions.d.mts.map +1 -1
- package/tools/connect/sessions/reauthenticate-connect-sessions.d.ts +26 -7
- package/tools/connect/sessions/reauthenticate-connect-sessions.d.ts.map +1 -1
- package/tools/connect/sessions/reauthenticate-connect-sessions.js +32 -8
- package/tools/connect/sessions/reauthenticate-connect-sessions.js.map +1 -1
- package/tools/connect/sessions/reauthenticate-connect-sessions.mjs +29 -8
- package/tools/connect/sessions/reauthenticate-connect-sessions.mjs.map +1 -1
- package/tools/hris/benefits/create-hris-benefits.d.mts +26 -7
- package/tools/hris/benefits/create-hris-benefits.d.mts.map +1 -1
- package/tools/hris/benefits/create-hris-benefits.d.ts +26 -7
- package/tools/hris/benefits/create-hris-benefits.d.ts.map +1 -1
- package/tools/hris/benefits/create-hris-benefits.js +48 -17
- package/tools/hris/benefits/create-hris-benefits.js.map +1 -1
- package/tools/hris/benefits/create-hris-benefits.mjs +45 -17
- package/tools/hris/benefits/create-hris-benefits.mjs.map +1 -1
- package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.mts +26 -7
- package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.mts.map +1 -1
- package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.ts +26 -7
- package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.d.ts.map +1 -1
- package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.js +54 -9
- package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.js.map +1 -1
- package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.mjs +51 -9
- package/tools/hris/benefits/individuals/enroll-many-benefits-hris-individuals.mjs.map +1 -1
- package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.mts +26 -7
- package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.mts.map +1 -1
- package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.ts +26 -7
- package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.d.ts.map +1 -1
- package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.js +37 -4
- package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.js.map +1 -1
- package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.mjs +34 -4
- package/tools/hris/benefits/individuals/enrolled-ids-benefits-hris-individuals.mjs.map +1 -1
- package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.mts +26 -7
- package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.mts.map +1 -1
- package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.ts +26 -7
- package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.d.ts.map +1 -1
- package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.js +38 -4
- package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.js.map +1 -1
- package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.mjs +35 -4
- package/tools/hris/benefits/individuals/retrieve-many-benefits-benefits-hris-individuals.mjs.map +1 -1
- package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.mts +26 -7
- package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.mts.map +1 -1
- package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.ts +26 -7
- package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.d.ts.map +1 -1
- package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.js +37 -4
- package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.js.map +1 -1
- package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.mjs +34 -4
- package/tools/hris/benefits/individuals/unenroll-many-benefits-hris-individuals.mjs.map +1 -1
- package/tools/hris/benefits/list-hris-benefits.d.mts +26 -7
- package/tools/hris/benefits/list-hris-benefits.d.mts.map +1 -1
- package/tools/hris/benefits/list-hris-benefits.d.ts +26 -7
- package/tools/hris/benefits/list-hris-benefits.d.ts.map +1 -1
- package/tools/hris/benefits/list-hris-benefits.js +40 -4
- package/tools/hris/benefits/list-hris-benefits.js.map +1 -1
- package/tools/hris/benefits/list-hris-benefits.mjs +37 -4
- package/tools/hris/benefits/list-hris-benefits.mjs.map +1 -1
- package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.mts +26 -7
- package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.mts.map +1 -1
- package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.ts +26 -7
- package/tools/hris/benefits/list-supported-benefits-hris-benefits.d.ts.map +1 -1
- package/tools/hris/benefits/list-supported-benefits-hris-benefits.js +40 -4
- package/tools/hris/benefits/list-supported-benefits-hris-benefits.js.map +1 -1
- package/tools/hris/benefits/list-supported-benefits-hris-benefits.mjs +37 -4
- package/tools/hris/benefits/list-supported-benefits-hris-benefits.mjs.map +1 -1
- package/tools/hris/benefits/retrieve-hris-benefits.d.mts +26 -7
- package/tools/hris/benefits/retrieve-hris-benefits.d.mts.map +1 -1
- package/tools/hris/benefits/retrieve-hris-benefits.d.ts +26 -7
- package/tools/hris/benefits/retrieve-hris-benefits.d.ts.map +1 -1
- package/tools/hris/benefits/retrieve-hris-benefits.js +37 -4
- package/tools/hris/benefits/retrieve-hris-benefits.js.map +1 -1
- package/tools/hris/benefits/retrieve-hris-benefits.mjs +34 -4
- package/tools/hris/benefits/retrieve-hris-benefits.mjs.map +1 -1
- package/tools/hris/benefits/update-hris-benefits.d.mts +26 -7
- package/tools/hris/benefits/update-hris-benefits.d.mts.map +1 -1
- package/tools/hris/benefits/update-hris-benefits.d.ts +26 -7
- package/tools/hris/benefits/update-hris-benefits.d.ts.map +1 -1
- package/tools/hris/benefits/update-hris-benefits.js +35 -4
- package/tools/hris/benefits/update-hris-benefits.js.map +1 -1
- package/tools/hris/benefits/update-hris-benefits.mjs +32 -4
- package/tools/hris/benefits/update-hris-benefits.mjs.map +1 -1
- package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.mts +26 -7
- package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.mts.map +1 -1
- package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.ts +26 -7
- package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.d.ts.map +1 -1
- package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.js +38 -4
- package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.js.map +1 -1
- package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.mjs +35 -4
- package/tools/hris/company/pay-statement-item/list-company-hris-pay-statement-item.mjs.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.mts +26 -7
- package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.mts.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.ts +26 -7
- package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.d.ts.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.js +36 -6
- package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.js.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.mjs +33 -6
- package/tools/hris/company/pay-statement-item/rules/create-pay-statement-item-company-hris-rules.mjs.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.mts +26 -7
- package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.mts.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.ts +26 -7
- package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.d.ts.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.js +37 -4
- package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.js.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.mjs +34 -4
- package/tools/hris/company/pay-statement-item/rules/delete-pay-statement-item-company-hris-rules.mjs.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.mts +26 -7
- package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.mts.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.ts +26 -7
- package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.d.ts.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.js +40 -4
- package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.js.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.mjs +37 -4
- package/tools/hris/company/pay-statement-item/rules/list-pay-statement-item-company-hris-rules.mjs.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.mts +26 -7
- package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.mts.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.ts +26 -7
- package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.d.ts.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.js +38 -4
- package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.js.map +1 -1
- package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.mjs +35 -4
- package/tools/hris/company/pay-statement-item/rules/update-pay-statement-item-company-hris-rules.mjs.map +1 -1
- package/tools/hris/company/retrieve-hris-company.d.mts +26 -7
- package/tools/hris/company/retrieve-hris-company.d.mts.map +1 -1
- package/tools/hris/company/retrieve-hris-company.d.ts +26 -7
- package/tools/hris/company/retrieve-hris-company.d.ts.map +1 -1
- package/tools/hris/company/retrieve-hris-company.js +39 -4
- package/tools/hris/company/retrieve-hris-company.js.map +1 -1
- package/tools/hris/company/retrieve-hris-company.mjs +36 -4
- package/tools/hris/company/retrieve-hris-company.mjs.map +1 -1
- package/tools/hris/directory/list-hris-directory.d.mts +26 -7
- package/tools/hris/directory/list-hris-directory.d.mts.map +1 -1
- package/tools/hris/directory/list-hris-directory.d.ts +26 -7
- package/tools/hris/directory/list-hris-directory.d.ts.map +1 -1
- package/tools/hris/directory/list-hris-directory.js +38 -4
- package/tools/hris/directory/list-hris-directory.js.map +1 -1
- package/tools/hris/directory/list-hris-directory.mjs +35 -4
- package/tools/hris/directory/list-hris-directory.mjs.map +1 -1
- package/tools/hris/documents/list-hris-documents.d.mts +26 -7
- package/tools/hris/documents/list-hris-documents.d.mts.map +1 -1
- package/tools/hris/documents/list-hris-documents.d.ts +26 -7
- package/tools/hris/documents/list-hris-documents.d.ts.map +1 -1
- package/tools/hris/documents/list-hris-documents.js +37 -4
- package/tools/hris/documents/list-hris-documents.js.map +1 -1
- package/tools/hris/documents/list-hris-documents.mjs +34 -4
- package/tools/hris/documents/list-hris-documents.mjs.map +1 -1
- package/tools/hris/documents/retreive-hris-documents.d.mts +26 -7
- package/tools/hris/documents/retreive-hris-documents.d.mts.map +1 -1
- package/tools/hris/documents/retreive-hris-documents.d.ts +26 -7
- package/tools/hris/documents/retreive-hris-documents.d.ts.map +1 -1
- package/tools/hris/documents/retreive-hris-documents.js +37 -4
- package/tools/hris/documents/retreive-hris-documents.js.map +1 -1
- package/tools/hris/documents/retreive-hris-documents.mjs +34 -4
- package/tools/hris/documents/retreive-hris-documents.mjs.map +1 -1
- package/tools/hris/employments/retrieve-many-hris-employments.d.mts +26 -7
- package/tools/hris/employments/retrieve-many-hris-employments.d.mts.map +1 -1
- package/tools/hris/employments/retrieve-many-hris-employments.d.ts +26 -7
- package/tools/hris/employments/retrieve-many-hris-employments.d.ts.map +1 -1
- package/tools/hris/employments/retrieve-many-hris-employments.js +28 -2
- package/tools/hris/employments/retrieve-many-hris-employments.js.map +1 -1
- package/tools/hris/employments/retrieve-many-hris-employments.mjs +25 -2
- package/tools/hris/employments/retrieve-many-hris-employments.mjs.map +1 -1
- package/tools/hris/individuals/retrieve-many-hris-individuals.d.mts +26 -7
- package/tools/hris/individuals/retrieve-many-hris-individuals.d.mts.map +1 -1
- package/tools/hris/individuals/retrieve-many-hris-individuals.d.ts +26 -7
- package/tools/hris/individuals/retrieve-many-hris-individuals.d.ts.map +1 -1
- package/tools/hris/individuals/retrieve-many-hris-individuals.js +36 -6
- package/tools/hris/individuals/retrieve-many-hris-individuals.js.map +1 -1
- package/tools/hris/individuals/retrieve-many-hris-individuals.mjs +33 -6
- package/tools/hris/individuals/retrieve-many-hris-individuals.mjs.map +1 -1
- package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.mts +26 -7
- package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.mts.map +1 -1
- package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.ts +26 -7
- package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.d.ts.map +1 -1
- package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.js +28 -2
- package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.js.map +1 -1
- package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.mjs +25 -2
- package/tools/hris/pay-statements/retrieve-many-hris-pay-statements.mjs.map +1 -1
- package/tools/hris/payments/list-hris-payments.d.mts +26 -7
- package/tools/hris/payments/list-hris-payments.d.mts.map +1 -1
- package/tools/hris/payments/list-hris-payments.d.ts +26 -7
- package/tools/hris/payments/list-hris-payments.d.ts.map +1 -1
- package/tools/hris/payments/list-hris-payments.js +38 -4
- package/tools/hris/payments/list-hris-payments.js.map +1 -1
- package/tools/hris/payments/list-hris-payments.mjs +35 -4
- package/tools/hris/payments/list-hris-payments.mjs.map +1 -1
- package/tools/index.d.mts +2 -13
- package/tools/index.d.mts.map +1 -1
- package/tools/index.d.ts +2 -13
- package/tools/index.d.ts.map +1 -1
- package/tools/index.js +3 -4
- package/tools/index.js.map +1 -1
- package/tools/index.mjs +3 -4
- package/tools/index.mjs.map +1 -1
- package/tools/jobs/automated/create-jobs-automated.d.mts +26 -7
- package/tools/jobs/automated/create-jobs-automated.d.mts.map +1 -1
- package/tools/jobs/automated/create-jobs-automated.d.ts +26 -7
- package/tools/jobs/automated/create-jobs-automated.d.ts.map +1 -1
- package/tools/jobs/automated/create-jobs-automated.js +31 -4
- package/tools/jobs/automated/create-jobs-automated.js.map +1 -1
- package/tools/jobs/automated/create-jobs-automated.mjs +28 -4
- package/tools/jobs/automated/create-jobs-automated.mjs.map +1 -1
- package/tools/jobs/automated/list-jobs-automated.d.mts +26 -7
- package/tools/jobs/automated/list-jobs-automated.d.mts.map +1 -1
- package/tools/jobs/automated/list-jobs-automated.d.ts +26 -7
- package/tools/jobs/automated/list-jobs-automated.d.ts.map +1 -1
- package/tools/jobs/automated/list-jobs-automated.js +30 -4
- package/tools/jobs/automated/list-jobs-automated.js.map +1 -1
- package/tools/jobs/automated/list-jobs-automated.mjs +27 -4
- package/tools/jobs/automated/list-jobs-automated.mjs.map +1 -1
- package/tools/jobs/automated/retrieve-jobs-automated.d.mts +26 -7
- package/tools/jobs/automated/retrieve-jobs-automated.d.mts.map +1 -1
- package/tools/jobs/automated/retrieve-jobs-automated.d.ts +26 -7
- package/tools/jobs/automated/retrieve-jobs-automated.d.ts.map +1 -1
- package/tools/jobs/automated/retrieve-jobs-automated.js +30 -4
- package/tools/jobs/automated/retrieve-jobs-automated.js.map +1 -1
- package/tools/jobs/automated/retrieve-jobs-automated.mjs +27 -4
- package/tools/jobs/automated/retrieve-jobs-automated.mjs.map +1 -1
- package/tools/jobs/manual/retrieve-jobs-manual.d.mts +26 -7
- package/tools/jobs/manual/retrieve-jobs-manual.d.mts.map +1 -1
- package/tools/jobs/manual/retrieve-jobs-manual.d.ts +26 -7
- package/tools/jobs/manual/retrieve-jobs-manual.d.ts.map +1 -1
- package/tools/jobs/manual/retrieve-jobs-manual.js +30 -4
- package/tools/jobs/manual/retrieve-jobs-manual.js.map +1 -1
- package/tools/jobs/manual/retrieve-jobs-manual.mjs +27 -4
- package/tools/jobs/manual/retrieve-jobs-manual.mjs.map +1 -1
- package/tools/payroll/pay-groups/list-payroll-pay-groups.d.mts +26 -7
- package/tools/payroll/pay-groups/list-payroll-pay-groups.d.mts.map +1 -1
- package/tools/payroll/pay-groups/list-payroll-pay-groups.d.ts +26 -7
- package/tools/payroll/pay-groups/list-payroll-pay-groups.d.ts.map +1 -1
- package/tools/payroll/pay-groups/list-payroll-pay-groups.js +38 -4
- package/tools/payroll/pay-groups/list-payroll-pay-groups.js.map +1 -1
- package/tools/payroll/pay-groups/list-payroll-pay-groups.mjs +35 -4
- package/tools/payroll/pay-groups/list-payroll-pay-groups.mjs.map +1 -1
- package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.mts +26 -7
- package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.mts.map +1 -1
- package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.ts +26 -7
- package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.d.ts.map +1 -1
- package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.js +37 -4
- package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.js.map +1 -1
- package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.mjs +34 -4
- package/tools/payroll/pay-groups/retrieve-payroll-pay-groups.mjs.map +1 -1
- package/tools/providers/list-providers.d.mts +26 -7
- package/tools/providers/list-providers.d.mts.map +1 -1
- package/tools/providers/list-providers.d.ts +26 -7
- package/tools/providers/list-providers.d.ts.map +1 -1
- package/tools/providers/list-providers.js +33 -4
- package/tools/providers/list-providers.js.map +1 -1
- package/tools/providers/list-providers.mjs +30 -4
- package/tools/providers/list-providers.mjs.map +1 -1
- package/tools/request-forwarding/forward-request-forwarding.d.mts +26 -7
- package/tools/request-forwarding/forward-request-forwarding.d.mts.map +1 -1
- package/tools/request-forwarding/forward-request-forwarding.d.ts +26 -7
- package/tools/request-forwarding/forward-request-forwarding.d.ts.map +1 -1
- package/tools/request-forwarding/forward-request-forwarding.js +34 -8
- package/tools/request-forwarding/forward-request-forwarding.js.map +1 -1
- package/tools/request-forwarding/forward-request-forwarding.mjs +31 -8
- package/tools/request-forwarding/forward-request-forwarding.mjs.map +1 -1
- package/tools/sandbox/company/update-sandbox-company.d.mts +26 -7
- package/tools/sandbox/company/update-sandbox-company.d.mts.map +1 -1
- package/tools/sandbox/company/update-sandbox-company.d.ts +26 -7
- package/tools/sandbox/company/update-sandbox-company.d.ts.map +1 -1
- package/tools/sandbox/company/update-sandbox-company.js +39 -8
- package/tools/sandbox/company/update-sandbox-company.js.map +1 -1
- package/tools/sandbox/company/update-sandbox-company.mjs +36 -8
- package/tools/sandbox/company/update-sandbox-company.mjs.map +1 -1
- package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.mts +26 -7
- package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.mts.map +1 -1
- package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.ts +26 -7
- package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.d.ts.map +1 -1
- package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.js +28 -4
- package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.js.map +1 -1
- package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.mjs +25 -4
- package/tools/sandbox/connections/accounts/create-connections-sandbox-accounts.mjs.map +1 -1
- package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.mts +26 -7
- package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.mts.map +1 -1
- package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.ts +26 -7
- package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.d.ts.map +1 -1
- package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.js +30 -5
- package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.js.map +1 -1
- package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.mjs +27 -5
- package/tools/sandbox/connections/accounts/update-connections-sandbox-accounts.mjs.map +1 -1
- package/tools/sandbox/connections/create-sandbox-connections.d.mts +26 -7
- package/tools/sandbox/connections/create-sandbox-connections.d.mts.map +1 -1
- package/tools/sandbox/connections/create-sandbox-connections.d.ts +26 -7
- package/tools/sandbox/connections/create-sandbox-connections.d.ts.map +1 -1
- package/tools/sandbox/connections/create-sandbox-connections.js +28 -4
- package/tools/sandbox/connections/create-sandbox-connections.js.map +1 -1
- package/tools/sandbox/connections/create-sandbox-connections.mjs +25 -4
- package/tools/sandbox/connections/create-sandbox-connections.mjs.map +1 -1
- package/tools/sandbox/directory/create-sandbox-directory.d.mts +26 -7
- package/tools/sandbox/directory/create-sandbox-directory.d.mts.map +1 -1
- package/tools/sandbox/directory/create-sandbox-directory.d.ts +26 -7
- package/tools/sandbox/directory/create-sandbox-directory.d.ts.map +1 -1
- package/tools/sandbox/directory/create-sandbox-directory.js +30 -11
- package/tools/sandbox/directory/create-sandbox-directory.js.map +1 -1
- package/tools/sandbox/directory/create-sandbox-directory.mjs +27 -11
- package/tools/sandbox/directory/create-sandbox-directory.mjs.map +1 -1
- package/tools/sandbox/employment/update-sandbox-employment.d.mts +26 -7
- package/tools/sandbox/employment/update-sandbox-employment.d.mts.map +1 -1
- package/tools/sandbox/employment/update-sandbox-employment.d.ts +26 -7
- package/tools/sandbox/employment/update-sandbox-employment.d.ts.map +1 -1
- package/tools/sandbox/employment/update-sandbox-employment.js +24 -6
- package/tools/sandbox/employment/update-sandbox-employment.js.map +1 -1
- package/tools/sandbox/employment/update-sandbox-employment.mjs +21 -6
- package/tools/sandbox/employment/update-sandbox-employment.mjs.map +1 -1
- package/tools/sandbox/individual/update-sandbox-individual.d.mts +26 -7
- package/tools/sandbox/individual/update-sandbox-individual.d.mts.map +1 -1
- package/tools/sandbox/individual/update-sandbox-individual.d.ts +26 -7
- package/tools/sandbox/individual/update-sandbox-individual.d.ts.map +1 -1
- package/tools/sandbox/individual/update-sandbox-individual.js +30 -6
- package/tools/sandbox/individual/update-sandbox-individual.js.map +1 -1
- package/tools/sandbox/individual/update-sandbox-individual.mjs +27 -6
- package/tools/sandbox/individual/update-sandbox-individual.mjs.map +1 -1
- package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.mts +26 -7
- package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.mts.map +1 -1
- package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.ts +26 -7
- package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.d.ts.map +1 -1
- package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.js +32 -4
- package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.js.map +1 -1
- package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.mjs +29 -4
- package/tools/sandbox/jobs/configuration/retrieve-jobs-sandbox-configuration.mjs.map +1 -1
- package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.mts +26 -7
- package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.mts.map +1 -1
- package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.ts +26 -7
- package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.d.ts.map +1 -1
- package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.js +30 -4
- package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.js.map +1 -1
- package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.mjs +27 -4
- package/tools/sandbox/jobs/configuration/update-jobs-sandbox-configuration.mjs.map +1 -1
- package/tools/sandbox/jobs/create-sandbox-jobs.d.mts +26 -7
- package/tools/sandbox/jobs/create-sandbox-jobs.d.mts.map +1 -1
- package/tools/sandbox/jobs/create-sandbox-jobs.d.ts +26 -7
- package/tools/sandbox/jobs/create-sandbox-jobs.d.ts.map +1 -1
- package/tools/sandbox/jobs/create-sandbox-jobs.js +28 -4
- package/tools/sandbox/jobs/create-sandbox-jobs.js.map +1 -1
- package/tools/sandbox/jobs/create-sandbox-jobs.mjs +25 -4
- package/tools/sandbox/jobs/create-sandbox-jobs.mjs.map +1 -1
- package/tools/sandbox/payment/create-sandbox-payment.d.mts +26 -7
- package/tools/sandbox/payment/create-sandbox-payment.d.mts.map +1 -1
- package/tools/sandbox/payment/create-sandbox-payment.d.ts +26 -7
- package/tools/sandbox/payment/create-sandbox-payment.d.ts.map +1 -1
- package/tools/sandbox/payment/create-sandbox-payment.js +91 -167
- package/tools/sandbox/payment/create-sandbox-payment.js.map +1 -1
- package/tools/sandbox/payment/create-sandbox-payment.mjs +88 -167
- package/tools/sandbox/payment/create-sandbox-payment.mjs.map +1 -1
- package/tools/types.d.mts +52 -0
- package/tools/types.d.mts.map +1 -0
- package/tools/types.d.ts +52 -0
- package/tools/types.d.ts.map +1 -0
- package/tools/types.js +58 -0
- package/tools/types.js.map +1 -0
- package/tools/types.mjs +53 -0
- package/tools/types.mjs.map +1 -0
- package/src/tools/hris/directory/list-individuals-hris-directory.ts +0 -36
- package/tools/hris/directory/list-individuals-hris-directory.d.mts +0 -32
- package/tools/hris/directory/list-individuals-hris-directory.d.mts.map +0 -1
- package/tools/hris/directory/list-individuals-hris-directory.d.ts +0 -32
- package/tools/hris/directory/list-individuals-hris-directory.d.ts.map +0 -1
- package/tools/hris/directory/list-individuals-hris-directory.js +0 -33
- package/tools/hris/directory/list-individuals-hris-directory.js.map +0 -1
- package/tools/hris/directory/list-individuals-hris-directory.mjs +0 -29
- package/tools/hris/directory/list-individuals-hris-directory.mjs.map +0 -1
package/src/options.ts
CHANGED
|
@@ -1,55 +1,26 @@
|
|
|
1
|
+
import qs from 'qs';
|
|
1
2
|
import yargs from 'yargs';
|
|
2
3
|
import { hideBin } from 'yargs/helpers';
|
|
4
|
+
import z from 'zod';
|
|
3
5
|
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
|
-
};
|
|
6
|
+
import { ClientCapabilities, knownClients, ClientType } from './compat';
|
|
45
7
|
|
|
46
|
-
export
|
|
47
|
-
includeDynamicTools: boolean | undefined;
|
|
48
|
-
includeAllTools: boolean | undefined;
|
|
49
|
-
filters: Filter[];
|
|
50
|
-
capabilities: ClientCapabilities;
|
|
8
|
+
export type CLIOptions = McpOptions & {
|
|
51
9
|
list: boolean;
|
|
52
|
-
|
|
10
|
+
transport: 'stdio' | 'http';
|
|
11
|
+
port: number | undefined;
|
|
12
|
+
socket: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type McpOptions = {
|
|
16
|
+
client?: ClientType | undefined;
|
|
17
|
+
includeDynamicTools?: boolean | undefined;
|
|
18
|
+
includeAllTools?: boolean | undefined;
|
|
19
|
+
includeCodeTools?: boolean | undefined;
|
|
20
|
+
includeDocsTools?: boolean | undefined;
|
|
21
|
+
filters?: Filter[] | undefined;
|
|
22
|
+
capabilities?: Partial<ClientCapabilities> | undefined;
|
|
23
|
+
};
|
|
53
24
|
|
|
54
25
|
const CAPABILITY_CHOICES = [
|
|
55
26
|
'top-level-unions',
|
|
@@ -80,18 +51,18 @@ function parseCapabilityValue(cap: string): { name: Capability; value?: number }
|
|
|
80
51
|
return { name: cap as Capability };
|
|
81
52
|
}
|
|
82
53
|
|
|
83
|
-
export function
|
|
54
|
+
export function parseCLIOptions(): CLIOptions {
|
|
84
55
|
const opts = yargs(hideBin(process.argv))
|
|
85
56
|
.option('tools', {
|
|
86
57
|
type: 'string',
|
|
87
58
|
array: true,
|
|
88
|
-
choices: ['dynamic', 'all'],
|
|
59
|
+
choices: ['dynamic', 'all', 'code', 'docs'],
|
|
89
60
|
description: 'Use dynamic tools or all tools',
|
|
90
61
|
})
|
|
91
62
|
.option('no-tools', {
|
|
92
63
|
type: 'string',
|
|
93
64
|
array: true,
|
|
94
|
-
choices: ['dynamic', 'all'],
|
|
65
|
+
choices: ['dynamic', 'all', 'code', 'docs'],
|
|
95
66
|
description: 'Do not use any dynamic or all tools',
|
|
96
67
|
})
|
|
97
68
|
.option('tool', {
|
|
@@ -141,7 +112,7 @@ export function parseOptions(): ParsedOptions {
|
|
|
141
112
|
})
|
|
142
113
|
.option('client', {
|
|
143
114
|
type: 'string',
|
|
144
|
-
choices: Object.keys(
|
|
115
|
+
choices: Object.keys(knownClients),
|
|
145
116
|
description: 'Specify the MCP client being used',
|
|
146
117
|
})
|
|
147
118
|
.option('capability', {
|
|
@@ -165,6 +136,20 @@ export function parseOptions(): ParsedOptions {
|
|
|
165
136
|
type: 'boolean',
|
|
166
137
|
description: 'Print detailed explanation of client capabilities and exit',
|
|
167
138
|
})
|
|
139
|
+
.option('transport', {
|
|
140
|
+
type: 'string',
|
|
141
|
+
choices: ['stdio', 'http'],
|
|
142
|
+
default: 'stdio',
|
|
143
|
+
description: 'What transport to use; stdio for local servers or http for remote servers',
|
|
144
|
+
})
|
|
145
|
+
.option('port', {
|
|
146
|
+
type: 'number',
|
|
147
|
+
description: 'Port to serve on if using http transport',
|
|
148
|
+
})
|
|
149
|
+
.option('socket', {
|
|
150
|
+
type: 'string',
|
|
151
|
+
description: 'Unix socket to serve on if using http transport',
|
|
152
|
+
})
|
|
168
153
|
.help();
|
|
169
154
|
|
|
170
155
|
for (const [command, desc] of examples()) {
|
|
@@ -220,22 +205,7 @@ export function parseOptions(): ParsedOptions {
|
|
|
220
205
|
}
|
|
221
206
|
|
|
222
207
|
// 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
|
-
}
|
|
208
|
+
const clientCapabilities: Partial<ClientCapabilities> = {};
|
|
239
209
|
|
|
240
210
|
// Apply individual capability overrides
|
|
241
211
|
if (Array.isArray(argv.capability)) {
|
|
@@ -276,18 +246,160 @@ export function parseOptions(): ParsedOptions {
|
|
|
276
246
|
}
|
|
277
247
|
}
|
|
278
248
|
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
249
|
+
const shouldIncludeToolType = (toolType: 'dynamic' | 'all' | 'code' | 'docs') =>
|
|
250
|
+
argv.noTools?.includes(toolType) ? false
|
|
251
|
+
: argv.tools?.includes(toolType) ? true
|
|
252
|
+
: undefined;
|
|
253
|
+
|
|
254
|
+
const includeDynamicTools = shouldIncludeToolType('dynamic');
|
|
255
|
+
const includeAllTools = shouldIncludeToolType('all');
|
|
256
|
+
const includeCodeTools = shouldIncludeToolType('code');
|
|
257
|
+
const includeDocsTools = shouldIncludeToolType('docs');
|
|
258
|
+
|
|
259
|
+
const transport = argv.transport as 'stdio' | 'http';
|
|
284
260
|
|
|
261
|
+
const client = argv.client as ClientType;
|
|
285
262
|
return {
|
|
263
|
+
client: client && client !== 'infer' && knownClients[client] ? client : undefined,
|
|
286
264
|
includeDynamicTools,
|
|
287
265
|
includeAllTools,
|
|
266
|
+
includeCodeTools,
|
|
267
|
+
includeDocsTools,
|
|
288
268
|
filters,
|
|
289
269
|
capabilities: clientCapabilities,
|
|
290
270
|
list: argv.list || false,
|
|
271
|
+
transport,
|
|
272
|
+
port: argv.port,
|
|
273
|
+
socket: argv.socket,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
const coerceArray = <T extends z.ZodTypeAny>(zodType: T) =>
|
|
278
|
+
z.preprocess(
|
|
279
|
+
(val) =>
|
|
280
|
+
Array.isArray(val) ? val
|
|
281
|
+
: val ? [val]
|
|
282
|
+
: val,
|
|
283
|
+
z.array(zodType).optional(),
|
|
284
|
+
);
|
|
285
|
+
|
|
286
|
+
const QueryOptions = z.object({
|
|
287
|
+
tools: coerceArray(z.enum(['dynamic', 'all', 'code', 'docs'])).describe('Specify which MCP tools to use'),
|
|
288
|
+
no_tools: coerceArray(z.enum(['dynamic', 'all', 'code', 'docs'])).describe(
|
|
289
|
+
'Specify which MCP tools to not use.',
|
|
290
|
+
),
|
|
291
|
+
tool: coerceArray(z.string()).describe('Include tools matching the specified names'),
|
|
292
|
+
resource: coerceArray(z.string()).describe('Include tools matching the specified resources'),
|
|
293
|
+
operation: coerceArray(z.enum(['read', 'write'])).describe(
|
|
294
|
+
'Include tools matching the specified operations',
|
|
295
|
+
),
|
|
296
|
+
tag: coerceArray(z.string()).describe('Include tools with the specified tags'),
|
|
297
|
+
no_tool: coerceArray(z.string()).describe('Exclude tools matching the specified names'),
|
|
298
|
+
no_resource: coerceArray(z.string()).describe('Exclude tools matching the specified resources'),
|
|
299
|
+
no_operation: coerceArray(z.enum(['read', 'write'])).describe(
|
|
300
|
+
'Exclude tools matching the specified operations',
|
|
301
|
+
),
|
|
302
|
+
no_tag: coerceArray(z.string()).describe('Exclude tools with the specified tags'),
|
|
303
|
+
client: ClientType.optional().describe('Specify the MCP client being used'),
|
|
304
|
+
capability: coerceArray(z.string()).describe('Specify client capabilities'),
|
|
305
|
+
no_capability: coerceArray(z.enum(CAPABILITY_CHOICES)).describe('Unset client capabilities'),
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): McpOptions {
|
|
309
|
+
const queryObject = typeof query === 'string' ? qs.parse(query) : query;
|
|
310
|
+
const queryOptions = QueryOptions.parse(queryObject);
|
|
311
|
+
|
|
312
|
+
const filters: Filter[] = [...(defaultOptions.filters ?? [])];
|
|
313
|
+
|
|
314
|
+
for (const resource of queryOptions.resource || []) {
|
|
315
|
+
filters.push({ type: 'resource', op: 'include', value: resource });
|
|
316
|
+
}
|
|
317
|
+
for (const operation of queryOptions.operation || []) {
|
|
318
|
+
filters.push({ type: 'operation', op: 'include', value: operation });
|
|
319
|
+
}
|
|
320
|
+
for (const tag of queryOptions.tag || []) {
|
|
321
|
+
filters.push({ type: 'tag', op: 'include', value: tag });
|
|
322
|
+
}
|
|
323
|
+
for (const tool of queryOptions.tool || []) {
|
|
324
|
+
filters.push({ type: 'tool', op: 'include', value: tool });
|
|
325
|
+
}
|
|
326
|
+
for (const resource of queryOptions.no_resource || []) {
|
|
327
|
+
filters.push({ type: 'resource', op: 'exclude', value: resource });
|
|
328
|
+
}
|
|
329
|
+
for (const operation of queryOptions.no_operation || []) {
|
|
330
|
+
filters.push({ type: 'operation', op: 'exclude', value: operation });
|
|
331
|
+
}
|
|
332
|
+
for (const tag of queryOptions.no_tag || []) {
|
|
333
|
+
filters.push({ type: 'tag', op: 'exclude', value: tag });
|
|
334
|
+
}
|
|
335
|
+
for (const tool of queryOptions.no_tool || []) {
|
|
336
|
+
filters.push({ type: 'tool', op: 'exclude', value: tool });
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// Parse client capabilities
|
|
340
|
+
const clientCapabilities: Partial<ClientCapabilities> = { ...defaultOptions.capabilities };
|
|
341
|
+
|
|
342
|
+
for (const cap of queryOptions.capability || []) {
|
|
343
|
+
const parsed = parseCapabilityValue(cap);
|
|
344
|
+
if (parsed.name === 'top-level-unions') {
|
|
345
|
+
clientCapabilities.topLevelUnions = true;
|
|
346
|
+
} else if (parsed.name === 'valid-json') {
|
|
347
|
+
clientCapabilities.validJson = true;
|
|
348
|
+
} else if (parsed.name === 'refs') {
|
|
349
|
+
clientCapabilities.refs = true;
|
|
350
|
+
} else if (parsed.name === 'unions') {
|
|
351
|
+
clientCapabilities.unions = true;
|
|
352
|
+
} else if (parsed.name === 'formats') {
|
|
353
|
+
clientCapabilities.formats = true;
|
|
354
|
+
} else if (parsed.name === 'tool-name-length') {
|
|
355
|
+
clientCapabilities.toolNameLength = parsed.value;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
for (const cap of queryOptions.no_capability || []) {
|
|
360
|
+
if (cap === 'top-level-unions') {
|
|
361
|
+
clientCapabilities.topLevelUnions = false;
|
|
362
|
+
} else if (cap === 'valid-json') {
|
|
363
|
+
clientCapabilities.validJson = false;
|
|
364
|
+
} else if (cap === 'refs') {
|
|
365
|
+
clientCapabilities.refs = false;
|
|
366
|
+
} else if (cap === 'unions') {
|
|
367
|
+
clientCapabilities.unions = false;
|
|
368
|
+
} else if (cap === 'formats') {
|
|
369
|
+
clientCapabilities.formats = false;
|
|
370
|
+
} else if (cap === 'tool-name-length') {
|
|
371
|
+
clientCapabilities.toolNameLength = undefined;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
let dynamicTools: boolean | undefined =
|
|
376
|
+
queryOptions.no_tools && queryOptions.no_tools?.includes('dynamic') ? false
|
|
377
|
+
: queryOptions.tools?.includes('dynamic') ? true
|
|
378
|
+
: defaultOptions.includeDynamicTools;
|
|
379
|
+
|
|
380
|
+
let allTools: boolean | undefined =
|
|
381
|
+
queryOptions.no_tools && queryOptions.no_tools?.includes('all') ? false
|
|
382
|
+
: queryOptions.tools?.includes('all') ? true
|
|
383
|
+
: defaultOptions.includeAllTools;
|
|
384
|
+
|
|
385
|
+
let docsTools: boolean | undefined =
|
|
386
|
+
queryOptions.no_tools && queryOptions.no_tools?.includes('docs') ? false
|
|
387
|
+
: queryOptions.tools?.includes('docs') ? true
|
|
388
|
+
: defaultOptions.includeDocsTools;
|
|
389
|
+
|
|
390
|
+
let codeTools: boolean | undefined =
|
|
391
|
+
queryOptions.no_tools && queryOptions.no_tools?.includes('code') ? false
|
|
392
|
+
: queryOptions.tools?.includes('code') && defaultOptions.includeCodeTools ? true
|
|
393
|
+
: defaultOptions.includeCodeTools;
|
|
394
|
+
|
|
395
|
+
return {
|
|
396
|
+
client: queryOptions.client ?? defaultOptions.client,
|
|
397
|
+
includeDynamicTools: dynamicTools,
|
|
398
|
+
includeAllTools: allTools,
|
|
399
|
+
includeCodeTools: codeTools,
|
|
400
|
+
includeDocsTools: docsTools,
|
|
401
|
+
filters,
|
|
402
|
+
capabilities: clientCapabilities,
|
|
291
403
|
};
|
|
292
404
|
}
|
|
293
405
|
|
|
@@ -323,7 +435,7 @@ Client Presets (--client):
|
|
|
323
435
|
Presets like '--client=openai-agents' or '--client=cursor' automatically configure these capabilities based on current known limitations of those clients, simplifying setup.
|
|
324
436
|
|
|
325
437
|
Current presets:
|
|
326
|
-
${JSON.stringify(
|
|
438
|
+
${JSON.stringify(knownClients, null, 2)}
|
|
327
439
|
`;
|
|
328
440
|
}
|
|
329
441
|
|
package/src/server.ts
CHANGED
|
@@ -3,86 +3,174 @@
|
|
|
3
3
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
4
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
5
|
import { Endpoint, endpoints, HandlerFunction, query } from './tools';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
CallToolRequestSchema,
|
|
8
|
+
ListToolsRequestSchema,
|
|
9
|
+
SetLevelRequestSchema,
|
|
10
|
+
Implementation,
|
|
11
|
+
Tool,
|
|
12
|
+
} from '@modelcontextprotocol/sdk/types.js';
|
|
13
|
+
import { ClientOptions } from '@tryfinch/finch-api';
|
|
7
14
|
import Finch from '@tryfinch/finch-api';
|
|
8
15
|
import {
|
|
9
16
|
applyCompatibilityTransformations,
|
|
10
17
|
ClientCapabilities,
|
|
11
18
|
defaultClientCapabilities,
|
|
19
|
+
knownClients,
|
|
12
20
|
parseEmbeddedJSON,
|
|
13
21
|
} from './compat';
|
|
14
22
|
import { dynamicTools } from './dynamic-tools';
|
|
15
|
-
import {
|
|
23
|
+
import { codeTool } from './code-tool';
|
|
24
|
+
import docsSearchTool from './docs-search-tool';
|
|
25
|
+
import { McpOptions } from './options';
|
|
26
|
+
|
|
27
|
+
export { McpOptions } from './options';
|
|
28
|
+
export { ClientType } from './compat';
|
|
29
|
+
export { Filter } from './tools';
|
|
30
|
+
export { ClientOptions } from '@tryfinch/finch-api';
|
|
16
31
|
export { endpoints } from './tools';
|
|
17
32
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
capabilities: {
|
|
26
|
-
tools: {},
|
|
33
|
+
export const newMcpServer = () =>
|
|
34
|
+
new McpServer(
|
|
35
|
+
{
|
|
36
|
+
name: 'tryfinch_finch_api_api',
|
|
37
|
+
version: '7.0.0',
|
|
27
38
|
},
|
|
28
|
-
|
|
29
|
-
);
|
|
39
|
+
{ capabilities: { tools: {}, logging: {} } },
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
// Create server instance
|
|
43
|
+
export const server = newMcpServer();
|
|
30
44
|
|
|
31
45
|
/**
|
|
32
46
|
* Initializes the provided MCP Server with the given tools and handlers.
|
|
33
47
|
* If not provided, the default client, tools and handlers will be used.
|
|
34
48
|
*/
|
|
35
|
-
export function
|
|
49
|
+
export function initMcpServer(params: {
|
|
36
50
|
server: Server | McpServer;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
capabilities?: Partial<ClientCapabilities>;
|
|
51
|
+
clientOptions?: ClientOptions;
|
|
52
|
+
mcpOptions?: McpOptions;
|
|
40
53
|
}) {
|
|
41
54
|
const server = params.server instanceof McpServer ? params.server.server : params.server;
|
|
42
|
-
const
|
|
55
|
+
const mcpOptions = params.mcpOptions ?? {};
|
|
56
|
+
|
|
57
|
+
let providedEndpoints: Endpoint[] | null = null;
|
|
58
|
+
let endpointMap: Record<string, Endpoint> | null = null;
|
|
59
|
+
|
|
60
|
+
const initTools = async (implementation?: Implementation) => {
|
|
61
|
+
if (implementation && (!mcpOptions.client || mcpOptions.client === 'infer')) {
|
|
62
|
+
mcpOptions.client =
|
|
63
|
+
implementation.name.toLowerCase().includes('claude') ? 'claude'
|
|
64
|
+
: implementation.name.toLowerCase().includes('cursor') ? 'cursor'
|
|
65
|
+
: undefined;
|
|
66
|
+
mcpOptions.capabilities = {
|
|
67
|
+
...(mcpOptions.client && knownClients[mcpOptions.client]),
|
|
68
|
+
...mcpOptions.capabilities,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
providedEndpoints ??= await selectTools(endpoints, mcpOptions);
|
|
72
|
+
endpointMap ??= Object.fromEntries(providedEndpoints.map((endpoint) => [endpoint.tool.name, endpoint]));
|
|
73
|
+
};
|
|
43
74
|
|
|
44
|
-
const
|
|
75
|
+
const logAtLevel =
|
|
76
|
+
(level: 'debug' | 'info' | 'warning' | 'error') =>
|
|
77
|
+
(message: string, ...rest: unknown[]) => {
|
|
78
|
+
void server.sendLoggingMessage({
|
|
79
|
+
level,
|
|
80
|
+
data: { message, rest },
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
const logger = {
|
|
84
|
+
debug: logAtLevel('debug'),
|
|
85
|
+
info: logAtLevel('info'),
|
|
86
|
+
warn: logAtLevel('warning'),
|
|
87
|
+
error: logAtLevel('error'),
|
|
88
|
+
};
|
|
45
89
|
|
|
46
|
-
|
|
90
|
+
let client = new Finch({
|
|
91
|
+
...{ accessToken: readEnv('FINCH_ACCESS_TOKEN') },
|
|
92
|
+
logger,
|
|
93
|
+
...params.clientOptions,
|
|
94
|
+
defaultHeaders: {
|
|
95
|
+
...params.clientOptions?.defaultHeaders,
|
|
96
|
+
'X-Stainless-MCP': 'true',
|
|
97
|
+
},
|
|
98
|
+
});
|
|
47
99
|
|
|
48
100
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
101
|
+
if (providedEndpoints === null) {
|
|
102
|
+
await initTools(server.getClientVersion());
|
|
103
|
+
}
|
|
49
104
|
return {
|
|
50
|
-
tools: providedEndpoints
|
|
105
|
+
tools: providedEndpoints!.map((endpoint) => endpoint.tool),
|
|
51
106
|
};
|
|
52
107
|
});
|
|
53
108
|
|
|
54
109
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
110
|
+
if (endpointMap === null) {
|
|
111
|
+
await initTools(server.getClientVersion());
|
|
112
|
+
}
|
|
55
113
|
const { name, arguments: args } = request.params;
|
|
56
|
-
const endpoint = endpointMap[name];
|
|
114
|
+
const endpoint = endpointMap![name];
|
|
57
115
|
if (!endpoint) {
|
|
58
116
|
throw new Error(`Unknown tool: ${name}`);
|
|
59
117
|
}
|
|
60
118
|
|
|
61
|
-
return executeHandler(endpoint.tool, endpoint.handler, client, args,
|
|
119
|
+
return executeHandler(endpoint.tool, endpoint.handler, client, args, mcpOptions.capabilities);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
server.setRequestHandler(SetLevelRequestSchema, async (request) => {
|
|
123
|
+
const { level } = request.params;
|
|
124
|
+
switch (level) {
|
|
125
|
+
case 'debug':
|
|
126
|
+
client = client.withOptions({ logLevel: 'debug' });
|
|
127
|
+
break;
|
|
128
|
+
case 'info':
|
|
129
|
+
client = client.withOptions({ logLevel: 'info' });
|
|
130
|
+
break;
|
|
131
|
+
case 'notice':
|
|
132
|
+
case 'warning':
|
|
133
|
+
client = client.withOptions({ logLevel: 'warn' });
|
|
134
|
+
break;
|
|
135
|
+
case 'error':
|
|
136
|
+
client = client.withOptions({ logLevel: 'error' });
|
|
137
|
+
break;
|
|
138
|
+
default:
|
|
139
|
+
client = client.withOptions({ logLevel: 'off' });
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
return {};
|
|
62
143
|
});
|
|
63
144
|
}
|
|
64
145
|
|
|
65
146
|
/**
|
|
66
147
|
* Selects the tools to include in the MCP Server based on the provided options.
|
|
67
148
|
*/
|
|
68
|
-
export function selectTools(endpoints: Endpoint[], options
|
|
69
|
-
const filteredEndpoints = query(options
|
|
70
|
-
|
|
71
|
-
const includedTools = filteredEndpoints;
|
|
149
|
+
export async function selectTools(endpoints: Endpoint[], options?: McpOptions): Promise<Endpoint[]> {
|
|
150
|
+
const filteredEndpoints = query(options?.filters ?? [], endpoints);
|
|
72
151
|
|
|
73
|
-
|
|
74
|
-
includedTools.push(...endpoints);
|
|
75
|
-
}
|
|
152
|
+
let includedTools = filteredEndpoints.slice();
|
|
76
153
|
|
|
77
|
-
if (
|
|
78
|
-
|
|
154
|
+
if (includedTools.length > 0) {
|
|
155
|
+
if (options?.includeDynamicTools) {
|
|
156
|
+
includedTools = dynamicTools(includedTools);
|
|
157
|
+
}
|
|
158
|
+
} else {
|
|
159
|
+
if (options?.includeAllTools) {
|
|
160
|
+
includedTools = endpoints.slice();
|
|
161
|
+
} else if (options?.includeDynamicTools) {
|
|
162
|
+
includedTools = dynamicTools(endpoints);
|
|
163
|
+
} else if (options?.includeCodeTools) {
|
|
164
|
+
includedTools = [await codeTool()];
|
|
165
|
+
} else {
|
|
166
|
+
includedTools = endpoints.slice();
|
|
167
|
+
}
|
|
79
168
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
includedTools.push(...endpoints);
|
|
169
|
+
if (options?.includeDocsTools ?? true) {
|
|
170
|
+
includedTools.push(docsSearchTool);
|
|
83
171
|
}
|
|
84
|
-
|
|
85
|
-
return applyCompatibilityTransformations(includedTools,
|
|
172
|
+
const capabilities = { ...defaultClientCapabilities, ...options?.capabilities };
|
|
173
|
+
return applyCompatibilityTransformations(includedTools, capabilities);
|
|
86
174
|
}
|
|
87
175
|
|
|
88
176
|
/**
|
|
@@ -96,18 +184,10 @@ export async function executeHandler(
|
|
|
96
184
|
compatibilityOptions?: Partial<ClientCapabilities>,
|
|
97
185
|
) {
|
|
98
186
|
const options = { ...defaultClientCapabilities, ...compatibilityOptions };
|
|
99
|
-
if (options.validJson && args) {
|
|
100
|
-
args =
|
|
187
|
+
if (!options.validJson && args) {
|
|
188
|
+
args = parseEmbeddedJSON(args, tool.inputSchema);
|
|
101
189
|
}
|
|
102
|
-
|
|
103
|
-
return {
|
|
104
|
-
content: [
|
|
105
|
-
{
|
|
106
|
-
type: 'text',
|
|
107
|
-
text: JSON.stringify(result, null, 2),
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
};
|
|
190
|
+
return await handler(client, args || {});
|
|
111
191
|
}
|
|
112
192
|
|
|
113
193
|
export const readEnv = (env: string): string | undefined => {
|
package/src/stdio.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
2
|
+
import { initMcpServer, newMcpServer } from './server';
|
|
3
|
+
import { McpOptions } from './options';
|
|
4
|
+
|
|
5
|
+
export const launchStdioServer = async (options: McpOptions) => {
|
|
6
|
+
const server = newMcpServer();
|
|
7
|
+
|
|
8
|
+
initMcpServer({ server, mcpOptions: options });
|
|
9
|
+
|
|
10
|
+
const transport = new StdioServerTransport();
|
|
11
|
+
await server.connect(transport);
|
|
12
|
+
console.error('MCP Server running on stdio');
|
|
13
|
+
};
|
|
@@ -1,40 +1,65 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import { isJqError, maybeFilter } from '@tryfinch/finch-api-mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@tryfinch/finch-api-mcp/tools/types';
|
|
5
|
+
|
|
3
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
|
-
import type { Metadata } from '../';
|
|
5
7
|
import Finch from '@tryfinch/finch-api';
|
|
6
8
|
|
|
7
9
|
export const metadata: Metadata = {
|
|
8
10
|
resource: 'access_tokens',
|
|
9
11
|
operation: 'write',
|
|
10
12
|
tags: [],
|
|
13
|
+
httpMethod: 'post',
|
|
14
|
+
httpPath: '/auth/token',
|
|
15
|
+
operationId: 'create-access-token',
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
export const tool: Tool = {
|
|
14
19
|
name: 'create_access_tokens',
|
|
15
|
-
description:
|
|
20
|
+
description:
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nExchange the authorization code for an access token\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/create_access_token_response',\n $defs: {\n create_access_token_response: {\n type: 'object',\n properties: {\n access_token: {\n type: 'string',\n description: 'The access token for the connection'\n },\n client_type: {\n type: 'string',\n title: 'ClientType',\n description: 'The type of application associated with a token.',\n enum: [ 'development',\n 'production',\n 'sandbox'\n ]\n },\n connection_id: {\n type: 'string',\n description: 'The Finch UUID of the connection associated with the `access_token`'\n },\n connection_type: {\n type: 'string',\n title: 'ConnectionType',\n description: 'The type of the connection associated with the token.\\n- `provider` - connection to an external provider\\n- `finch` - finch-generated data.',\n enum: [ 'finch',\n 'provider'\n ]\n },\n entity_ids: {\n type: 'array',\n description: 'An array of entity IDs that can be accessed with this access token',\n items: {\n type: 'string'\n }\n },\n products: {\n type: 'array',\n description: 'An array of the authorized products associated with the `access_token`',\n items: {\n type: 'string'\n }\n },\n provider_id: {\n type: 'string',\n description: 'The ID of the provider associated with the `access_token`'\n },\n token_type: {\n type: 'string',\n description: 'The RFC 8693 token type (Finch uses `bearer` tokens)'\n },\n account_id: {\n type: 'string',\n description: '[DEPRECATED] Use `connection_id` to identify the connection instead of this account ID'\n },\n company_id: {\n type: 'string',\n description: '[DEPRECATED] Use `connection_id` to identify the connection instead of this company ID'\n },\n customer_id: {\n type: 'string',\n description: 'The ID of your customer you provided to Finch when a connect session was created for this connection'\n }\n },\n required: [ 'access_token',\n 'client_type',\n 'connection_id',\n 'connection_type',\n 'entity_ids',\n 'products',\n 'provider_id',\n 'token_type'\n ]\n }\n }\n}\n```",
|
|
16
22
|
inputSchema: {
|
|
17
23
|
type: 'object',
|
|
18
24
|
properties: {
|
|
19
25
|
code: {
|
|
20
26
|
type: 'string',
|
|
27
|
+
description: 'The authorization code received from the authorization server',
|
|
21
28
|
},
|
|
22
29
|
client_id: {
|
|
23
30
|
type: 'string',
|
|
31
|
+
description: 'The client ID for your application',
|
|
24
32
|
},
|
|
25
33
|
client_secret: {
|
|
26
34
|
type: 'string',
|
|
35
|
+
description: 'The client secret for your application',
|
|
27
36
|
},
|
|
28
37
|
redirect_uri: {
|
|
29
38
|
type: 'string',
|
|
39
|
+
description: 'The redirect URI used in the authorization request (optional)',
|
|
40
|
+
},
|
|
41
|
+
jq_filter: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
title: 'jq Filter',
|
|
44
|
+
description:
|
|
45
|
+
'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
|
|
30
46
|
},
|
|
31
47
|
},
|
|
48
|
+
required: ['code'],
|
|
32
49
|
},
|
|
50
|
+
annotations: {},
|
|
33
51
|
};
|
|
34
52
|
|
|
35
|
-
export const handler = (client: Finch, args: Record<string, unknown> | undefined) => {
|
|
36
|
-
const body = args as any;
|
|
37
|
-
|
|
53
|
+
export const handler = async (client: Finch, args: Record<string, unknown> | undefined) => {
|
|
54
|
+
const { jq_filter, ...body } = args as any;
|
|
55
|
+
try {
|
|
56
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.accessTokens.create(body)));
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error instanceof Finch.APIError || isJqError(error)) {
|
|
59
|
+
return asErrorResult(error.message);
|
|
60
|
+
}
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
38
63
|
};
|
|
39
64
|
|
|
40
65
|
export default { metadata, tool, handler };
|