diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 54736c816..f59c11ca8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "8.1.1" + ".": "8.2.0" } diff --git a/.stats.yml b/.stats.yml index 97c0d1d00..b15bfab09 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 46 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-ded87cb73affcaff9cf779d9cfd119a4026cfc1757b39be95d933edea48a0328.yml -openapi_spec_hash: 0e6394b222fc68d7607114e70b72d23e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-46f433f34d440aa1dfcc48cc8d822c598571b68be2f723ec99e1b4fba6c13b1e.yml +openapi_spec_hash: 5b5cd728776723ac773900f7e8a32c05 config_hash: 0892e2e0eeb0343a022afa62e9080dd1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 68d6746ba..ac694f109 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## 8.2.0 (2026-01-13) + +Full Changelog: [v8.1.1...v8.2.0](https://github.com/Finch-API/finch-api-node/compare/v8.1.1...v8.2.0) + +### Features + +* **api:** api update ([07174ee](https://github.com/Finch-API/finch-api-node/commit/07174eed580ea7be80172df97f7de41fc9bf09fd)) + + +### Bug Fixes + +* **mcp:** fix env parsing ([da539c1](https://github.com/Finch-API/finch-api-node/commit/da539c18318057054f9f7a6e39a8d8a8c62ef04b)) +* **mcp:** fix options parsing ([50db4af](https://github.com/Finch-API/finch-api-node/commit/50db4af071d340114f0e129d4843fd92be84d391)) +* **mcp:** update code tool prompt ([f3b178b](https://github.com/Finch-API/finch-api-node/commit/f3b178b2683dd7f86bba4034e5d8baf7db0e52fe)) + + +### Chores + +* fix typo in descriptions ([3ea6c6f](https://github.com/Finch-API/finch-api-node/commit/3ea6c6fd84e2db27791d5e01e3841c383713cf6e)) +* **internal:** codegen related update ([2fc7cb3](https://github.com/Finch-API/finch-api-node/commit/2fc7cb3ba446371be9d018a2625039e95e850b26)) +* **internal:** codegen related update ([65d66db](https://github.com/Finch-API/finch-api-node/commit/65d66db7811483626e17ad740b7740467948b066)) +* **internal:** codegen related update ([36d593e](https://github.com/Finch-API/finch-api-node/commit/36d593ed51b766a5493fa07ff38e7123f6b2ccac)) +* **internal:** codegen related update ([55094b0](https://github.com/Finch-API/finch-api-node/commit/55094b0eac5fff043ca2a0e177843a7eb8a73c97)) + ## 8.1.1 (2026-01-06) Full Changelog: [v8.1.0...v8.1.1](https://github.com/Finch-API/finch-api-node/compare/v8.1.0...v8.1.1) diff --git a/package.json b/package.json index 57e9e9d4a..f1cab4eec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tryfinch/finch-api", - "version": "8.1.1", + "version": "8.2.0", "description": "The official TypeScript library for the Finch API", "author": "Finch ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json index 99b5638f1..99df7add7 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -1,6 +1,6 @@ { "name": "@tryfinch/finch-api-mcp", - "version": "8.1.1", + "version": "8.2.0", "description": "The official MCP Server for the Finch API", "author": "Finch ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/src/code-tool.ts b/packages/mcp-server/src/code-tool.ts index 40139bf71..5018c1ffa 100644 --- a/packages/mcp-server/src/code-tool.ts +++ b/packages/mcp-server/src/code-tool.ts @@ -4,6 +4,28 @@ import { McpTool, Metadata, ToolCallResult, asErrorResult, asTextContentResult } import { Tool } from '@modelcontextprotocol/sdk/types.js'; import { readEnv } from './server'; import { WorkerInput, WorkerOutput } from './code-tool-types'; + +const prompt = `Runs JavaScript code to interact with the Finch API. + +You are a skilled programmer writing code to interface with the service. +Define an async function named "run" that takes a single parameter of an initialized SDK client and it will be run. +For example: + +\`\`\` +async function run(client) { + const page = await client.hris.directory.list(); + const individualInDirectory = page.individuals[0] + + console.log(individualInDirectory.id); +} +\`\`\` + +You will be returned anything that your function returns, plus the results of any console.log statements. +Do not add try-catch blocks for single API calls. The tool will handle errors for you. +Do not add comments unless necessary for generating better code. +Code will run in a container, and cannot interact with the network outside of the given SDK client. +Variables will not persist between calls, so make sure to return or log any data you might need later.`; + /** * A tool that runs code against a copy of the SDK. * @@ -17,8 +39,7 @@ export function codeTool(): McpTool { const metadata: Metadata = { resource: 'all', operation: 'write', tags: [] }; const tool: Tool = { name: 'execute', - description: - 'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.', + description: prompt, inputSchema: { type: 'object', properties: { code: { type: 'string' } } }, }; const handler = async (_: unknown, args: any): Promise => { @@ -36,7 +57,6 @@ export function codeTool(): McpTool { ...(stainlessAPIKey && { Authorization: stainlessAPIKey }), 'Content-Type': 'application/json', client_envs: JSON.stringify({ - FINCH_ACCESS_TOKEN: readEnv('FINCH_ACCESS_TOKEN'), FINCH_CLIENT_ID: readEnv('FINCH_CLIENT_ID'), FINCH_CLIENT_SECRET: readEnv('FINCH_CLIENT_SECRET'), FINCH_WEBHOOK_SECRET: readEnv('FINCH_WEBHOOK_SECRET'), diff --git a/packages/mcp-server/src/options.ts b/packages/mcp-server/src/options.ts index 6c8bb8d1f..c66ad8ce0 100644 --- a/packages/mcp-server/src/options.ts +++ b/packages/mcp-server/src/options.ts @@ -55,7 +55,7 @@ export function parseCLIOptions(): CLIOptions { const transport = argv.transport as 'stdio' | 'http'; return { - includeDocsTools, + ...(includeDocsTools !== undefined && { includeDocsTools }), transport, port: argv.port, socket: argv.socket, @@ -87,6 +87,6 @@ export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): M : defaultOptions.includeDocsTools; return { - includeDocsTools: docsTools, + ...(docsTools !== undefined && { includeDocsTools: docsTools }), }; } diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts index e7d169f25..fa0a97b0b 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -21,7 +21,7 @@ export const newMcpServer = () => new McpServer( { name: 'tryfinch_finch_api_api', - version: '8.1.1', + version: '8.2.0', }, { capabilities: { tools: {}, logging: {} } }, ); diff --git a/packages/mcp-server/tests/options.test.ts b/packages/mcp-server/tests/options.test.ts index 532666a80..7a2d5114c 100644 --- a/packages/mcp-server/tests/options.test.ts +++ b/packages/mcp-server/tests/options.test.ts @@ -26,7 +26,7 @@ describe('parseCLIOptions', () => { const result = parseCLIOptions(); expect(result.transport).toBe('http'); - expect(result.port).toBe('2222'); + expect(result.port).toBe(2222); cleanup(); }); }); @@ -38,13 +38,13 @@ describe('parseQueryOptions', () => { const query = ''; const result = parseQueryOptions(defaultOptions, query); - expect(result).toBe({}); + expect(result).toEqual({}); }); it('should handle invalid query string gracefully', () => { - const query = 'invalid=value&operation=invalid-operation'; + const query = 'invalid=value&tools=invalid-operation'; - // Should throw due to Zod validation for invalid operation + // Should throw due to Zod validation for invalid tools expect(() => parseQueryOptions(defaultOptions, query)).toThrow(); }); }); diff --git a/src/resources/hris/company/pay-statement-item/pay-statement-item.ts b/src/resources/hris/company/pay-statement-item/pay-statement-item.ts index f2d8248ab..64626bfa6 100644 --- a/src/resources/hris/company/pay-statement-item/pay-statement-item.ts +++ b/src/resources/hris/company/pay-statement-item/pay-statement-item.ts @@ -21,9 +21,8 @@ export class PayStatementItem extends APIResource { rules: RulesAPI.Rules = new RulesAPI.Rules(this._client); /** - * **Beta:** this endpoint currently serves employers onboarded after March 4th and - * historical support will be added soon Retrieve a list of detailed pay statement - * items for the access token's connection account. + * Retrieve a list of detailed pay statement items for the access token's + * connection account. * * @example * ```ts diff --git a/src/resources/hris/company/pay-statement-item/rules.ts b/src/resources/hris/company/pay-statement-item/rules.ts index cd842d793..98b7a7441 100644 --- a/src/resources/hris/company/pay-statement-item/rules.ts +++ b/src/resources/hris/company/pay-statement-item/rules.ts @@ -8,12 +8,10 @@ import { path } from '../../../../internal/utils/path'; export class Rules extends APIResource { /** - * **Beta:** this endpoint currently serves employers onboarded after March 4th and - * historical support will be added soon Custom rules can be created to associate - * specific attributes to pay statement items depending on the use case. For - * example, pay statement items that meet certain conditions can be labeled as a - * pre-tax 401k. This metadata can be retrieved where pay statement item - * information is available. + * Custom rules can be created to associate specific attributes to pay statement + * items depending on the use case. For example, pay statement items that meet + * certain conditions can be labeled as a pre-tax 401k. This metadata can be + * retrieved where pay statement item information is available. * * @example * ```ts @@ -34,8 +32,7 @@ export class Rules extends APIResource { } /** - * **Beta:** this endpoint currently serves employers onboarded after March 4th and - * historical support will be added soon Update a rule for a pay statement item. + * Update a rule for a pay statement item. * * @example * ```ts @@ -59,8 +56,7 @@ export class Rules extends APIResource { } /** - * **Beta:** this endpoint currently serves employers onboarded after March 4th and - * historical support will be added soon List all rules of a connection account. + * List all rules of a connection account. * * @example * ```ts @@ -81,8 +77,7 @@ export class Rules extends APIResource { } /** - * **Beta:** this endpoint currently serves employers onboarded after March 4th and - * historical support will be added soon Delete a rule for a pay statement item. + * Delete a rule for a pay statement item. * * @example * ```ts @@ -420,7 +415,7 @@ export interface RuleCreateParams { attributes?: RuleCreateParams.Attributes; /** - * Body param: + * Body param */ conditions?: Array; @@ -478,7 +473,7 @@ export interface RuleUpdateParams { entity_ids?: Array; /** - * Body param: + * Body param */ optionalProperty?: unknown; } diff --git a/src/resources/hris/employments.ts b/src/resources/hris/employments.ts index ec84cd584..694a4382c 100644 --- a/src/resources/hris/employments.ts +++ b/src/resources/hris/employments.ts @@ -60,8 +60,7 @@ export namespace EmploymentData { employment: UnionMember0.Employment | null; /** - * The detailed employment status of the individual. Available options: `active`, - * `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + * The detailed employment status of the individual. */ employment_status: | 'active' diff --git a/src/resources/hris/individuals.ts b/src/resources/hris/individuals.ts index e32b95a90..e56b9561c 100644 --- a/src/resources/hris/individuals.ts +++ b/src/resources/hris/individuals.ts @@ -145,12 +145,12 @@ export interface IndividualRetrieveManyParams { entity_ids?: Array; /** - * Body param: + * Body param */ options?: IndividualRetrieveManyParams.Options | null; /** - * Body param: + * Body param */ requests?: Array; } diff --git a/src/resources/hris/payments.ts b/src/resources/hris/payments.ts index cb68fa1ff..f96407d3c 100644 --- a/src/resources/hris/payments.ts +++ b/src/resources/hris/payments.ts @@ -92,13 +92,13 @@ export namespace Payment { export interface PaymentListParams { /** * The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` - * format. + * format. Filters payments by their **pay_date** field. */ end_date: string; /** * The start date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` - * format. + * format. Filters payments by their **pay_date** field. */ start_date: string; diff --git a/src/resources/jobs/manual.ts b/src/resources/jobs/manual.ts index ac5268d79..4ceaaf2f5 100644 --- a/src/resources/jobs/manual.ts +++ b/src/resources/jobs/manual.ts @@ -7,8 +7,8 @@ import { path } from '../../internal/utils/path'; export class Manual extends APIResource { /** - * Get a manual job by `job_id`. Manual jobs are completed by a human and include - * Assisted Benefits jobs. + * Check the status and outcome of a job by `job_id`. This includes all deductions + * jobs including those for both automated and assisted integrations. */ retrieve(jobID: string, options?: RequestOptions): APIPromise { return this._client.get(path`/jobs/manual/${jobID}`, options); diff --git a/src/resources/sandbox/directory.ts b/src/resources/sandbox/directory.ts index 78c79d191..5cc0ccebf 100644 --- a/src/resources/sandbox/directory.ts +++ b/src/resources/sandbox/directory.ts @@ -65,8 +65,7 @@ export namespace DirectoryCreateParams { employment?: Body.Employment | null; /** - * The detailed employment status of the individual. Available options: `active`, - * `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + * The detailed employment status of the individual. */ employment_status?: | 'active' diff --git a/src/resources/sandbox/employment.ts b/src/resources/sandbox/employment.ts index c770ddaee..30950a739 100644 --- a/src/resources/sandbox/employment.ts +++ b/src/resources/sandbox/employment.ts @@ -55,8 +55,7 @@ export interface EmploymentUpdateResponse { employment?: EmploymentUpdateResponse.Employment | null; /** - * The detailed employment status of the individual. Available options: `active`, - * `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + * The detailed employment status of the individual. */ employment_status?: | 'active' @@ -192,8 +191,7 @@ export interface EmploymentUpdateParams { employment?: EmploymentUpdateParams.Employment | null; /** - * The detailed employment status of the individual. Available options: `active`, - * `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + * The detailed employment status of the individual. */ employment_status?: | 'active' diff --git a/src/version.ts b/src/version.ts index c0fd1944c..f9da058ca 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '8.1.1'; // x-release-please-version +export const VERSION = '8.2.0'; // x-release-please-version