Skip to content

Commit 4869cdf

Browse files
release: 6.39.0 (#635)
* chore(internal): grammar fix (it's -> its) * feat(api): api update * chore: use structured error when code execution tool errors * release: 6.39.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent f941c83 commit 4869cdf

File tree

13 files changed

+101
-107
lines changed

13 files changed

+101
-107
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "6.38.2"
2+
".": "6.39.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 46
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-0105d239fcaf84750c886dfa6c2cfbf2b2087f89a48f8827c4cbe28479ebfb13.yml
3-
openapi_spec_hash: 34895c3d3c137fb9f5a019ac5370afbb
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-b817e7a30a6366c063a8c9a334d5be281eb8d93e21acc8c8219d3bdc95043deb.yml
3+
openapi_spec_hash: d4cc4a5cba9f13986e38d148d330aa00
44
config_hash: 5c64f384746e7570c10f19fe241062a7

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 6.39.0 (2025-11-03)
4+
5+
Full Changelog: [v6.38.2...v6.39.0](https://github.com/Finch-API/finch-api-node/compare/v6.38.2...v6.39.0)
6+
7+
### Features
8+
9+
* **api:** api update ([b6892f5](https://github.com/Finch-API/finch-api-node/commit/b6892f5c579a0eeb8fa03863d9a72faa36adab9d))
10+
11+
12+
### Chores
13+
14+
* **internal:** grammar fix (it's -&gt; its) ([54ad7ca](https://github.com/Finch-API/finch-api-node/commit/54ad7ca2689051eccdb1de832e9041e3a6fe8d52))
15+
* use structured error when code execution tool errors ([a85e9d8](https://github.com/Finch-API/finch-api-node/commit/a85e9d8431d5b22e82f34606a813821f5573d197))
16+
317
## 6.38.2 (2025-10-31)
418

519
Full Changelog: [v6.38.1...v6.38.2](https://github.com/Finch-API/finch-api-node/compare/v6.38.1...v6.38.2)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tryfinch/finch-api",
3-
"version": "6.38.2",
3+
"version": "6.39.0",
44
"description": "The official TypeScript library for the Finch API",
55
"author": "Finch <founders@tryfinch.com>",
66
"types": "dist/index.d.ts",

packages/mcp-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tryfinch/finch-api-mcp",
3-
"version": "6.38.2",
3+
"version": "6.39.0",
44
"description": "The official MCP Server for the Finch API",
55
"author": "Finch <founders@tryfinch.com>",
66
"types": "dist/index.d.ts",

packages/mcp-server/src/code-tool.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { dirname } from 'node:path';
44
import { pathToFileURL } from 'node:url';
55
import Finch, { ClientOptions } from '@tryfinch/finch-api';
6-
import { Endpoint, ContentBlock, Metadata } from './tools/types';
6+
import { ContentBlock, Endpoint, Metadata, ToolCallResult } from './tools/types';
77

88
import { Tool } from '@modelcontextprotocol/sdk/types.js';
99

@@ -12,7 +12,7 @@ import { WorkerInput, WorkerError, WorkerSuccess } from './code-tool-types';
1212
/**
1313
* A tool that runs code against a copy of the SDK.
1414
*
15-
* Instead of exposing every endpoint as it's own tool, which uses up too many tokens for LLMs to use at once,
15+
* Instead of exposing every endpoint as its own tool, which uses up too many tokens for LLMs to use at once,
1616
* we expose a single tool that can be used to search for endpoints by name, resource, operation, or tag, and then
1717
* a generic endpoint that can be used to invoke any endpoint with the provided arguments.
1818
*
@@ -23,15 +23,15 @@ export async function codeTool(): Promise<Endpoint> {
2323
const tool: Tool = {
2424
name: 'execute',
2525
description:
26-
'Runs Typescript code to interact with the API.\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 client, and it will be run.\nDo not initialize a client, but instead use the client that you are given as a parameter.\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.',
26+
'Runs TypeScript code to interact with the API.\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 client, and it will be run.\nDo not initialize a client, but instead use the client that you are given as a parameter.\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.',
2727
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
2828
};
2929

3030
// Import dynamically to avoid failing at import time in cases where the environment is not well-supported.
3131
const { newDenoHTTPWorker } = await import('@valtown/deno-http-worker');
3232
const { workerPath } = await import('./code-tool-paths.cjs');
3333

34-
const handler = async (client: Finch, args: unknown) => {
34+
const handler = async (client: Finch, args: unknown): Promise<ToolCallResult> => {
3535
const baseURLHostname = new URL(client.baseURL).hostname;
3636
const { code } = args as { code: string };
3737

@@ -100,7 +100,7 @@ export async function codeTool(): Promise<Endpoint> {
100100
} satisfies WorkerInput);
101101

102102
req.write(body, (err) => {
103-
if (err !== null && err !== undefined) {
103+
if (err != null) {
104104
reject(err);
105105
}
106106
});
@@ -111,12 +111,12 @@ export async function codeTool(): Promise<Endpoint> {
111111
if (resp.status === 200) {
112112
const { result, logLines, errLines } = (await resp.json()) as WorkerSuccess;
113113
const returnOutput: ContentBlock | null =
114-
result === null ? null
115-
: result === undefined ? null
116-
: {
114+
result == null ? null : (
115+
{
117116
type: 'text',
118-
text: typeof result === 'string' ? (result as string) : JSON.stringify(result),
119-
};
117+
text: typeof result === 'string' ? result : JSON.stringify(result),
118+
}
119+
);
120120
const logOutput: ContentBlock | null =
121121
logLines.length === 0 ?
122122
null
@@ -136,10 +136,11 @@ export async function codeTool(): Promise<Endpoint> {
136136
};
137137
} else {
138138
const { message } = (await resp.json()) as WorkerError;
139-
throw new Error(message);
139+
return {
140+
content: message == null ? [] : [{ type: 'text', text: message }],
141+
isError: true,
142+
};
140143
}
141-
} catch (e) {
142-
throw e;
143144
} finally {
144145
worker.terminate();
145146
}

packages/mcp-server/src/dynamic-tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function zodToInputSchema(schema: z.ZodSchema) {
1414
/**
1515
* A list of tools that expose all the endpoints in the API dynamically.
1616
*
17-
* Instead of exposing every endpoint as it's own tool, which uses up too many tokens for LLMs to use at once,
17+
* Instead of exposing every endpoint as its own tool, which uses up too many tokens for LLMs to use at once,
1818
* we expose a single tool that can be used to search for endpoints by name, resource, operation, or tag, and then
1919
* a generic endpoint that can be used to invoke any endpoint with the provided arguments.
2020
*

packages/mcp-server/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const newMcpServer = () =>
3333
new McpServer(
3434
{
3535
name: 'tryfinch_finch_api_api',
36-
version: '6.38.2',
36+
version: '6.39.0',
3737
},
3838
{ capabilities: { tools: {}, logging: {} } },
3939
);

packages/mcp-server/src/tools/connect/sessions/new-connect-sessions.ts

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ export const tool: Tool = {
2222
inputSchema: {
2323
type: 'object',
2424
properties: {
25-
customer_email: {
26-
type: 'string',
27-
description: 'Email address of the customer',
28-
},
2925
customer_id: {
3026
type: 'string',
3127
description: 'Unique identifier for the customer',
@@ -34,31 +30,6 @@ export const tool: Tool = {
3430
type: 'string',
3531
description: 'Name of the customer',
3632
},
37-
integration: {
38-
type: 'object',
39-
description: 'Integration configuration for the connect session',
40-
properties: {
41-
auth_method: {
42-
type: 'string',
43-
description: 'The authentication method to use',
44-
enum: ['assisted', 'credential', 'oauth', 'api_token'],
45-
},
46-
provider: {
47-
type: 'string',
48-
description: 'The provider to integrate with',
49-
},
50-
},
51-
required: ['auth_method', 'provider'],
52-
},
53-
manual: {
54-
type: 'boolean',
55-
description: 'Enable manual authentication mode',
56-
},
57-
minutes_to_expire: {
58-
type: 'number',
59-
description:
60-
'The number of minutes until the session expires (defaults to 129,600, which is 90 days)',
61-
},
6233
products: {
6334
type: 'array',
6435
description: 'The Finch products to request access to',
@@ -79,6 +50,35 @@ export const tool: Tool = {
7950
],
8051
},
8152
},
53+
customer_email: {
54+
type: 'string',
55+
description: 'Email address of the customer',
56+
},
57+
integration: {
58+
type: 'object',
59+
description: 'Integration configuration for the connect session',
60+
properties: {
61+
provider: {
62+
type: 'string',
63+
description: 'The provider to integrate with',
64+
},
65+
auth_method: {
66+
type: 'string',
67+
description: 'The authentication method to use',
68+
enum: ['assisted', 'credential', 'oauth', 'api_token'],
69+
},
70+
},
71+
required: ['provider'],
72+
},
73+
manual: {
74+
type: 'boolean',
75+
description: 'Enable manual authentication mode',
76+
},
77+
minutes_to_expire: {
78+
type: 'number',
79+
description:
80+
'The number of minutes until the session expires (defaults to 129,600, which is 90 days)',
81+
},
8282
redirect_uri: {
8383
type: 'string',
8484
description: 'The URI to redirect to after the Connect flow is completed',
@@ -95,17 +95,7 @@ export const tool: Tool = {
9595
'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/).',
9696
},
9797
},
98-
required: [
99-
'customer_email',
100-
'customer_id',
101-
'customer_name',
102-
'integration',
103-
'manual',
104-
'minutes_to_expire',
105-
'products',
106-
'redirect_uri',
107-
'sandbox',
108-
],
98+
required: ['customer_id', 'customer_name', 'products'],
10999
},
110100
annotations: {},
111101
};

packages/mcp-server/src/tools/connect/sessions/reauthenticate-connect-sessions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const tool: Tool = {
6161
'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/).',
6262
},
6363
},
64-
required: ['connection_id', 'minutes_to_expire', 'products', 'redirect_uri'],
64+
required: ['connection_id'],
6565
},
6666
annotations: {},
6767
};

0 commit comments

Comments
 (0)