diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 4e9d6c7e..eb0c51f1 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "7.1.1"
+ ".": "7.2.0"
}
diff --git a/.stats.yml b/.stats.yml
index f035d349..e75a1bc7 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 42
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c7ad6f552b38f2145781847f8b390fa1ec43068d64e45a33012a97a9299edc10.yml
-openapi_spec_hash: 50f281e91210ad5018ac7e4eee216f56
-config_hash: 74a8263b80c732a2b016177e7d56bb9c
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-9d184cb502ab32a85db2889c796cdfebe812f2a55a604df79c85dd4b5e7e2add.yml
+openapi_spec_hash: a9aa620376fce66532c84f9364209b0b
+config_hash: 71cab8223bb5610c6c7ca6e9c4cc1f89
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0617e7cc..25a6dc1d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,57 @@
# Changelog
+## 7.2.0 (2025-12-17)
+
+Full Changelog: [v7.1.1...v7.2.0](https://github.com/imagekit-developer/imagekit-nodejs/compare/v7.1.1...v7.2.0)
+
+### Features
+
+* **api:** add GetImageAttributesOptions and ResponsiveImageAttributes schemas; update resource references in main.yaml; remove dummy endpoint ([9ea439a](https://github.com/imagekit-developer/imagekit-nodejs/commit/9ea439a2d0a4c8300d14d4424dc72ab40a67c4d4))
+* **mcp:** add detail field to docs search tool ([f36d795](https://github.com/imagekit-developer/imagekit-nodejs/commit/f36d79523b0613a27afd45d56f4e1e906e6fdfe9))
+* **mcp:** add typescript check to code execution tool ([63ab735](https://github.com/imagekit-developer/imagekit-nodejs/commit/63ab735bf6c8458a53bd66c8c437b45a7aef60fe))
+* **mcp:** enable optional code execution tool on http mcp servers ([cc68e38](https://github.com/imagekit-developer/imagekit-nodejs/commit/cc68e38fa61078db6a5c961e7ed75dad342dc7e8))
+* **mcp:** handle code mode calls in the Stainless API ([eb22f08](https://github.com/imagekit-developer/imagekit-nodejs/commit/eb22f0883fc74c94959fdd97e50d41d940e1aed6))
+* **mcp:** return logs on code tool errors ([6118fe4](https://github.com/imagekit-developer/imagekit-nodejs/commit/6118fe4804be492482268ff25e0afc714bea7613))
+
+
+### Bug Fixes
+
+* **docs:** remove extraneous example object fields ([a043056](https://github.com/imagekit-developer/imagekit-nodejs/commit/a043056abd2f86bcb5a691ac8f5c7ccf8a17663c))
+* **mcp:** add client instantiation options to code tool ([967c8d9](https://github.com/imagekit-developer/imagekit-nodejs/commit/967c8d90503b2e0ed0576b919be09f3b924ec890))
+* **mcpb:** pin @anthropic-ai/mcpb version ([d81e225](https://github.com/imagekit-developer/imagekit-nodejs/commit/d81e22560aab772ee9b241fb44a50561b8837034))
+* **mcp:** correct code tool API endpoint ([f4d2b6c](https://github.com/imagekit-developer/imagekit-nodejs/commit/f4d2b6c9989e8cc6c69badba7de0abb57e6de398))
+* **mcp:** pass base url to code tool ([908fa87](https://github.com/imagekit-developer/imagekit-nodejs/commit/908fa874d20613761caa76cd4b2151524ef87606))
+* **mcp:** return correct lines on typescript errors ([aa7ae07](https://github.com/imagekit-developer/imagekit-nodejs/commit/aa7ae07286cf492a7b1fecce34697006837beeef))
+* **mcp:** return tool execution error on api error ([1e866f8](https://github.com/imagekit-developer/imagekit-nodejs/commit/1e866f8e5254ecc305b3dfee53ec232455143cc4))
+* **mcp:** return tool execution error on jq failure ([d1949db](https://github.com/imagekit-developer/imagekit-nodejs/commit/d1949dbef79859b446ee9ee2c8a2d562568c1cca))
+
+
+### Chores
+
+* **client:** fix logger property type ([6269318](https://github.com/imagekit-developer/imagekit-nodejs/commit/6269318024cd320f3038def32c3d5bf1f1da77a1))
+* extract some types in mcp docs ([de606ba](https://github.com/imagekit-developer/imagekit-nodejs/commit/de606ba3b734389e1c52a9929dbf8487828822e0))
+* **internal:** codegen related update ([b6b0d1a](https://github.com/imagekit-developer/imagekit-nodejs/commit/b6b0d1a7d2f00d9ecaa9e0e630a012c25f6a00f4))
+* **internal:** codegen related update ([26acc3a](https://github.com/imagekit-developer/imagekit-nodejs/commit/26acc3a9fe08c7c478eed956dd553333bd8cf210))
+* **internal:** codegen related update ([662aa87](https://github.com/imagekit-developer/imagekit-nodejs/commit/662aa87091dc519bb811554438eaf978660d035e))
+* **internal:** codegen related update ([8c9026a](https://github.com/imagekit-developer/imagekit-nodejs/commit/8c9026ace5d217264e5753c01309a02a2c09095e))
+* **internal:** grammar fix (it's -> its) ([71e22a3](https://github.com/imagekit-developer/imagekit-nodejs/commit/71e22a30017324842fed5ab08ee1efbb1eecb6d2))
+* **internal:** upgrade eslint ([310bf0d](https://github.com/imagekit-developer/imagekit-nodejs/commit/310bf0d0cc1d5b15d08a2cbb483a9969ebf4f11d))
+* **internal:** use npm pack for build uploads ([bdfd369](https://github.com/imagekit-developer/imagekit-nodejs/commit/bdfd369118542dad02cf8a0fae8713d0d8bea4eb))
+* mcp code tool explicit error message when missing a run function ([6678ee1](https://github.com/imagekit-developer/imagekit-nodejs/commit/6678ee13cc1eee5ce1ac51b672144be77c38e9ea))
+* **mcp:** add friendlier MCP code tool errors on incorrect method invocations ([636829d](https://github.com/imagekit-developer/imagekit-nodejs/commit/636829d18a7dda730b65c0549298258afcea6341))
+* **mcp:** add line numbers to code tool errors ([25e4e59](https://github.com/imagekit-developer/imagekit-nodejs/commit/25e4e59f434c07c2d9afeef3f548dd99e250a7ab))
+* **mcp:** clarify http auth error ([00789ac](https://github.com/imagekit-developer/imagekit-nodejs/commit/00789acfb9ceb07af0cd03b1951090f430691592))
+* **mcp:** update lockfile ([0703827](https://github.com/imagekit-developer/imagekit-nodejs/commit/07038271d5ec459516a8a936eb49f31490ccf6b0))
+* **mcp:** upgrade jq-web ([0750770](https://github.com/imagekit-developer/imagekit-nodejs/commit/075077081fc5826a4502a76a2abc40788f7915a3))
+* use latest @modelcontextprotocol/sdk ([f7b9b4e](https://github.com/imagekit-developer/imagekit-nodejs/commit/f7b9b4e55919b644d9445730c03c8972ecdfe0b7))
+* use structured error when code execution tool errors ([451f306](https://github.com/imagekit-developer/imagekit-nodejs/commit/451f306f6328e6c48374d0525dad9a0ddc6511d6))
+
+
+### Documentation
+
+* **mcp:** add a README button for one-click add to Cursor ([a7575d3](https://github.com/imagekit-developer/imagekit-nodejs/commit/a7575d308e3038715964f7416284bb012e27b240))
+* **mcp:** add a README link to add server to VS Code or Claude Code ([2a90d28](https://github.com/imagekit-developer/imagekit-nodejs/commit/2a90d2802e4814d97ec5bba77097eec2f0a5a718))
+
## 7.1.1 (2025-10-06)
Full Changelog: [v7.1.0...v7.1.1](https://github.com/imagekit-developer/imagekit-nodejs/compare/v7.1.0...v7.1.1)
diff --git a/api.md b/api.md
index 86719ecf..fc87a76f 100644
--- a/api.md
+++ b/api.md
@@ -4,10 +4,12 @@ Types:
- BaseOverlay
- Extensions
+- GetImageAttributesOptions
- ImageOverlay
- Overlay
- OverlayPosition
- OverlayTiming
+- ResponsiveImageAttributes
- SolidColorOverlay
- SolidColorOverlayTransformation
- SrcOptions
diff --git a/package.json b/package.json
index efd98c94..61182656 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@imagekit/nodejs",
- "version": "7.1.1",
+ "version": "7.2.0",
"description": "Offical NodeJS SDK for ImageKit.io integration",
"author": "Image Kit ",
"types": "dist/index.d.ts",
@@ -37,7 +37,7 @@
"@types/node": "^20.17.6",
"@typescript-eslint/eslint-plugin": "8.31.1",
"@typescript-eslint/parser": "8.31.1",
- "eslint": "^9.20.1",
+ "eslint": "^9.39.1",
"eslint-plugin-prettier": "^5.4.1",
"eslint-plugin-unused-imports": "^4.1.4",
"iconv-lite": "^0.6.3",
diff --git a/packages/mcp-server/README.md b/packages/mcp-server/README.md
index 38260a76..2c75fe1f 100644
--- a/packages/mcp-server/README.md
+++ b/packages/mcp-server/README.md
@@ -36,12 +36,36 @@ For clients with a configuration JSON, it might look something like this:
}
```
+### Cursor
+
+If you use Cursor, you can install the MCP server by using the button below. You will need to set your environment variables
+in Cursor's `mcp.json`, which can be found in Cursor Settings > Tools & MCP > New MCP Server.
+
+[](https://cursor.com/en-US/install-mcp?name=@imagekit/api-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBpbWFnZWtpdC9hcGktbWNwIl0sImVudiI6eyJJTUFHRUtJVF9QUklWQVRFX0tFWSI6IlNldCB5b3VyIElNQUdFS0lUX1BSSVZBVEVfS0VZIGhlcmUuIiwiT1BUSU9OQUxfSU1BR0VLSVRfSUdOT1JFU19USElTIjoiU2V0IHlvdXIgT1BUSU9OQUxfSU1BR0VLSVRfSUdOT1JFU19USElTIGhlcmUuIiwiSU1BR0VLSVRfV0VCSE9PS19TRUNSRVQiOiJTZXQgeW91ciBJTUFHRUtJVF9XRUJIT09LX1NFQ1JFVCBoZXJlLiJ9fQ)
+
+### VS Code
+
+If you use MCP, you can install the MCP server by clicking the link below. You will need to set your environment variables
+in VS Code's `mcp.json`, which can be found via Command Palette > MCP: Open User Configuration.
+
+[Open VS Code](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40imagekit%2Fapi-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40imagekit%2Fapi-mcp%22%5D%2C%22env%22%3A%7B%22IMAGEKIT_PRIVATE_KEY%22%3A%22Set%20your%20IMAGEKIT_PRIVATE_KEY%20here.%22%2C%22OPTIONAL_IMAGEKIT_IGNORES_THIS%22%3A%22Set%20your%20OPTIONAL_IMAGEKIT_IGNORES_THIS%20here.%22%2C%22IMAGEKIT_WEBHOOK_SECRET%22%3A%22Set%20your%20IMAGEKIT_WEBHOOK_SECRET%20here.%22%7D%7D)
+
+### Claude Code
+
+If you use Claude Code, you can install the MCP server by running the command below in your terminal. You will need to set your
+environment variables in Claude Code's `.claude.json`, which can be found in your home directory.
+
+```
+claude mcp add --transport stdio imagekit_nodejs_api --env IMAGEKIT_PRIVATE_KEY="Your IMAGEKIT_PRIVATE_KEY here." OPTIONAL_IMAGEKIT_IGNORES_THIS="Your OPTIONAL_IMAGEKIT_IGNORES_THIS here." IMAGEKIT_WEBHOOK_SECRET="Your IMAGEKIT_WEBHOOK_SECRET here." -- npx -y @imagekit/api-mcp
+```
+
## Exposing endpoints to your MCP Client
-There are two ways to expose endpoints as tools in the MCP server:
+There are three ways to expose endpoints as tools in the MCP server:
1. Exposing one tool per endpoint, and filtering as necessary
2. Exposing a set of tools to dynamically discover and invoke endpoints from the API
+3. Exposing a docs search tool and a code execution tool, allowing the client to write code to be executed against the TypeScript client
### Filtering endpoints and tools
@@ -76,6 +100,18 @@ All of these command-line options can be repeated, combined together, and have c
Use `--list` to see the list of available tools, or see below.
+### Code execution
+
+If you specify `--tools=code` to the MCP server, it will expose just two tools:
+
+- `search_docs` - Searches the API documentation and returns a list of markdown results
+- `execute` - Runs code against the TypeScript client
+
+This allows the LLM to implement more complex logic by chaining together many API calls without loading
+intermediary results into its context window.
+
+The code execution itself happens in a Deno sandbox that has network access only to the base URL for the API.
+
### Specifying the MCP Client
Different clients have varying abilities to handle arbitrary tools and schemas.
diff --git a/packages/mcp-server/cloudflare-worker/package.json b/packages/mcp-server/cloudflare-worker/package.json
index 85f7956d..1067db1d 100644
--- a/packages/mcp-server/cloudflare-worker/package.json
+++ b/packages/mcp-server/cloudflare-worker/package.json
@@ -18,7 +18,7 @@
},
"dependencies": {
"@cloudflare/workers-oauth-provider": "^0.0.5",
- "@modelcontextprotocol/sdk": "^1.11.4",
+ "@modelcontextprotocol/sdk": "^1.24.0",
"agents": "^0.0.88",
"hono": "^4.7.9",
"@imagekit/api-mcp": "latest",
diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json
index 572eee54..27c6bfe0 100644
--- a/packages/mcp-server/package.json
+++ b/packages/mcp-server/package.json
@@ -1,6 +1,6 @@
{
"name": "@imagekit/api-mcp",
- "version": "7.1.1",
+ "version": "7.2.0",
"description": "The official MCP Server for the Image Kit API",
"author": "Image Kit ",
"types": "dist/index.d.ts",
@@ -32,12 +32,14 @@
"dependencies": {
"@imagekit/nodejs": "file:../../dist/",
"@cloudflare/cabidela": "^0.2.4",
- "@modelcontextprotocol/sdk": "^1.11.5",
+ "@modelcontextprotocol/sdk": "^1.24.0",
"@valtown/deno-http-worker": "^0.0.21",
"cors": "^2.8.5",
"express": "^5.1.0",
- "jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.6/jq-web.tar.gz",
+ "fuse.js": "^7.1.0",
+ "jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz",
"qs": "^6.14.0",
+ "typescript": "5.8.3",
"yargs": "^17.7.2",
"zod": "^3.25.20",
"zod-to-json-schema": "^3.24.5",
@@ -47,7 +49,7 @@
"mcp-server": "dist/index.js"
},
"devDependencies": {
- "@anthropic-ai/mcpb": "^1.1.0",
+ "@anthropic-ai/mcpb": "1.1.0",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.3",
"@types/jest": "^29.4.0",
@@ -64,8 +66,7 @@
"ts-morph": "^19.0.0",
"ts-node": "^10.5.0",
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz",
- "tsconfig-paths": "^4.0.0",
- "typescript": "5.8.3"
+ "tsconfig-paths": "^4.0.0"
},
"imports": {
"@imagekit/api-mcp": ".",
diff --git a/packages/mcp-server/src/code-tool-paths.cts b/packages/mcp-server/src/code-tool-paths.cts
deleted file mode 100644
index 15ce7f55..00000000
--- a/packages/mcp-server/src/code-tool-paths.cts
+++ /dev/null
@@ -1,3 +0,0 @@
-// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-export const workerPath = require.resolve('./code-tool-worker.mjs');
diff --git a/packages/mcp-server/src/code-tool-types.ts b/packages/mcp-server/src/code-tool-types.ts
index 02e7e890..d3906768 100644
--- a/packages/mcp-server/src/code-tool-types.ts
+++ b/packages/mcp-server/src/code-tool-types.ts
@@ -11,4 +11,8 @@ export type WorkerSuccess = {
logLines: string[];
errLines: string[];
};
-export type WorkerError = { message: string | undefined };
+export type WorkerError = {
+ message: string | undefined;
+ logLines: string[];
+ errLines: string[];
+};
diff --git a/packages/mcp-server/src/code-tool-worker.ts b/packages/mcp-server/src/code-tool-worker.ts
deleted file mode 100644
index 865c3928..00000000
--- a/packages/mcp-server/src/code-tool-worker.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-import util from 'node:util';
-import { WorkerInput, WorkerSuccess, WorkerError } from './code-tool-types';
-import { ImageKit } from '@imagekit/nodejs';
-
-const fetch = async (req: Request): Promise => {
- const { opts, code } = (await req.json()) as WorkerInput;
- const client = new ImageKit({
- ...opts,
- });
-
- const logLines: string[] = [];
- const errLines: string[] = [];
- const console = {
- log: (...args: unknown[]) => {
- logLines.push(util.format(...args));
- },
- error: (...args: unknown[]) => {
- errLines.push(util.format(...args));
- },
- };
- try {
- let run_ = async (client: any) => {};
- eval(`
- ${code}
- run_ = run;
- `);
- const result = await run_(client);
- return Response.json({
- result,
- logLines,
- errLines,
- } satisfies WorkerSuccess);
- } catch (e) {
- const message = e instanceof Error ? e.message : undefined;
- return Response.json(
- {
- message,
- } satisfies WorkerError,
- { status: 400, statusText: 'Code execution error' },
- );
- }
-};
-
-export default { fetch };
diff --git a/packages/mcp-server/src/code-tool.ts b/packages/mcp-server/src/code-tool.ts
index 47d2064a..0f7231ca 100644
--- a/packages/mcp-server/src/code-tool.ts
+++ b/packages/mcp-server/src/code-tool.ts
@@ -1,147 +1,63 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { dirname } from 'node:path';
-import { pathToFileURL } from 'node:url';
-import ImageKit, { ClientOptions } from '@imagekit/nodejs';
-import { Endpoint, ContentBlock, Metadata } from './tools/types';
-
+import { Metadata, ToolCallResult, asTextContentResult } from './tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
-
-import { WorkerInput, WorkerError, WorkerSuccess } from './code-tool-types';
-
+import { readEnv } from './server';
+import { WorkerSuccess } from './code-tool-types';
/**
* A tool that runs code against a copy of the SDK.
*
- * Instead of exposing every endpoint as it's own tool, which uses up too many tokens for LLMs to use at once,
+ * Instead of exposing every endpoint as its own tool, which uses up too many tokens for LLMs to use at once,
* we expose a single tool that can be used to search for endpoints by name, resource, operation, or tag, and then
* a generic endpoint that can be used to invoke any endpoint with the provided arguments.
*
* @param endpoints - The endpoints to include in the list.
*/
-export async function codeTool(): Promise {
+export async function codeTool() {
const metadata: Metadata = { resource: 'all', operation: 'write', tags: [] };
const tool: Tool = {
name: 'execute',
description:
- '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.',
+ '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.',
inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
};
+ const handler = async (_: unknown, args: any): Promise => {
+ const code = args.code as string;
- // Import dynamically to avoid failing at import time in cases where the environment is not well-supported.
- const { newDenoHTTPWorker } = await import('@valtown/deno-http-worker');
- const { workerPath } = await import('./code-tool-paths.cjs');
+ // this is not required, but passing a Stainless API key for the matching project_name
+ // will allow you to run code-mode queries against non-published versions of your SDK.
+ const stainlessAPIKey = readEnv('STAINLESS_API_KEY');
+ const codeModeEndpoint =
+ readEnv('CODE_MODE_ENDPOINT_URL') ?? 'https://api.stainless.com/api/ai/code-tool';
- const handler = async (client: ImageKit, args: unknown) => {
- const baseURLHostname = new URL(client.baseURL).hostname;
- const { code } = args as { code: string };
-
- const worker = await newDenoHTTPWorker(pathToFileURL(workerPath), {
- runFlags: [
- `--node-modules-dir=manual`,
- `--allow-read=code-tool-worker.mjs,${workerPath.replace(/([\/\\]node_modules)[\/\\].+$/, '$1')}/`,
- `--allow-net=${baseURLHostname}`,
- // Allow environment variables because instantiating the client will try to read from them,
- // even though they are not set.
- '--allow-env',
- ],
- printOutput: true,
- spawnOptions: {
- cwd: dirname(workerPath),
+ const res = await fetch(codeModeEndpoint, {
+ method: 'POST',
+ headers: {
+ ...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
+ 'Content-Type': 'application/json',
+ client_envs: JSON.stringify({
+ IMAGEKIT_PRIVATE_KEY: readEnv('IMAGEKIT_PRIVATE_KEY'),
+ OPTIONAL_IMAGEKIT_IGNORES_THIS: readEnv('OPTIONAL_IMAGEKIT_IGNORES_THIS'),
+ IMAGEKIT_WEBHOOK_SECRET: readEnv('IMAGEKIT_WEBHOOK_SECRET'),
+ IMAGE_KIT_BASE_URL: readEnv('IMAGE_KIT_BASE_URL'),
+ }),
},
+ body: JSON.stringify({
+ project_name: 'imagekit',
+ client_opts: {},
+ code,
+ }),
});
- try {
- const resp = await new Promise((resolve, reject) => {
- worker.addEventListener('exit', (exitCode) => {
- reject(new Error(`Worker exited with code ${exitCode}`));
- });
-
- const opts: ClientOptions = {
- baseURL: client.baseURL,
- privateKey: client.privateKey,
- password: client.password,
- webhookSecret: client.webhookSecret,
- defaultHeaders: {
- 'X-Stainless-MCP': 'true',
- },
- };
-
- const req = worker.request(
- 'http://localhost',
- {
- headers: {
- 'content-type': 'application/json',
- },
- method: 'POST',
- },
- (resp) => {
- const body: Uint8Array[] = [];
- resp.on('error', (err) => {
- reject(err);
- });
- resp.on('data', (chunk) => {
- body.push(chunk);
- });
- resp.on('end', () => {
- resolve(
- new Response(Buffer.concat(body).toString(), {
- status: resp.statusCode ?? 200,
- headers: resp.headers as any,
- }),
- );
- });
- },
- );
-
- const body = JSON.stringify({
- opts,
- code,
- } satisfies WorkerInput);
-
- req.write(body, (err) => {
- if (err !== null && err !== undefined) {
- reject(err);
- }
- });
-
- req.end();
- });
-
- if (resp.status === 200) {
- const { result, logLines, errLines } = (await resp.json()) as WorkerSuccess;
- const returnOutput: ContentBlock | null =
- result === null ? null
- : result === undefined ? null
- : {
- type: 'text',
- text: typeof result === 'string' ? (result as string) : JSON.stringify(result),
- };
- const logOutput: ContentBlock | null =
- logLines.length === 0 ?
- null
- : {
- type: 'text',
- text: logLines.join('\n'),
- };
- const errOutput: ContentBlock | null =
- errLines.length === 0 ?
- null
- : {
- type: 'text',
- text: 'Error output:\n' + errLines.join('\n'),
- };
- return {
- content: [returnOutput, logOutput, errOutput].filter((block) => block !== null),
- };
- } else {
- const { message } = (await resp.json()) as WorkerError;
- throw new Error(message);
- }
- } catch (e) {
- throw e;
- } finally {
- worker.terminate();
+ if (!res.ok) {
+ throw new Error(
+ `${res.status}: ${
+ res.statusText
+ } error when trying to contact Code Tool server. Details: ${await res.text()}`,
+ );
}
+
+ return asTextContentResult((await res.json()) as WorkerSuccess);
};
return { metadata, tool, handler };
diff --git a/packages/mcp-server/src/docs-search-tool.ts b/packages/mcp-server/src/docs-search-tool.ts
index f05cd9b2..015a5ba1 100644
--- a/packages/mcp-server/src/docs-search-tool.ts
+++ b/packages/mcp-server/src/docs-search-tool.ts
@@ -13,8 +13,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'search_docs',
- description:
- 'Search for documentation for how to use the client to interact with the API.\nThe tool will return an array of Markdown-formatted documentation pages.',
+ description: 'Search for documentation for how to use the client to interact with the API.',
inputSchema: {
type: 'object',
properties: {
@@ -25,7 +24,12 @@ export const tool: Tool = {
language: {
type: 'string',
description: 'The language for the SDK to search for.',
- enum: ['http', 'python', 'go', 'typescript', 'terraform', 'ruby', 'java', 'kotlin'],
+ enum: ['http', 'python', 'go', 'typescript', 'javascript', 'terraform', 'ruby', 'java', 'kotlin'],
+ },
+ detail: {
+ type: 'string',
+ description: 'The amount of detail to return.',
+ enum: ['default', 'verbose'],
},
},
required: ['query', 'language'],
@@ -42,6 +46,13 @@ export const handler = async (_: unknown, args: Record | undefi
const body = args as any;
const query = new URLSearchParams(body).toString();
const result = await fetch(`${docsSearchURL}?${query}`);
+
+ if (!result.ok) {
+ throw new Error(
+ `${result.status}: ${result.statusText} when using doc search tool. Details: ${await result.text()}`,
+ );
+ }
+
return asTextContentResult(await result.json());
};
diff --git a/packages/mcp-server/src/dynamic-tools.ts b/packages/mcp-server/src/dynamic-tools.ts
index 47d60e0d..53676da1 100644
--- a/packages/mcp-server/src/dynamic-tools.ts
+++ b/packages/mcp-server/src/dynamic-tools.ts
@@ -14,7 +14,7 @@ function zodToInputSchema(schema: z.ZodSchema) {
/**
* A list of tools that expose all the endpoints in the API dynamically.
*
- * Instead of exposing every endpoint as it's own tool, which uses up too many tokens for LLMs to use at once,
+ * Instead of exposing every endpoint as its own tool, which uses up too many tokens for LLMs to use at once,
* we expose a single tool that can be used to search for endpoints by name, resource, operation, or tag, and then
* a generic endpoint that can be used to invoke any endpoint with the provided arguments.
*
diff --git a/packages/mcp-server/src/filtering.ts b/packages/mcp-server/src/filtering.ts
index 1aa9a40c..eaae0fcf 100644
--- a/packages/mcp-server/src/filtering.ts
+++ b/packages/mcp-server/src/filtering.ts
@@ -12,3 +12,7 @@ export async function maybeFilter(jqFilter: unknown | undefined, response: any):
async function jq(json: any, jqFilter: string) {
return (await initJq).json(json, jqFilter);
}
+
+export function isJqError(error: any): error is Error {
+ return error instanceof Error && 'stderr' in error;
+}
diff --git a/packages/mcp-server/src/headers.ts b/packages/mcp-server/src/headers.ts
index 63e3abc9..40fd3090 100644
--- a/packages/mcp-server/src/headers.ts
+++ b/packages/mcp-server/src/headers.ts
@@ -15,7 +15,9 @@ export const parseAuthHeaders = (req: IncomingMessage): Partial =
password: rawValue.slice(rawValue.search(':') + 1),
};
default:
- throw new Error(`Unsupported authorization scheme`);
+ throw new Error(
+ 'Unsupported authorization scheme. Expected the "Authorization" header to be a supported scheme (Basic).',
+ );
}
}
diff --git a/packages/mcp-server/src/http.ts b/packages/mcp-server/src/http.ts
index ec34ab47..84517003 100644
--- a/packages/mcp-server/src/http.ts
+++ b/packages/mcp-server/src/http.ts
@@ -46,12 +46,12 @@ const newServer = ({
},
mcpOptions,
});
- } catch {
+ } catch (error) {
res.status(401).json({
jsonrpc: '2.0',
error: {
code: -32000,
- message: 'Unauthorized',
+ message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
},
});
return null;
diff --git a/packages/mcp-server/src/options.ts b/packages/mcp-server/src/options.ts
index 4fe3b987..b6ff5976 100644
--- a/packages/mcp-server/src/options.ts
+++ b/packages/mcp-server/src/options.ts
@@ -284,8 +284,10 @@ const coerceArray = (zodType: T) =>
);
const QueryOptions = z.object({
- tools: coerceArray(z.enum(['dynamic', 'all', 'docs'])).describe('Use dynamic tools or all tools'),
- no_tools: coerceArray(z.enum(['dynamic', 'all', 'docs'])).describe('Do not use dynamic tools or all tools'),
+ tools: coerceArray(z.enum(['dynamic', 'all', 'code', 'docs'])).describe('Specify which MCP tools to use'),
+ no_tools: coerceArray(z.enum(['dynamic', 'all', 'code', 'docs'])).describe(
+ 'Specify which MCP tools to not use.',
+ ),
tool: coerceArray(z.string()).describe('Include tools matching the specified names'),
resource: coerceArray(z.string()).describe('Include tools matching the specified resources'),
operation: coerceArray(z.enum(['read', 'write'])).describe(
@@ -385,11 +387,16 @@ export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): M
: queryOptions.tools?.includes('docs') ? true
: defaultOptions.includeDocsTools;
+ let codeTools: boolean | undefined =
+ queryOptions.no_tools && queryOptions.no_tools?.includes('code') ? false
+ : queryOptions.tools?.includes('code') && defaultOptions.includeCodeTools ? true
+ : defaultOptions.includeCodeTools;
+
return {
client: queryOptions.client ?? defaultOptions.client,
includeDynamicTools: dynamicTools,
includeAllTools: allTools,
- includeCodeTools: undefined,
+ includeCodeTools: codeTools,
includeDocsTools: docsTools,
filters,
capabilities: clientCapabilities,
diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts
index 457cbb4b..4d00ee65 100644
--- a/packages/mcp-server/src/server.ts
+++ b/packages/mcp-server/src/server.ts
@@ -34,7 +34,7 @@ export const newMcpServer = () =>
new McpServer(
{
name: 'imagekit_nodejs_api',
- version: '7.1.1',
+ version: '7.2.0',
},
{ capabilities: { tools: {}, logging: {} } },
);
diff --git a/packages/mcp-server/src/tools/accounts/origins/create-accounts-origins.ts b/packages/mcp-server/src/tools/accounts/origins/create-accounts-origins.ts
index e46f5680..b802ca2a 100644
--- a/packages/mcp-server/src/tools/accounts/origins/create-accounts-origins.ts
+++ b/packages/mcp-server/src/tools/accounts/origins/create-accounts-origins.ts
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -312,7 +312,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const body = args as any;
- return asTextContentResult(await client.accounts.origins.create(body));
+ try {
+ return asTextContentResult(await client.accounts.origins.create(body));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/accounts/origins/get-accounts-origins.ts b/packages/mcp-server/src/tools/accounts/origins/get-accounts-origins.ts
index 86107b52..c699ff3c 100644
--- a/packages/mcp-server/src/tools/accounts/origins/get-accounts-origins.ts
+++ b/packages/mcp-server/src/tools/accounts/origins/get-accounts-origins.ts
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -35,7 +35,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { id, ...body } = args as any;
- return asTextContentResult(await client.accounts.origins.get(id));
+ try {
+ return asTextContentResult(await client.accounts.origins.get(id));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/accounts/origins/list-accounts-origins.ts b/packages/mcp-server/src/tools/accounts/origins/list-accounts-origins.ts
index 0510104b..e82908d6 100644
--- a/packages/mcp-server/src/tools/accounts/origins/list-accounts-origins.ts
+++ b/packages/mcp-server/src/tools/accounts/origins/list-accounts-origins.ts
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -29,7 +29,14 @@ export const tool: Tool = {
};
export const handler = async (client: ImageKit, args: Record | undefined) => {
- return asTextContentResult(await client.accounts.origins.list());
+ try {
+ return asTextContentResult(await client.accounts.origins.list());
+ } catch (error) {
+ if (error instanceof ImageKit.APIError) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/accounts/origins/update-accounts-origins.ts b/packages/mcp-server/src/tools/accounts/origins/update-accounts-origins.ts
index 91019fb7..515081fd 100644
--- a/packages/mcp-server/src/tools/accounts/origins/update-accounts-origins.ts
+++ b/packages/mcp-server/src/tools/accounts/origins/update-accounts-origins.ts
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -354,7 +354,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { id, ...body } = args as any;
- return asTextContentResult(await client.accounts.origins.update(id, body));
+ try {
+ return asTextContentResult(await client.accounts.origins.update(id, body));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/accounts/url-endpoints/create-accounts-url-endpoints.ts b/packages/mcp-server/src/tools/accounts/url-endpoints/create-accounts-url-endpoints.ts
index a4152360..4696ba95 100644
--- a/packages/mcp-server/src/tools/accounts/url-endpoints/create-accounts-url-endpoints.ts
+++ b/packages/mcp-server/src/tools/accounts/url-endpoints/create-accounts-url-endpoints.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -97,7 +97,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.accounts.urlEndpoints.create(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.accounts.urlEndpoints.create(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/accounts/url-endpoints/get-accounts-url-endpoints.ts b/packages/mcp-server/src/tools/accounts/url-endpoints/get-accounts-url-endpoints.ts
index 440628ad..5199e01f 100644
--- a/packages/mcp-server/src/tools/accounts/url-endpoints/get-accounts-url-endpoints.ts
+++ b/packages/mcp-server/src/tools/accounts/url-endpoints/get-accounts-url-endpoints.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -43,7 +43,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { id, jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.accounts.urlEndpoints.get(id)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.accounts.urlEndpoints.get(id)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/accounts/url-endpoints/list-accounts-url-endpoints.ts b/packages/mcp-server/src/tools/accounts/url-endpoints/list-accounts-url-endpoints.ts
index b565f8ad..a8d6262f 100644
--- a/packages/mcp-server/src/tools/accounts/url-endpoints/list-accounts-url-endpoints.ts
+++ b/packages/mcp-server/src/tools/accounts/url-endpoints/list-accounts-url-endpoints.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'list_accounts_url_endpoints',
description:
- "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\n**Note:** This API is currently in beta. \nReturns an array of all URL‑endpoints configured including the default URL-endpoint generated by ImageKit during account creation.\n\n\n# Response Schema\n```json\n{\n type: 'array',\n items: {\n $ref: '#/$defs/url_endpoint_response'\n },\n $defs: {\n url_endpoint_response: {\n type: 'object',\n title: 'URL‑endpoint Response',\n description: 'URL‑endpoint object as returned by the API.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`.'\n },\n description: {\n type: 'string',\n description: 'Description of the URL endpoint.'\n },\n origins: {\n type: 'array',\n description: 'Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint.',\n items: {\n type: 'string',\n description: 'Unique identifier for the origin. This is generated by ImageKit when you create a new origin.'\n }\n },\n urlPrefix: {\n type: 'string',\n description: 'Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint).'\n },\n urlRewriter: {\n anyOf: [ {\n type: 'object',\n title: 'Cloudinary URL Rewriter',\n properties: {\n preserveAssetDeliveryTypes: {\n type: 'boolean',\n description: 'Whether to preserve `/` in the rewritten URL.'\n },\n type: {\n type: 'string',\n enum: [ 'CLOUDINARY'\n ]\n }\n },\n required: [ 'preserveAssetDeliveryTypes',\n 'type'\n ]\n },\n {\n type: 'object',\n title: 'Imgix URL Rewriter',\n properties: {\n type: {\n type: 'string',\n enum: [ 'IMGIX'\n ]\n }\n },\n required: [ 'type'\n ]\n },\n {\n type: 'object',\n title: 'Akamai URL Rewriter',\n properties: {\n type: {\n type: 'string',\n enum: [ 'AKAMAI'\n ]\n }\n },\n required: [ 'type'\n ]\n }\n ],\n description: 'Configuration for third-party URL rewriting.'\n }\n },\n required: [ 'id',\n 'description',\n 'origins',\n 'urlPrefix'\n ]\n }\n }\n}\n```",
+ "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\n**Note:** This API is currently in beta. \nReturns an array of all URL‑endpoints configured including the default URL-endpoint generated by ImageKit during account creation.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/url_endpoint_list_response',\n $defs: {\n url_endpoint_list_response: {\n type: 'array',\n items: {\n $ref: '#/$defs/url_endpoint_response'\n }\n },\n url_endpoint_response: {\n type: 'object',\n title: 'URL‑endpoint Response',\n description: 'URL‑endpoint object as returned by the API.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`.'\n },\n description: {\n type: 'string',\n description: 'Description of the URL endpoint.'\n },\n origins: {\n type: 'array',\n description: 'Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint.',\n items: {\n type: 'string',\n description: 'Unique identifier for the origin. This is generated by ImageKit when you create a new origin.'\n }\n },\n urlPrefix: {\n type: 'string',\n description: 'Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint).'\n },\n urlRewriter: {\n anyOf: [ {\n type: 'object',\n title: 'Cloudinary URL Rewriter',\n properties: {\n preserveAssetDeliveryTypes: {\n type: 'boolean',\n description: 'Whether to preserve `/` in the rewritten URL.'\n },\n type: {\n type: 'string',\n enum: [ 'CLOUDINARY'\n ]\n }\n },\n required: [ 'preserveAssetDeliveryTypes',\n 'type'\n ]\n },\n {\n type: 'object',\n title: 'Imgix URL Rewriter',\n properties: {\n type: {\n type: 'string',\n enum: [ 'IMGIX'\n ]\n }\n },\n required: [ 'type'\n ]\n },\n {\n type: 'object',\n title: 'Akamai URL Rewriter',\n properties: {\n type: {\n type: 'string',\n enum: [ 'AKAMAI'\n ]\n }\n },\n required: [ 'type'\n ]\n }\n ],\n description: 'Configuration for third-party URL rewriting.'\n }\n },\n required: [ 'id',\n 'description',\n 'origins',\n 'urlPrefix'\n ]\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -38,7 +38,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.accounts.urlEndpoints.list()));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.accounts.urlEndpoints.list()));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/accounts/url-endpoints/update-accounts-url-endpoints.ts b/packages/mcp-server/src/tools/accounts/url-endpoints/update-accounts-url-endpoints.ts
index 6e9969b2..a1d5f56f 100644
--- a/packages/mcp-server/src/tools/accounts/url-endpoints/update-accounts-url-endpoints.ts
+++ b/packages/mcp-server/src/tools/accounts/url-endpoints/update-accounts-url-endpoints.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -104,9 +104,16 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { id, jq_filter, ...body } = args as any;
- return asTextContentResult(
- await maybeFilter(jq_filter, await client.accounts.urlEndpoints.update(id, body)),
- );
+ try {
+ return asTextContentResult(
+ await maybeFilter(jq_filter, await client.accounts.urlEndpoints.update(id, body)),
+ );
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/accounts/usage/get-accounts-usage.ts b/packages/mcp-server/src/tools/accounts/usage/get-accounts-usage.ts
index 09f47703..dffb2647 100644
--- a/packages/mcp-server/src/tools/accounts/usage/get-accounts-usage.ts
+++ b/packages/mcp-server/src/tools/accounts/usage/get-accounts-usage.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'get_accounts_usage',
description:
- "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\nGet the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n bandwidthBytes: {\n type: 'integer',\n description: 'Amount of bandwidth used in bytes.'\n },\n extensionUnitsCount: {\n type: 'integer',\n description: 'Number of extension units used.'\n },\n mediaLibraryStorageBytes: {\n type: 'integer',\n description: 'Storage used by media library in bytes.'\n },\n originalCacheStorageBytes: {\n type: 'integer',\n description: 'Storage used by the original cache in bytes.'\n },\n videoProcessingUnitsCount: {\n type: 'integer',\n description: 'Number of video processing units used.'\n }\n }\n}\n```",
+ "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\nGet the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/usage_get_response',\n $defs: {\n usage_get_response: {\n type: 'object',\n properties: {\n bandwidthBytes: {\n type: 'integer',\n description: 'Amount of bandwidth used in bytes.'\n },\n extensionUnitsCount: {\n type: 'integer',\n description: 'Number of extension units used.'\n },\n mediaLibraryStorageBytes: {\n type: 'integer',\n description: 'Storage used by media library in bytes.'\n },\n originalCacheStorageBytes: {\n type: 'integer',\n description: 'Storage used by the original cache in bytes.'\n },\n videoProcessingUnitsCount: {\n type: 'integer',\n description: 'Number of video processing units used.'\n }\n }\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -50,7 +50,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.accounts.usage.get(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.accounts.usage.get(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/assets/list-assets.ts b/packages/mcp-server/src/tools/assets/list-assets.ts
index 6da6273a..007773e3 100644
--- a/packages/mcp-server/src/tools/assets/list-assets.ts
+++ b/packages/mcp-server/src/tools/assets/list-assets.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'list_assets',
description:
- "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\nThis API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`.\n\n\n# Response Schema\n```json\n{\n type: 'array',\n items: {\n anyOf: [ {\n $ref: '#/$defs/file'\n },\n {\n $ref: '#/$defs/folder'\n }\n ],\n description: 'Object containing details of a file or file version.'\n },\n $defs: {\n file: {\n type: 'object',\n title: 'File & File Version',\n description: 'Object containing details of a file or file version.',\n properties: {\n AITags: {\n type: 'array',\n description: 'An array of tags assigned to the file by auto tagging.\\n',\n items: {\n type: 'object',\n properties: {\n confidence: {\n type: 'number',\n description: 'Confidence score of the tag.'\n },\n name: {\n type: 'string',\n description: 'Name of the tag.'\n },\n source: {\n type: 'string',\n description: 'Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-tagging`.'\n }\n }\n }\n },\n createdAt: {\n type: 'string',\n description: 'Date and time when the file was uploaded. The date and time is in ISO8601 format.\\n',\n format: 'date-time'\n },\n customCoordinates: {\n type: 'string',\n description: 'An string with custom coordinates of the file.\\n'\n },\n customMetadata: {\n type: 'object',\n description: 'An object with custom metadata for the file.\\n',\n additionalProperties: true\n },\n description: {\n type: 'string',\n description: 'Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension.\\n'\n },\n fileId: {\n type: 'string',\n description: 'Unique identifier of the asset.'\n },\n filePath: {\n type: 'string',\n description: 'Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`.\\n'\n },\n fileType: {\n type: 'string',\n description: 'Type of the file. Possible values are `image`, `non-image`.\\n'\n },\n hasAlpha: {\n type: 'boolean',\n description: 'Specifies if the image has an alpha channel.\\n'\n },\n height: {\n type: 'number',\n description: 'Height of the file.\\n'\n },\n isPrivateFile: {\n type: 'boolean',\n description: 'Specifies if the file is private or not.\\n'\n },\n isPublished: {\n type: 'boolean',\n description: 'Specifies if the file is published or not.\\n'\n },\n mime: {\n type: 'string',\n description: 'MIME type of the file.\\n'\n },\n name: {\n type: 'string',\n description: 'Name of the asset.'\n },\n selectedFieldsSchema: {\n type: 'object',\n description: 'This field is included in the response only if the Path policy feature is available in the plan.\\nIt contains schema definitions for the custom metadata fields selected for the specified file path.\\nField selection can only be done when the Path policy feature is enabled.\\n\\nKeys are the names of the custom metadata fields; the value object has details about the custom metadata schema.\\n',\n additionalProperties: true\n },\n size: {\n type: 'number',\n description: 'Size of the file in bytes.\\n'\n },\n tags: {\n type: 'array',\n description: 'An array of tags assigned to the file. Tags are used to search files in the media library.\\n',\n items: {\n type: 'string'\n }\n },\n thumbnail: {\n type: 'string',\n description: 'URL of the thumbnail image. This URL is used to access the thumbnail image of the file in the media library.\\n'\n },\n type: {\n type: 'string',\n description: 'Type of the asset.',\n enum: [ 'file',\n 'file-version'\n ]\n },\n updatedAt: {\n type: 'string',\n description: 'Date and time when the file was last updated. The date and time is in ISO8601 format.\\n',\n format: 'date-time'\n },\n url: {\n type: 'string',\n description: 'URL of the file.\\n'\n },\n versionInfo: {\n type: 'object',\n description: 'An object with details of the file version.\\n',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier of the file version.'\n },\n name: {\n type: 'string',\n description: 'Name of the file version.'\n }\n }\n },\n width: {\n type: 'number',\n description: 'Width of the file.\\n'\n }\n }\n },\n folder: {\n type: 'object',\n title: 'Folder',\n properties: {\n createdAt: {\n type: 'string',\n description: 'Date and time when the folder was created. The date and time is in ISO8601 format.\\n',\n format: 'date-time'\n },\n folderId: {\n type: 'string',\n description: 'Unique identifier of the asset.'\n },\n folderPath: {\n type: 'string',\n description: 'Path of the folder. This is the path you would use in the URL to access the folder. For example, if the folder is at the root of the media library, the path will be /folder. If the folder is inside another folder named images, the path will be /images/folder.\\n'\n },\n name: {\n type: 'string',\n description: 'Name of the asset.'\n },\n type: {\n type: 'string',\n description: 'Type of the asset.',\n enum: [ 'folder'\n ]\n },\n updatedAt: {\n type: 'string',\n description: 'Date and time when the folder was last updated. The date and time is in ISO8601 format.\\n',\n format: 'date-time'\n }\n }\n }\n }\n}\n```",
+ "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\nThis API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/asset_list_response',\n $defs: {\n asset_list_response: {\n type: 'array',\n items: {\n anyOf: [ {\n $ref: '#/$defs/file'\n },\n {\n $ref: '#/$defs/folder'\n }\n ],\n description: 'Object containing details of a file or file version.'\n }\n },\n file: {\n type: 'object',\n title: 'File & File Version',\n description: 'Object containing details of a file or file version.',\n properties: {\n AITags: {\n type: 'array',\n description: 'An array of tags assigned to the file by auto tagging.\\n',\n items: {\n type: 'object',\n properties: {\n confidence: {\n type: 'number',\n description: 'Confidence score of the tag.'\n },\n name: {\n type: 'string',\n description: 'Name of the tag.'\n },\n source: {\n type: 'string',\n description: 'Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-tagging`.'\n }\n }\n }\n },\n createdAt: {\n type: 'string',\n description: 'Date and time when the file was uploaded. The date and time is in ISO8601 format.\\n',\n format: 'date-time'\n },\n customCoordinates: {\n type: 'string',\n description: 'An string with custom coordinates of the file.\\n'\n },\n customMetadata: {\n type: 'object',\n description: 'An object with custom metadata for the file.\\n',\n additionalProperties: true\n },\n description: {\n type: 'string',\n description: 'Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension.\\n'\n },\n fileId: {\n type: 'string',\n description: 'Unique identifier of the asset.'\n },\n filePath: {\n type: 'string',\n description: 'Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`.\\n'\n },\n fileType: {\n type: 'string',\n description: 'Type of the file. Possible values are `image`, `non-image`.\\n'\n },\n hasAlpha: {\n type: 'boolean',\n description: 'Specifies if the image has an alpha channel.\\n'\n },\n height: {\n type: 'number',\n description: 'Height of the file.\\n'\n },\n isPrivateFile: {\n type: 'boolean',\n description: 'Specifies if the file is private or not.\\n'\n },\n isPublished: {\n type: 'boolean',\n description: 'Specifies if the file is published or not.\\n'\n },\n mime: {\n type: 'string',\n description: 'MIME type of the file.\\n'\n },\n name: {\n type: 'string',\n description: 'Name of the asset.'\n },\n selectedFieldsSchema: {\n type: 'object',\n description: 'This field is included in the response only if the Path policy feature is available in the plan.\\nIt contains schema definitions for the custom metadata fields selected for the specified file path.\\nField selection can only be done when the Path policy feature is enabled.\\n\\nKeys are the names of the custom metadata fields; the value object has details about the custom metadata schema.\\n',\n additionalProperties: true\n },\n size: {\n type: 'number',\n description: 'Size of the file in bytes.\\n'\n },\n tags: {\n type: 'array',\n description: 'An array of tags assigned to the file. Tags are used to search files in the media library.\\n',\n items: {\n type: 'string'\n }\n },\n thumbnail: {\n type: 'string',\n description: 'URL of the thumbnail image. This URL is used to access the thumbnail image of the file in the media library.\\n'\n },\n type: {\n type: 'string',\n description: 'Type of the asset.',\n enum: [ 'file',\n 'file-version'\n ]\n },\n updatedAt: {\n type: 'string',\n description: 'Date and time when the file was last updated. The date and time is in ISO8601 format.\\n',\n format: 'date-time'\n },\n url: {\n type: 'string',\n description: 'URL of the file.\\n'\n },\n versionInfo: {\n type: 'object',\n description: 'An object with details of the file version.\\n',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier of the file version.'\n },\n name: {\n type: 'string',\n description: 'Name of the file version.'\n }\n }\n },\n width: {\n type: 'number',\n description: 'Width of the file.\\n'\n }\n }\n },\n folder: {\n type: 'object',\n title: 'Folder',\n properties: {\n createdAt: {\n type: 'string',\n description: 'Date and time when the folder was created. The date and time is in ISO8601 format.\\n',\n format: 'date-time'\n },\n folderId: {\n type: 'string',\n description: 'Unique identifier of the asset.'\n },\n folderPath: {\n type: 'string',\n description: 'Path of the folder. This is the path you would use in the URL to access the folder. For example, if the folder is at the root of the media library, the path will be /folder. If the folder is inside another folder named images, the path will be /images/folder.\\n'\n },\n name: {\n type: 'string',\n description: 'Name of the asset.'\n },\n type: {\n type: 'string',\n description: 'Type of the asset.',\n enum: [ 'folder'\n ]\n },\n updatedAt: {\n type: 'string',\n description: 'Date and time when the folder was last updated. The date and time is in ISO8601 format.\\n',\n format: 'date-time'\n }\n }\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -88,7 +88,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.assets.list(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.assets.list(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/beta/v2/files/upload-v2-beta-files.ts b/packages/mcp-server/src/tools/beta/v2/files/upload-v2-beta-files.ts
index 9a45009d..533c6d33 100644
--- a/packages/mcp-server/src/tools/beta/v2/files/upload-v2-beta-files.ts
+++ b/packages/mcp-server/src/tools/beta/v2/files/upload-v2-beta-files.ts
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -310,7 +310,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const body = args as any;
- return asTextContentResult(await client.beta.v2.files.upload(body));
+ try {
+ return asTextContentResult(await client.beta.v2.files.upload(body));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/cache/invalidation/create-cache-invalidation.ts b/packages/mcp-server/src/tools/cache/invalidation/create-cache-invalidation.ts
index 1e73f174..d0a79cdc 100644
--- a/packages/mcp-server/src/tools/cache/invalidation/create-cache-invalidation.ts
+++ b/packages/mcp-server/src/tools/cache/invalidation/create-cache-invalidation.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'create_cache_invalidation',
description:
- "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\nThis API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n requestId: {\n type: 'string',\n description: 'Unique identifier of the purge request. This can be used to check the status of the purge request.\\n'\n }\n }\n}\n```",
+ "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\nThis API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/invalidation_create_response',\n $defs: {\n invalidation_create_response: {\n type: 'object',\n properties: {\n requestId: {\n type: 'string',\n description: 'Unique identifier of the purge request. This can be used to check the status of the purge request.\\n'\n }\n }\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -40,7 +40,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.cache.invalidation.create(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.cache.invalidation.create(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/cache/invalidation/get-cache-invalidation.ts b/packages/mcp-server/src/tools/cache/invalidation/get-cache-invalidation.ts
index a9a7afc4..6fca57fe 100644
--- a/packages/mcp-server/src/tools/cache/invalidation/get-cache-invalidation.ts
+++ b/packages/mcp-server/src/tools/cache/invalidation/get-cache-invalidation.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'get_cache_invalidation',
description:
- "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\nThis API returns the status of a purge cache request.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n status: {\n type: 'string',\n description: 'Status of the purge request.',\n enum: [ 'Pending',\n 'Completed'\n ]\n }\n }\n}\n```",
+ "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\nThis API returns the status of a purge cache request.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/invalidation_get_response',\n $defs: {\n invalidation_get_response: {\n type: 'object',\n properties: {\n status: {\n type: 'string',\n description: 'Status of the purge request.',\n enum: [ 'Pending',\n 'Completed'\n ]\n }\n }\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -41,7 +41,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { requestId, jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.cache.invalidation.get(requestId)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.cache.invalidation.get(requestId)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/custom-metadata-fields/create-custom-metadata-fields.ts b/packages/mcp-server/src/tools/custom-metadata-fields/create-custom-metadata-fields.ts
index 67cf2ec6..666f950d 100644
--- a/packages/mcp-server/src/tools/custom-metadata-fields/create-custom-metadata-fields.ts
+++ b/packages/mcp-server/src/tools/custom-metadata-fields/create-custom-metadata-fields.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -148,7 +148,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.customMetadataFields.create(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.customMetadataFields.create(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/custom-metadata-fields/delete-custom-metadata-fields.ts b/packages/mcp-server/src/tools/custom-metadata-fields/delete-custom-metadata-fields.ts
index f26b7b65..75a37e22 100644
--- a/packages/mcp-server/src/tools/custom-metadata-fields/delete-custom-metadata-fields.ts
+++ b/packages/mcp-server/src/tools/custom-metadata-fields/delete-custom-metadata-fields.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'delete_custom_metadata_fields',
description:
- "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\nThis API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {}\n}\n```",
+ "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\nThis API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/custom_metadata_field_delete_response',\n $defs: {\n custom_metadata_field_delete_response: {\n type: 'object',\n properties: {}\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -41,7 +41,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { id, jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.customMetadataFields.delete(id)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.customMetadataFields.delete(id)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/custom-metadata-fields/list-custom-metadata-fields.ts b/packages/mcp-server/src/tools/custom-metadata-fields/list-custom-metadata-fields.ts
index 0367d7d1..a473365d 100644
--- a/packages/mcp-server/src/tools/custom-metadata-fields/list-custom-metadata-fields.ts
+++ b/packages/mcp-server/src/tools/custom-metadata-fields/list-custom-metadata-fields.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'list_custom_metadata_fields',
description:
- "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\nThis API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response.\n\nYou can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path.\n\n\n# Response Schema\n```json\n{\n type: 'array',\n items: {\n $ref: '#/$defs/custom_metadata_field'\n },\n $defs: {\n custom_metadata_field: {\n type: 'object',\n description: 'Object containing details of a custom metadata field.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the custom metadata field. Use this to update the field.'\n },\n label: {\n type: 'string',\n description: 'Human readable name of the custom metadata field. This name is displayed as form field label to the users while setting field value on the asset in the media library UI.\\n'\n },\n name: {\n type: 'string',\n description: 'API name of the custom metadata field. This becomes the key while setting `customMetadata` (key-value object) for an asset using upload or update API.\\n'\n },\n schema: {\n type: 'object',\n description: 'An object that describes the rules for the custom metadata field value.',\n properties: {\n type: {\n type: 'string',\n description: 'Type of the custom metadata field.',\n enum: [ 'Text',\n 'Textarea',\n 'Number',\n 'Date',\n 'Boolean',\n 'SingleSelect',\n 'MultiSelect'\n ]\n },\n defaultValue: {\n anyOf: [ {\n type: 'string'\n },\n {\n type: 'number'\n },\n {\n type: 'boolean'\n },\n {\n type: 'array',\n title: 'Mixed',\n description: 'Default value should be of type array when custom metadata field type is set to `MultiSelect`.\\n',\n items: {\n anyOf: [ {\n type: 'string'\n },\n {\n type: 'number'\n },\n {\n type: 'boolean'\n }\n ]\n }\n }\n ],\n description: 'The default value for this custom metadata field. Data type of default value depends on the field type.\\n'\n },\n isValueRequired: {\n type: 'boolean',\n description: 'Specifies if the this custom metadata field is required or not.\\n'\n },\n maxLength: {\n type: 'number',\n description: 'Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.\\n'\n },\n maxValue: {\n anyOf: [ {\n type: 'string'\n },\n {\n type: 'number'\n }\n ],\n description: 'Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value.\\n'\n },\n minLength: {\n type: 'number',\n description: 'Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.\\n'\n },\n minValue: {\n anyOf: [ {\n type: 'string'\n },\n {\n type: 'number'\n }\n ],\n description: 'Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value.\\n'\n },\n selectOptions: {\n type: 'array',\n description: 'An array of allowed values when field type is `SingleSelect` or `MultiSelect`.\\n',\n items: {\n anyOf: [ {\n type: 'string'\n },\n {\n type: 'number'\n },\n {\n type: 'boolean'\n }\n ]\n }\n }\n },\n required: [ 'type'\n ]\n }\n },\n required: [ 'id',\n 'label',\n 'name',\n 'schema'\n ]\n }\n }\n}\n```",
+ "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\nThis API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response.\n\nYou can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/custom_metadata_field_list_response',\n $defs: {\n custom_metadata_field_list_response: {\n type: 'array',\n items: {\n $ref: '#/$defs/custom_metadata_field'\n }\n },\n custom_metadata_field: {\n type: 'object',\n description: 'Object containing details of a custom metadata field.',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier for the custom metadata field. Use this to update the field.'\n },\n label: {\n type: 'string',\n description: 'Human readable name of the custom metadata field. This name is displayed as form field label to the users while setting field value on the asset in the media library UI.\\n'\n },\n name: {\n type: 'string',\n description: 'API name of the custom metadata field. This becomes the key while setting `customMetadata` (key-value object) for an asset using upload or update API.\\n'\n },\n schema: {\n type: 'object',\n description: 'An object that describes the rules for the custom metadata field value.',\n properties: {\n type: {\n type: 'string',\n description: 'Type of the custom metadata field.',\n enum: [ 'Text',\n 'Textarea',\n 'Number',\n 'Date',\n 'Boolean',\n 'SingleSelect',\n 'MultiSelect'\n ]\n },\n defaultValue: {\n anyOf: [ {\n type: 'string'\n },\n {\n type: 'number'\n },\n {\n type: 'boolean'\n },\n {\n type: 'array',\n title: 'Mixed',\n description: 'Default value should be of type array when custom metadata field type is set to `MultiSelect`.\\n',\n items: {\n anyOf: [ {\n type: 'string'\n },\n {\n type: 'number'\n },\n {\n type: 'boolean'\n }\n ]\n }\n }\n ],\n description: 'The default value for this custom metadata field. Data type of default value depends on the field type.\\n'\n },\n isValueRequired: {\n type: 'boolean',\n description: 'Specifies if the this custom metadata field is required or not.\\n'\n },\n maxLength: {\n type: 'number',\n description: 'Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.\\n'\n },\n maxValue: {\n anyOf: [ {\n type: 'string'\n },\n {\n type: 'number'\n }\n ],\n description: 'Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value.\\n'\n },\n minLength: {\n type: 'number',\n description: 'Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.\\n'\n },\n minValue: {\n anyOf: [ {\n type: 'string'\n },\n {\n type: 'number'\n }\n ],\n description: 'Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value.\\n'\n },\n selectOptions: {\n type: 'array',\n description: 'An array of allowed values when field type is `SingleSelect` or `MultiSelect`.\\n',\n items: {\n anyOf: [ {\n type: 'string'\n },\n {\n type: 'number'\n },\n {\n type: 'boolean'\n }\n ]\n }\n }\n },\n required: [ 'type'\n ]\n }\n },\n required: [ 'id',\n 'label',\n 'name',\n 'schema'\n ]\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -47,7 +47,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.customMetadataFields.list(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.customMetadataFields.list(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/custom-metadata-fields/update-custom-metadata-fields.ts b/packages/mcp-server/src/tools/custom-metadata-fields/update-custom-metadata-fields.ts
index f49b10dd..7bb0470f 100644
--- a/packages/mcp-server/src/tools/custom-metadata-fields/update-custom-metadata-fields.ts
+++ b/packages/mcp-server/src/tools/custom-metadata-fields/update-custom-metadata-fields.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -142,9 +142,16 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { id, jq_filter, ...body } = args as any;
- return asTextContentResult(
- await maybeFilter(jq_filter, await client.customMetadataFields.update(id, body)),
- );
+ try {
+ return asTextContentResult(
+ await maybeFilter(jq_filter, await client.customMetadataFields.update(id, body)),
+ );
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/bulk/add-tags-files-bulk.ts b/packages/mcp-server/src/tools/files/bulk/add-tags-files-bulk.ts
index 3aa9970c..efd2ad77 100644
--- a/packages/mcp-server/src/tools/files/bulk/add-tags-files-bulk.ts
+++ b/packages/mcp-server/src/tools/files/bulk/add-tags-files-bulk.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'add_tags_files_bulk',
description:
- "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\nThis API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n successfullyUpdatedFileIds: {\n type: 'array',\n description: 'An array of fileIds that in which tags were successfully added.\\n',\n items: {\n type: 'string'\n }\n }\n }\n}\n```",
+ "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\nThis API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/bulk_add_tags_response',\n $defs: {\n bulk_add_tags_response: {\n type: 'object',\n properties: {\n successfullyUpdatedFileIds: {\n type: 'array',\n description: 'An array of fileIds that in which tags were successfully added.\\n',\n items: {\n type: 'string'\n }\n }\n }\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -50,7 +50,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.files.bulk.addTags(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.files.bulk.addTags(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/bulk/delete-files-bulk.ts b/packages/mcp-server/src/tools/files/bulk/delete-files-bulk.ts
index 471b0c93..3ba1f4c7 100644
--- a/packages/mcp-server/src/tools/files/bulk/delete-files-bulk.ts
+++ b/packages/mcp-server/src/tools/files/bulk/delete-files-bulk.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'delete_files_bulk',
description:
- "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\nThis API deletes multiple files and all their file versions permanently.\n\nNote: If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using purge cache API.\n\nA maximum of 100 files can be deleted at a time.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n successfullyDeletedFileIds: {\n type: 'array',\n description: 'An array of fileIds that were successfully deleted.\\n',\n items: {\n type: 'string'\n }\n }\n }\n}\n```",
+ "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\nThis API deletes multiple files and all their file versions permanently.\n\nNote: If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using purge cache API.\n\nA maximum of 100 files can be deleted at a time.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/bulk_delete_response',\n $defs: {\n bulk_delete_response: {\n type: 'object',\n properties: {\n successfullyDeletedFileIds: {\n type: 'array',\n description: 'An array of fileIds that were successfully deleted.\\n',\n items: {\n type: 'string'\n }\n }\n }\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -43,7 +43,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.files.bulk.delete(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.files.bulk.delete(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/bulk/remove-ai-tags-files-bulk.ts b/packages/mcp-server/src/tools/files/bulk/remove-ai-tags-files-bulk.ts
index 28ea4b62..a2cdf3bf 100644
--- a/packages/mcp-server/src/tools/files/bulk/remove-ai-tags-files-bulk.ts
+++ b/packages/mcp-server/src/tools/files/bulk/remove-ai-tags-files-bulk.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'remove_ai_tags_files_bulk',
description:
- "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\nThis API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n successfullyUpdatedFileIds: {\n type: 'array',\n description: 'An array of fileIds that in which AITags were successfully removed.\\n',\n items: {\n type: 'string'\n }\n }\n }\n}\n```",
+ "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\nThis API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/bulk_remove_ai_tags_response',\n $defs: {\n bulk_remove_ai_tags_response: {\n type: 'object',\n properties: {\n successfullyUpdatedFileIds: {\n type: 'array',\n description: 'An array of fileIds that in which AITags were successfully removed.\\n',\n items: {\n type: 'string'\n }\n }\n }\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -50,7 +50,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.files.bulk.removeAITags(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.files.bulk.removeAITags(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/bulk/remove-tags-files-bulk.ts b/packages/mcp-server/src/tools/files/bulk/remove-tags-files-bulk.ts
index 2fd2661e..62520e20 100644
--- a/packages/mcp-server/src/tools/files/bulk/remove-tags-files-bulk.ts
+++ b/packages/mcp-server/src/tools/files/bulk/remove-tags-files-bulk.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'remove_tags_files_bulk',
description:
- "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\nThis API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n successfullyUpdatedFileIds: {\n type: 'array',\n description: 'An array of fileIds that in which tags were successfully removed.\\n',\n items: {\n type: 'string'\n }\n }\n }\n}\n```",
+ "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\nThis API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/bulk_remove_tags_response',\n $defs: {\n bulk_remove_tags_response: {\n type: 'object',\n properties: {\n successfullyUpdatedFileIds: {\n type: 'array',\n description: 'An array of fileIds that in which tags were successfully removed.\\n',\n items: {\n type: 'string'\n }\n }\n }\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -50,7 +50,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.files.bulk.removeTags(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.files.bulk.removeTags(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/copy-files.ts b/packages/mcp-server/src/tools/files/copy-files.ts
index 6dffab77..e69f89ee 100644
--- a/packages/mcp-server/src/tools/files/copy-files.ts
+++ b/packages/mcp-server/src/tools/files/copy-files.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'copy_files',
description:
- "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\nThis will copy a file from one folder to another. \n\nNote: If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {}\n}\n```",
+ "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\nThis will copy a file from one folder to another. \n\nNote: If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/file_copy_response',\n $defs: {\n file_copy_response: {\n type: 'object',\n properties: {}\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -49,7 +49,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.files.copy(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.files.copy(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/get-files.ts b/packages/mcp-server/src/tools/files/get-files.ts
index 958ab961..8606b93c 100644
--- a/packages/mcp-server/src/tools/files/get-files.ts
+++ b/packages/mcp-server/src/tools/files/get-files.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -41,7 +41,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { fileId, jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.files.get(fileId)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.files.get(fileId)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/metadata/get-files-metadata.ts b/packages/mcp-server/src/tools/files/metadata/get-files-metadata.ts
index 04cf9ad4..4bc2a401 100644
--- a/packages/mcp-server/src/tools/files/metadata/get-files-metadata.ts
+++ b/packages/mcp-server/src/tools/files/metadata/get-files-metadata.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -41,7 +41,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { fileId, jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.files.metadata.get(fileId)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.files.metadata.get(fileId)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/metadata/get-from-url-files-metadata.ts b/packages/mcp-server/src/tools/files/metadata/get-from-url-files-metadata.ts
index 08ec83c9..f9aac486 100644
--- a/packages/mcp-server/src/tools/files/metadata/get-from-url-files-metadata.ts
+++ b/packages/mcp-server/src/tools/files/metadata/get-from-url-files-metadata.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -42,7 +42,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.files.metadata.getFromURL(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.files.metadata.getFromURL(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/move-files.ts b/packages/mcp-server/src/tools/files/move-files.ts
index 48c159a2..c044a04e 100644
--- a/packages/mcp-server/src/tools/files/move-files.ts
+++ b/packages/mcp-server/src/tools/files/move-files.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'move_files',
description:
- "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\nThis will move a file and all its versions from one folder to another. \n\nNote: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {}\n}\n```",
+ "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\nThis will move a file and all its versions from one folder to another. \n\nNote: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/file_move_response',\n $defs: {\n file_move_response: {\n type: 'object',\n properties: {}\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -44,7 +44,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.files.move(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.files.move(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/rename-files.ts b/packages/mcp-server/src/tools/files/rename-files.ts
index 2e76c956..046afef5 100644
--- a/packages/mcp-server/src/tools/files/rename-files.ts
+++ b/packages/mcp-server/src/tools/files/rename-files.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'rename_files',
description:
- "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\nYou can rename an already existing file in the media library using rename file API. This operation would rename all file versions of the file. \n\nNote: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n purgeRequestId: {\n type: 'string',\n description: 'Unique identifier of the purge request. This can be used to check the status of the purge request.\\n'\n }\n }\n}\n```",
+ "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\nYou can rename an already existing file in the media library using rename file API. This operation would rename all file versions of the file. \n\nNote: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/file_rename_response',\n $defs: {\n file_rename_response: {\n type: 'object',\n properties: {\n purgeRequestId: {\n type: 'string',\n description: 'Unique identifier of the purge request. This can be used to check the status of the purge request.\\n'\n }\n }\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -52,7 +52,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.files.rename(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.files.rename(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/update-files.ts b/packages/mcp-server/src/tools/files/update-files.ts
index e21194ca..99218ddf 100644
--- a/packages/mcp-server/src/tools/files/update-files.ts
+++ b/packages/mcp-server/src/tools/files/update-files.ts
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -190,7 +190,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { fileId, ...body } = args as any;
- return asTextContentResult(await client.files.update(fileId, body));
+ try {
+ return asTextContentResult(await client.files.update(fileId, body));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/upload-files.ts b/packages/mcp-server/src/tools/files/upload-files.ts
index 60e8fdda..d49e5a75 100644
--- a/packages/mcp-server/src/tools/files/upload-files.ts
+++ b/packages/mcp-server/src/tools/files/upload-files.ts
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -326,7 +326,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const body = args as any;
- return asTextContentResult(await client.files.upload(body));
+ try {
+ return asTextContentResult(await client.files.upload(body));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/versions/delete-files-versions.ts b/packages/mcp-server/src/tools/files/versions/delete-files-versions.ts
index df4b1b92..6903001d 100644
--- a/packages/mcp-server/src/tools/files/versions/delete-files-versions.ts
+++ b/packages/mcp-server/src/tools/files/versions/delete-files-versions.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'delete_files_versions',
description:
- "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\nThis API deletes a non-current file version permanently. The API returns an empty response.\n\nNote: If you want to delete all versions of a file, use the delete file API.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {}\n}\n```",
+ "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\nThis API deletes a non-current file version permanently. The API returns an empty response.\n\nNote: If you want to delete all versions of a file, use the delete file API.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/version_delete_response',\n $defs: {\n version_delete_response: {\n type: 'object',\n properties: {}\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -44,9 +44,16 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { versionId, jq_filter, ...body } = args as any;
- return asTextContentResult(
- await maybeFilter(jq_filter, await client.files.versions.delete(versionId, body)),
- );
+ try {
+ return asTextContentResult(
+ await maybeFilter(jq_filter, await client.files.versions.delete(versionId, body)),
+ );
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/versions/get-files-versions.ts b/packages/mcp-server/src/tools/files/versions/get-files-versions.ts
index bf05d7d1..dfe562ab 100644
--- a/packages/mcp-server/src/tools/files/versions/get-files-versions.ts
+++ b/packages/mcp-server/src/tools/files/versions/get-files-versions.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -44,7 +44,16 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { versionId, jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.files.versions.get(versionId, body)));
+ try {
+ return asTextContentResult(
+ await maybeFilter(jq_filter, await client.files.versions.get(versionId, body)),
+ );
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/versions/list-files-versions.ts b/packages/mcp-server/src/tools/files/versions/list-files-versions.ts
index 7ea542e2..eb6b82c9 100644
--- a/packages/mcp-server/src/tools/files/versions/list-files-versions.ts
+++ b/packages/mcp-server/src/tools/files/versions/list-files-versions.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'list_files_versions',
description:
- "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\nThis API returns details of all versions of a file.\n\n\n# Response Schema\n```json\n{\n type: 'array',\n items: {\n $ref: '#/$defs/file'\n },\n $defs: {\n file: {\n type: 'object',\n title: 'File & File Version',\n description: 'Object containing details of a file or file version.',\n properties: {\n AITags: {\n type: 'array',\n description: 'An array of tags assigned to the file by auto tagging.\\n',\n items: {\n type: 'object',\n properties: {\n confidence: {\n type: 'number',\n description: 'Confidence score of the tag.'\n },\n name: {\n type: 'string',\n description: 'Name of the tag.'\n },\n source: {\n type: 'string',\n description: 'Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-tagging`.'\n }\n }\n }\n },\n createdAt: {\n type: 'string',\n description: 'Date and time when the file was uploaded. The date and time is in ISO8601 format.\\n',\n format: 'date-time'\n },\n customCoordinates: {\n type: 'string',\n description: 'An string with custom coordinates of the file.\\n'\n },\n customMetadata: {\n type: 'object',\n description: 'An object with custom metadata for the file.\\n',\n additionalProperties: true\n },\n description: {\n type: 'string',\n description: 'Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension.\\n'\n },\n fileId: {\n type: 'string',\n description: 'Unique identifier of the asset.'\n },\n filePath: {\n type: 'string',\n description: 'Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`.\\n'\n },\n fileType: {\n type: 'string',\n description: 'Type of the file. Possible values are `image`, `non-image`.\\n'\n },\n hasAlpha: {\n type: 'boolean',\n description: 'Specifies if the image has an alpha channel.\\n'\n },\n height: {\n type: 'number',\n description: 'Height of the file.\\n'\n },\n isPrivateFile: {\n type: 'boolean',\n description: 'Specifies if the file is private or not.\\n'\n },\n isPublished: {\n type: 'boolean',\n description: 'Specifies if the file is published or not.\\n'\n },\n mime: {\n type: 'string',\n description: 'MIME type of the file.\\n'\n },\n name: {\n type: 'string',\n description: 'Name of the asset.'\n },\n selectedFieldsSchema: {\n type: 'object',\n description: 'This field is included in the response only if the Path policy feature is available in the plan.\\nIt contains schema definitions for the custom metadata fields selected for the specified file path.\\nField selection can only be done when the Path policy feature is enabled.\\n\\nKeys are the names of the custom metadata fields; the value object has details about the custom metadata schema.\\n',\n additionalProperties: true\n },\n size: {\n type: 'number',\n description: 'Size of the file in bytes.\\n'\n },\n tags: {\n type: 'array',\n description: 'An array of tags assigned to the file. Tags are used to search files in the media library.\\n',\n items: {\n type: 'string'\n }\n },\n thumbnail: {\n type: 'string',\n description: 'URL of the thumbnail image. This URL is used to access the thumbnail image of the file in the media library.\\n'\n },\n type: {\n type: 'string',\n description: 'Type of the asset.',\n enum: [ 'file',\n 'file-version'\n ]\n },\n updatedAt: {\n type: 'string',\n description: 'Date and time when the file was last updated. The date and time is in ISO8601 format.\\n',\n format: 'date-time'\n },\n url: {\n type: 'string',\n description: 'URL of the file.\\n'\n },\n versionInfo: {\n type: 'object',\n description: 'An object with details of the file version.\\n',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier of the file version.'\n },\n name: {\n type: 'string',\n description: 'Name of the file version.'\n }\n }\n },\n width: {\n type: 'number',\n description: 'Width of the file.\\n'\n }\n }\n }\n }\n}\n```",
+ "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\nThis API returns details of all versions of a file.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/version_list_response',\n $defs: {\n version_list_response: {\n type: 'array',\n items: {\n $ref: '#/$defs/file'\n }\n },\n file: {\n type: 'object',\n title: 'File & File Version',\n description: 'Object containing details of a file or file version.',\n properties: {\n AITags: {\n type: 'array',\n description: 'An array of tags assigned to the file by auto tagging.\\n',\n items: {\n type: 'object',\n properties: {\n confidence: {\n type: 'number',\n description: 'Confidence score of the tag.'\n },\n name: {\n type: 'string',\n description: 'Name of the tag.'\n },\n source: {\n type: 'string',\n description: 'Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-tagging`.'\n }\n }\n }\n },\n createdAt: {\n type: 'string',\n description: 'Date and time when the file was uploaded. The date and time is in ISO8601 format.\\n',\n format: 'date-time'\n },\n customCoordinates: {\n type: 'string',\n description: 'An string with custom coordinates of the file.\\n'\n },\n customMetadata: {\n type: 'object',\n description: 'An object with custom metadata for the file.\\n',\n additionalProperties: true\n },\n description: {\n type: 'string',\n description: 'Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension.\\n'\n },\n fileId: {\n type: 'string',\n description: 'Unique identifier of the asset.'\n },\n filePath: {\n type: 'string',\n description: 'Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`.\\n'\n },\n fileType: {\n type: 'string',\n description: 'Type of the file. Possible values are `image`, `non-image`.\\n'\n },\n hasAlpha: {\n type: 'boolean',\n description: 'Specifies if the image has an alpha channel.\\n'\n },\n height: {\n type: 'number',\n description: 'Height of the file.\\n'\n },\n isPrivateFile: {\n type: 'boolean',\n description: 'Specifies if the file is private or not.\\n'\n },\n isPublished: {\n type: 'boolean',\n description: 'Specifies if the file is published or not.\\n'\n },\n mime: {\n type: 'string',\n description: 'MIME type of the file.\\n'\n },\n name: {\n type: 'string',\n description: 'Name of the asset.'\n },\n selectedFieldsSchema: {\n type: 'object',\n description: 'This field is included in the response only if the Path policy feature is available in the plan.\\nIt contains schema definitions for the custom metadata fields selected for the specified file path.\\nField selection can only be done when the Path policy feature is enabled.\\n\\nKeys are the names of the custom metadata fields; the value object has details about the custom metadata schema.\\n',\n additionalProperties: true\n },\n size: {\n type: 'number',\n description: 'Size of the file in bytes.\\n'\n },\n tags: {\n type: 'array',\n description: 'An array of tags assigned to the file. Tags are used to search files in the media library.\\n',\n items: {\n type: 'string'\n }\n },\n thumbnail: {\n type: 'string',\n description: 'URL of the thumbnail image. This URL is used to access the thumbnail image of the file in the media library.\\n'\n },\n type: {\n type: 'string',\n description: 'Type of the asset.',\n enum: [ 'file',\n 'file-version'\n ]\n },\n updatedAt: {\n type: 'string',\n description: 'Date and time when the file was last updated. The date and time is in ISO8601 format.\\n',\n format: 'date-time'\n },\n url: {\n type: 'string',\n description: 'URL of the file.\\n'\n },\n versionInfo: {\n type: 'object',\n description: 'An object with details of the file version.\\n',\n properties: {\n id: {\n type: 'string',\n description: 'Unique identifier of the file version.'\n },\n name: {\n type: 'string',\n description: 'Name of the file version.'\n }\n }\n },\n width: {\n type: 'number',\n description: 'Width of the file.\\n'\n }\n }\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -41,7 +41,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { fileId, jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.files.versions.list(fileId)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.files.versions.list(fileId)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/files/versions/restore-files-versions.ts b/packages/mcp-server/src/tools/files/versions/restore-files-versions.ts
index fd9a04bf..dc4f76c4 100644
--- a/packages/mcp-server/src/tools/files/versions/restore-files-versions.ts
+++ b/packages/mcp-server/src/tools/files/versions/restore-files-versions.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -44,9 +44,16 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { versionId, jq_filter, ...body } = args as any;
- return asTextContentResult(
- await maybeFilter(jq_filter, await client.files.versions.restore(versionId, body)),
- );
+ try {
+ return asTextContentResult(
+ await maybeFilter(jq_filter, await client.files.versions.restore(versionId, body)),
+ );
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/folders/copy-folders.ts b/packages/mcp-server/src/tools/folders/copy-folders.ts
index b1efd5fe..f88e720a 100644
--- a/packages/mcp-server/src/tools/folders/copy-folders.ts
+++ b/packages/mcp-server/src/tools/folders/copy-folders.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'copy_folders',
description:
- "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\nThis will copy one folder into another. The selected folder, its nested folders, files, and their versions (in `includeVersions` is set to true) are copied in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n title: 'Async Bulk Job Response',\n description: 'Job submitted successfully. A `jobId` will be returned.',\n properties: {\n jobId: {\n type: 'string',\n description: 'Unique identifier of the bulk job. This can be used to check the status of the bulk job.\\n'\n }\n },\n required: [ 'jobId'\n ]\n}\n```",
+ "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\nThis will copy one folder into another. The selected folder, its nested folders, files, and their versions (in `includeVersions` is set to true) are copied in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/folder_copy_response',\n $defs: {\n folder_copy_response: {\n type: 'object',\n title: 'Async Bulk Job Response',\n description: 'Job submitted successfully. A `jobId` will be returned.',\n properties: {\n jobId: {\n type: 'string',\n description: 'Unique identifier of the bulk job. This can be used to check the status of the bulk job.\\n'\n }\n },\n required: [ 'jobId'\n ]\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -49,7 +49,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.folders.copy(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.folders.copy(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/folders/create-folders.ts b/packages/mcp-server/src/tools/folders/create-folders.ts
index 365f3b02..c8fa02c1 100644
--- a/packages/mcp-server/src/tools/folders/create-folders.ts
+++ b/packages/mcp-server/src/tools/folders/create-folders.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'create_folders',
description:
- "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\nThis will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {}\n}\n```",
+ "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\nThis will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/folder_create_response',\n $defs: {\n folder_create_response: {\n type: 'object',\n properties: {}\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -46,7 +46,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.folders.create(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.folders.create(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/folders/delete-folders.ts b/packages/mcp-server/src/tools/folders/delete-folders.ts
index b58d0819..231947a3 100644
--- a/packages/mcp-server/src/tools/folders/delete-folders.ts
+++ b/packages/mcp-server/src/tools/folders/delete-folders.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'delete_folders',
description:
- "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\nThis will delete a folder and all its contents permanently. The API returns an empty response.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {}\n}\n```",
+ "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\nThis will delete a folder and all its contents permanently. The API returns an empty response.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/folder_delete_response',\n $defs: {\n folder_delete_response: {\n type: 'object',\n properties: {}\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -42,7 +42,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.folders.delete(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.folders.delete(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/folders/job/get-folders-job.ts b/packages/mcp-server/src/tools/folders/job/get-folders-job.ts
index 19ca4ef2..b3a149ab 100644
--- a/packages/mcp-server/src/tools/folders/job/get-folders-job.ts
+++ b/packages/mcp-server/src/tools/folders/job/get-folders-job.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'get_folders_job',
description:
- "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\nThis API returns the status of a bulk job like copy and move folder operations.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n jobId: {\n type: 'string',\n description: 'Unique identifier of the bulk job.\\n'\n },\n purgeRequestId: {\n type: 'string',\n description: 'Unique identifier of the purge request. This will be present only if `purgeCache` is set to `true` in the rename folder API request.\\n'\n },\n status: {\n type: 'string',\n description: 'Status of the bulk job.',\n enum: [ 'Pending',\n 'Completed'\n ]\n },\n type: {\n type: 'string',\n description: 'Type of the bulk job.',\n enum: [ 'COPY_FOLDER',\n 'MOVE_FOLDER',\n 'RENAME_FOLDER'\n ]\n }\n }\n}\n```",
+ "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\nThis API returns the status of a bulk job like copy and move folder operations.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/job_get_response',\n $defs: {\n job_get_response: {\n type: 'object',\n properties: {\n jobId: {\n type: 'string',\n description: 'Unique identifier of the bulk job.\\n'\n },\n purgeRequestId: {\n type: 'string',\n description: 'Unique identifier of the purge request. This will be present only if `purgeCache` is set to `true` in the rename folder API request.\\n'\n },\n status: {\n type: 'string',\n description: 'Status of the bulk job.',\n enum: [ 'Pending',\n 'Completed'\n ]\n },\n type: {\n type: 'string',\n description: 'Type of the bulk job.',\n enum: [ 'COPY_FOLDER',\n 'MOVE_FOLDER',\n 'RENAME_FOLDER'\n ]\n }\n }\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -41,7 +41,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jobId, jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.folders.job.get(jobId)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.folders.job.get(jobId)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/folders/move-folders.ts b/packages/mcp-server/src/tools/folders/move-folders.ts
index 9131e342..5589db62 100644
--- a/packages/mcp-server/src/tools/folders/move-folders.ts
+++ b/packages/mcp-server/src/tools/folders/move-folders.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'move_folders',
description:
- "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\nThis will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n title: 'Async Bulk Job Response',\n description: 'Job submitted successfully. A `jobId` will be returned.',\n properties: {\n jobId: {\n type: 'string',\n description: 'Unique identifier of the bulk job. This can be used to check the status of the bulk job.\\n'\n }\n },\n required: [ 'jobId'\n ]\n}\n```",
+ "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\nThis will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/folder_move_response',\n $defs: {\n folder_move_response: {\n type: 'object',\n title: 'Async Bulk Job Response',\n description: 'Job submitted successfully. A `jobId` will be returned.',\n properties: {\n jobId: {\n type: 'string',\n description: 'Unique identifier of the bulk job. This can be used to check the status of the bulk job.\\n'\n }\n },\n required: [ 'jobId'\n ]\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -44,7 +44,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.folders.move(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.folders.move(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/folders/rename-folders.ts b/packages/mcp-server/src/tools/folders/rename-folders.ts
index 83c54224..60c7c121 100644
--- a/packages/mcp-server/src/tools/folders/rename-folders.ts
+++ b/packages/mcp-server/src/tools/folders/rename-folders.ts
@@ -1,7 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import { maybeFilter } from '@imagekit/api-mcp/filtering';
-import { Metadata, asTextContentResult } from '@imagekit/api-mcp/tools/types';
+import { isJqError, maybeFilter } from '@imagekit/api-mcp/filtering';
+import { Metadata, asErrorResult, asTextContentResult } from '@imagekit/api-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import ImageKit from '@imagekit/nodejs';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
export const tool: Tool = {
name: 'rename_folders',
description:
- "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\nThis API allows you to rename an existing folder. The folder and all its nested assets and sub-folders will remain unchanged, but their paths will be updated to reflect the new folder name.\n\n\n# Response Schema\n```json\n{\n type: 'object',\n title: 'Async Bulk Job Response',\n description: 'Job submitted successfully. A `jobId` will be returned.',\n properties: {\n jobId: {\n type: 'string',\n description: 'Unique identifier of the bulk job. This can be used to check the status of the bulk job.\\n'\n }\n },\n required: [ 'jobId'\n ]\n}\n```",
+ "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\nThis API allows you to rename an existing folder. The folder and all its nested assets and sub-folders will remain unchanged, but their paths will be updated to reflect the new folder name.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/folder_rename_response',\n $defs: {\n folder_rename_response: {\n type: 'object',\n title: 'Async Bulk Job Response',\n description: 'Job submitted successfully. A `jobId` will be returned.',\n properties: {\n jobId: {\n type: 'string',\n description: 'Unique identifier of the bulk job. This can be used to check the status of the bulk job.\\n'\n }\n },\n required: [ 'jobId'\n ]\n }\n }\n}\n```",
inputSchema: {
type: 'object',
properties: {
@@ -50,7 +50,14 @@ export const tool: Tool = {
export const handler = async (client: ImageKit, args: Record | undefined) => {
const { jq_filter, ...body } = args as any;
- return asTextContentResult(await maybeFilter(jq_filter, await client.folders.rename(body)));
+ try {
+ return asTextContentResult(await maybeFilter(jq_filter, await client.folders.rename(body)));
+ } catch (error) {
+ if (error instanceof ImageKit.APIError || isJqError(error)) {
+ return asErrorResult(error.message);
+ }
+ throw error;
+ }
};
export default { metadata, tool, handler };
diff --git a/packages/mcp-server/src/tools/types.ts b/packages/mcp-server/src/tools/types.ts
index 8106d499..715d3422 100644
--- a/packages/mcp-server/src/tools/types.ts
+++ b/packages/mcp-server/src/tools/types.ts
@@ -87,6 +87,18 @@ export async function asBinaryContentResult(response: Response): Promise {
const defaultOptions = {
client: undefined,
includeDynamicTools: undefined,
+ includeCodeTools: undefined,
includeAllTools: undefined,
filters: [],
capabilities: {
@@ -383,6 +384,27 @@ describe('parseQueryOptions', () => {
{ type: 'tool', op: 'exclude', value: 'exclude-tool' },
]);
});
+
+ it('code tools are enabled on http servers with default option set', () => {
+ const query = 'tools=code';
+ const result = parseQueryOptions({ ...defaultOptions, includeCodeTools: true }, query);
+
+ expect(result.includeCodeTools).toBe(true);
+ });
+
+ it('code tools are prevented on http servers when no default option set', () => {
+ const query = 'tools=code';
+ const result = parseQueryOptions(defaultOptions, query);
+
+ expect(result.includeCodeTools).toBe(undefined);
+ });
+
+ it('code tools are prevented on http servers when default option is explicitly false', () => {
+ const query = 'tools=code';
+ const result = parseQueryOptions({ ...defaultOptions, includeCodeTools: false }, query);
+
+ expect(result.includeCodeTools).toBe(false);
+ });
});
describe('parseEmbeddedJSON', () => {
diff --git a/packages/mcp-server/yarn.lock b/packages/mcp-server/yarn.lock
index 966d0575..38be884f 100644
--- a/packages/mcp-server/yarn.lock
+++ b/packages/mcp-server/yarn.lock
@@ -10,6 +10,20 @@
"@jridgewell/gen-mapping" "^0.3.5"
"@jridgewell/trace-mapping" "^0.3.24"
+"@anthropic-ai/mcpb@1.1.0":
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/@anthropic-ai/mcpb/-/mcpb-1.1.0.tgz#1af18de2ab9499d321d6310d0be095f5fef5161b"
+ integrity sha512-nOnhG1eNpGKSIDv6lt3xsI3w2p2k0D/rPTMGXXugLovCEaJ7svh8XMfCe145vs8qo384t8wKbokWAvx9PkQMDA==
+ dependencies:
+ "@inquirer/prompts" "^6.0.1"
+ commander "^13.1.0"
+ fflate "^0.8.2"
+ galactus "^1.0.0"
+ ignore "^7.0.5"
+ node-forge "^1.3.1"
+ pretty-bytes "^5.6.0"
+ zod "^3.25.67"
+
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.27.1":
version "7.27.1"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.27.1.tgz#200f715e66d52a23b221a9435534a91cc13ad5be"
@@ -336,6 +350,144 @@
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3"
integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==
+"@inquirer/checkbox@^3.0.1":
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/@inquirer/checkbox/-/checkbox-3.0.1.tgz#0a57f704265f78c36e17f07e421b98efb4b9867b"
+ integrity sha512-0hm2nrToWUdD6/UHnel/UKGdk1//ke5zGUpHIvk5ZWmaKezlGxZkOJXNSWsdxO/rEqTkbB3lNC2J6nBElV2aAQ==
+ dependencies:
+ "@inquirer/core" "^9.2.1"
+ "@inquirer/figures" "^1.0.6"
+ "@inquirer/type" "^2.0.0"
+ ansi-escapes "^4.3.2"
+ yoctocolors-cjs "^2.1.2"
+
+"@inquirer/confirm@^4.0.1":
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-4.0.1.tgz#9106d6bffa0b2fdd0e4f60319b6f04f2e06e6e25"
+ integrity sha512-46yL28o2NJ9doViqOy0VDcoTzng7rAb6yPQKU7VDLqkmbCaH4JqK4yk4XqlzNWy9PVC5pG1ZUXPBQv+VqnYs2w==
+ dependencies:
+ "@inquirer/core" "^9.2.1"
+ "@inquirer/type" "^2.0.0"
+
+"@inquirer/core@^9.2.1":
+ version "9.2.1"
+ resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-9.2.1.tgz#677c49dee399c9063f31e0c93f0f37bddc67add1"
+ integrity sha512-F2VBt7W/mwqEU4bL0RnHNZmC/OxzNx9cOYxHqnXX3MP6ruYvZUZAW9imgN9+h/uBT/oP8Gh888J2OZSbjSeWcg==
+ dependencies:
+ "@inquirer/figures" "^1.0.6"
+ "@inquirer/type" "^2.0.0"
+ "@types/mute-stream" "^0.0.4"
+ "@types/node" "^22.5.5"
+ "@types/wrap-ansi" "^3.0.0"
+ ansi-escapes "^4.3.2"
+ cli-width "^4.1.0"
+ mute-stream "^1.0.0"
+ signal-exit "^4.1.0"
+ strip-ansi "^6.0.1"
+ wrap-ansi "^6.2.0"
+ yoctocolors-cjs "^2.1.2"
+
+"@inquirer/editor@^3.0.1":
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/@inquirer/editor/-/editor-3.0.1.tgz#d109f21e050af6b960725388cb1c04214ed7c7bc"
+ integrity sha512-VA96GPFaSOVudjKFraokEEmUQg/Lub6OXvbIEZU1SDCmBzRkHGhxoFAVaF30nyiB4m5cEbDgiI2QRacXZ2hw9Q==
+ dependencies:
+ "@inquirer/core" "^9.2.1"
+ "@inquirer/type" "^2.0.0"
+ external-editor "^3.1.0"
+
+"@inquirer/expand@^3.0.1":
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/@inquirer/expand/-/expand-3.0.1.tgz#aed9183cac4d12811be47a4a895ea8e82a17e22c"
+ integrity sha512-ToG8d6RIbnVpbdPdiN7BCxZGiHOTomOX94C2FaT5KOHupV40tKEDozp12res6cMIfRKrXLJyexAZhWVHgbALSQ==
+ dependencies:
+ "@inquirer/core" "^9.2.1"
+ "@inquirer/type" "^2.0.0"
+ yoctocolors-cjs "^2.1.2"
+
+"@inquirer/figures@^1.0.6":
+ version "1.0.15"
+ resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-1.0.15.tgz#dbb49ed80df11df74268023b496ac5d9acd22b3a"
+ integrity sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g==
+
+"@inquirer/input@^3.0.1":
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-3.0.1.tgz#de63d49e516487388508d42049deb70f2cb5f28e"
+ integrity sha512-BDuPBmpvi8eMCxqC5iacloWqv+5tQSJlUafYWUe31ow1BVXjW2a5qe3dh4X/Z25Wp22RwvcaLCc2siHobEOfzg==
+ dependencies:
+ "@inquirer/core" "^9.2.1"
+ "@inquirer/type" "^2.0.0"
+
+"@inquirer/number@^2.0.1":
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/@inquirer/number/-/number-2.0.1.tgz#b9863080d02ab7dc2e56e16433d83abea0f2a980"
+ integrity sha512-QpR8jPhRjSmlr/mD2cw3IR8HRO7lSVOnqUvQa8scv1Lsr3xoAMMworcYW3J13z3ppjBFBD2ef1Ci6AE5Qn8goQ==
+ dependencies:
+ "@inquirer/core" "^9.2.1"
+ "@inquirer/type" "^2.0.0"
+
+"@inquirer/password@^3.0.1":
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/@inquirer/password/-/password-3.0.1.tgz#2a9a9143591088336bbd573bcb05d5bf080dbf87"
+ integrity sha512-haoeEPUisD1NeE2IanLOiFr4wcTXGWrBOyAyPZi1FfLJuXOzNmxCJPgUrGYKVh+Y8hfGJenIfz5Wb/DkE9KkMQ==
+ dependencies:
+ "@inquirer/core" "^9.2.1"
+ "@inquirer/type" "^2.0.0"
+ ansi-escapes "^4.3.2"
+
+"@inquirer/prompts@^6.0.1":
+ version "6.0.1"
+ resolved "https://registry.yarnpkg.com/@inquirer/prompts/-/prompts-6.0.1.tgz#43f5c0ed35c5ebfe52f1d43d46da2d363d950071"
+ integrity sha512-yl43JD/86CIj3Mz5mvvLJqAOfIup7ncxfJ0Btnl0/v5TouVUyeEdcpknfgc+yMevS/48oH9WAkkw93m7otLb/A==
+ dependencies:
+ "@inquirer/checkbox" "^3.0.1"
+ "@inquirer/confirm" "^4.0.1"
+ "@inquirer/editor" "^3.0.1"
+ "@inquirer/expand" "^3.0.1"
+ "@inquirer/input" "^3.0.1"
+ "@inquirer/number" "^2.0.1"
+ "@inquirer/password" "^3.0.1"
+ "@inquirer/rawlist" "^3.0.1"
+ "@inquirer/search" "^2.0.1"
+ "@inquirer/select" "^3.0.1"
+
+"@inquirer/rawlist@^3.0.1":
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/@inquirer/rawlist/-/rawlist-3.0.1.tgz#729def358419cc929045f264131878ed379e0af3"
+ integrity sha512-VgRtFIwZInUzTiPLSfDXK5jLrnpkuSOh1ctfaoygKAdPqjcjKYmGh6sCY1pb0aGnCGsmhUxoqLDUAU0ud+lGXQ==
+ dependencies:
+ "@inquirer/core" "^9.2.1"
+ "@inquirer/type" "^2.0.0"
+ yoctocolors-cjs "^2.1.2"
+
+"@inquirer/search@^2.0.1":
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/@inquirer/search/-/search-2.0.1.tgz#69b774a0a826de2e27b48981d01bc5ad81e73721"
+ integrity sha512-r5hBKZk3g5MkIzLVoSgE4evypGqtOannnB3PKTG9NRZxyFRKcfzrdxXXPcoJQsxJPzvdSU2Rn7pB7lw0GCmGAg==
+ dependencies:
+ "@inquirer/core" "^9.2.1"
+ "@inquirer/figures" "^1.0.6"
+ "@inquirer/type" "^2.0.0"
+ yoctocolors-cjs "^2.1.2"
+
+"@inquirer/select@^3.0.1":
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/@inquirer/select/-/select-3.0.1.tgz#1df9ed27fb85a5f526d559ac5ce7cc4e9dc4e7ec"
+ integrity sha512-lUDGUxPhdWMkN/fHy1Lk7pF3nK1fh/gqeyWXmctefhxLYxlDsc7vsPBEpxrfVGDsVdyYJsiJoD4bJ1b623cV1Q==
+ dependencies:
+ "@inquirer/core" "^9.2.1"
+ "@inquirer/figures" "^1.0.6"
+ "@inquirer/type" "^2.0.0"
+ ansi-escapes "^4.3.2"
+ yoctocolors-cjs "^2.1.2"
+
+"@inquirer/type@^2.0.0":
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-2.0.0.tgz#08fa513dca2cb6264fe1b0a2fabade051444e3f6"
+ integrity sha512-XvJRx+2KR3YXyYtPUUy+qd9i7p+GO9Ko6VIIpWlBrpWwXDv8WLFeHTxz35CfQFUiBMLXlGHhGzys7lqit9gWag==
+ dependencies:
+ mute-stream "^1.0.0"
+
"@istanbuljs/load-nyc-config@^1.0.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"
@@ -584,12 +736,13 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"
-"@modelcontextprotocol/sdk@^1.11.5":
- version "1.17.3"
- resolved "https://registry.yarnpkg.com/@modelcontextprotocol/sdk/-/sdk-1.17.3.tgz#cf92354220f0183d28179e96a9bf3a8f6d3211ae"
- integrity sha512-JPwUKWSsbzx+DLFznf/QZ32Qa+ptfbUlHhRLrBQBAFu9iI1iYvizM4p+zhhRDceSsPutXp4z+R/HPVphlIiclg==
+"@modelcontextprotocol/sdk@^1.24.0":
+ version "1.24.3"
+ resolved "https://registry.yarnpkg.com/@modelcontextprotocol/sdk/-/sdk-1.24.3.tgz#81a3fcc919cb4ce8630e2bcecf59759176eb331a"
+ integrity sha512-YgSHW29fuzKKAHTGe9zjNoo+yF8KaQPzDC2W9Pv41E7/57IfY+AMGJ/aDFlgTLcVVELoggKE4syABCE75u3NCw==
dependencies:
- ajv "^6.12.6"
+ ajv "^8.17.1"
+ ajv-formats "^3.0.1"
content-type "^1.0.5"
cors "^2.8.5"
cross-spawn "^7.0.5"
@@ -597,10 +750,11 @@
eventsource-parser "^3.0.0"
express "^5.0.1"
express-rate-limit "^7.5.0"
+ jose "^6.1.1"
pkce-challenge "^5.0.0"
raw-body "^3.0.0"
- zod "^3.23.8"
- zod-to-json-schema "^3.24.1"
+ zod "^3.25 || ^4.0"
+ zod-to-json-schema "^3.25.0"
"@nodelib/fs.scandir@2.1.5":
version "2.1.5"
@@ -795,6 +949,13 @@
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690"
integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==
+"@types/mute-stream@^0.0.4":
+ version "0.0.4"
+ resolved "https://registry.yarnpkg.com/@types/mute-stream/-/mute-stream-0.0.4.tgz#77208e56a08767af6c5e1237be8888e2f255c478"
+ integrity sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==
+ dependencies:
+ "@types/node" "*"
+
"@types/node@*":
version "22.15.17"
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.17.tgz#355ccec95f705b664e4332bb64a7f07db30b7055"
@@ -802,6 +963,13 @@
dependencies:
undici-types "~6.21.0"
+"@types/node@^22.5.5":
+ version "22.19.2"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-22.19.2.tgz#2f0956fba46518aaf7578c84e37bddab55f85d01"
+ integrity sha512-LPM2G3Syo1GLzXLGJAKdqoU35XvrWzGJ21/7sgZTUpbkBaOasTj8tjwn6w+hCkqaa1TfJ/w67rJSwYItlJ2mYw==
+ dependencies:
+ undici-types "~6.21.0"
+
"@types/qs@*", "@types/qs@^6.14.0":
version "6.14.0"
resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.14.0.tgz#d8b60cecf62f2db0fb68e5e006077b9178b85de5"
@@ -834,6 +1002,11 @@
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8"
integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==
+"@types/wrap-ansi@^3.0.0":
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz#18b97a972f94f60a679fd5c796d96421b9abb9fd"
+ integrity sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==
+
"@types/yargs-parser@*":
version "21.0.3"
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15"
@@ -970,7 +1143,14 @@ aggregate-error@^3.0.0:
clean-stack "^2.0.0"
indent-string "^4.0.0"
-ajv@^6.12.4, ajv@^6.12.6:
+ajv-formats@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-3.0.1.tgz#3d5dc762bca17679c3c2ea7e90ad6b7532309578"
+ integrity sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==
+ dependencies:
+ ajv "^8.0.0"
+
+ajv@^6.12.4:
version "6.12.6"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
@@ -980,7 +1160,17 @@ ajv@^6.12.4, ajv@^6.12.6:
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"
-ansi-escapes@^4.2.1:
+ajv@^8.0.0, ajv@^8.17.1:
+ version "8.17.1"
+ resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6"
+ integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==
+ dependencies:
+ fast-deep-equal "^3.1.3"
+ fast-uri "^3.0.1"
+ json-schema-traverse "^1.0.0"
+ require-from-string "^2.0.2"
+
+ansi-escapes@^4.2.1, ansi-escapes@^4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e"
integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==
@@ -1222,6 +1412,11 @@ char-regex@^1.0.2:
resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf"
integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==
+chardet@^0.7.0:
+ version "0.7.0"
+ resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
+ integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==
+
ci-info@^3.2.0:
version "3.9.0"
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4"
@@ -1237,6 +1432,11 @@ clean-stack@^2.0.0:
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"
integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==
+cli-width@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-4.1.0.tgz#42daac41d3c254ef38ad8ac037672130173691c5"
+ integrity sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==
+
cliui@^8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa"
@@ -1273,6 +1473,11 @@ color-name@~1.1.4:
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
+commander@^13.1.0:
+ version "13.1.0"
+ resolved "https://registry.yarnpkg.com/commander/-/commander-13.1.0.tgz#776167db68c78f38dcce1f9b8d7b8b9a488abf46"
+ integrity sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==
+
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
@@ -1685,6 +1890,15 @@ express@^5.0.1, express@^5.1.0:
type-is "^2.0.1"
vary "^1.1.2"
+external-editor@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495"
+ integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==
+ dependencies:
+ chardet "^0.7.0"
+ iconv-lite "^0.4.24"
+ tmp "^0.0.33"
+
fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
@@ -1716,6 +1930,11 @@ fast-levenshtein@^2.0.6:
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==
+fast-uri@^3.0.1:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.0.tgz#66eecff6c764c0df9b762e62ca7edcfb53b4edfa"
+ integrity sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==
+
fastq@^1.6.0:
version "1.19.1"
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.19.1.tgz#d50eaba803c8846a883c16492821ebcd2cda55f5"
@@ -1730,6 +1949,11 @@ fb-watchman@^2.0.0:
dependencies:
bser "2.1.1"
+fflate@^0.8.2:
+ version "0.8.2"
+ resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.2.tgz#fc8631f5347812ad6028bbe4a2308b2792aa1dea"
+ integrity sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==
+
file-entry-cache@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027"
@@ -1793,6 +2017,14 @@ flatted@^3.2.9:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.3.tgz#67c8fad95454a7c7abebf74bb78ee74a44023358"
integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==
+flora-colossus@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/flora-colossus/-/flora-colossus-2.0.0.tgz#af1e85db0a8256ef05f3fb531c1235236c97220a"
+ integrity sha512-dz4HxH6pOvbUzZpZ/yXhafjbR2I8cenK5xL0KtBFb7U2ADsR+OwXifnxZjij/pZWF775uSCMzWVd+jDik2H2IA==
+ dependencies:
+ debug "^4.3.4"
+ fs-extra "^10.1.0"
+
forwarded@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811"
@@ -1803,6 +2035,15 @@ fresh@^2.0.0:
resolved "https://registry.yarnpkg.com/fresh/-/fresh-2.0.0.tgz#8dd7df6a1b3a1b3a5cf186c05a5dd267622635a4"
integrity sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==
+fs-extra@^10.1.0:
+ version "10.1.0"
+ resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
+ integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
+ dependencies:
+ graceful-fs "^4.2.0"
+ jsonfile "^6.0.1"
+ universalify "^2.0.0"
+
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@@ -1818,6 +2059,20 @@ function-bind@^1.1.2:
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c"
integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==
+fuse.js@^7.1.0:
+ version "7.1.0"
+ resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-7.1.0.tgz#306228b4befeee11e05b027087c2744158527d09"
+ integrity sha512-trLf4SzuuUxfusZADLINj+dE8clK1frKdmqiJNb1Es75fmI5oY6X2mxLVUciLLjxqw/xr72Dhy+lER6dGd02FQ==
+
+galactus@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/galactus/-/galactus-1.0.0.tgz#c2615182afa0c6d0859b92e56ae36d052827db7e"
+ integrity sha512-R1fam6D4CyKQGNlvJne4dkNF+PvUUl7TAJInvTGa9fti9qAv95quQz29GXapA4d8Ec266mJJxFVh82M4GIIGDQ==
+ dependencies:
+ debug "^4.3.4"
+ flora-colossus "^2.0.0"
+ fs-extra "^10.1.0"
+
gensync@^1.0.0-beta.2:
version "1.0.0-beta.2"
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
@@ -1910,7 +2165,7 @@ gopd@^1.2.0:
resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1"
integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==
-graceful-fs@^4.2.9:
+graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.9:
version "4.2.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==
@@ -1965,11 +2220,23 @@ iconv-lite@0.6.3, iconv-lite@^0.6.3:
dependencies:
safer-buffer ">= 2.1.2 < 3.0.0"
+iconv-lite@^0.4.24:
+ version "0.4.24"
+ resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
+ integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==
+ dependencies:
+ safer-buffer ">= 2.1.2 < 3"
+
ignore@^5.2.0, ignore@^5.3.1:
version "5.3.2"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5"
integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==
+ignore@^7.0.5:
+ version "7.0.5"
+ resolved "https://registry.yarnpkg.com/ignore/-/ignore-7.0.5.tgz#4cb5f6cd7d4c7ab0365738c7aea888baa6d7efd9"
+ integrity sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==
+
import-fresh@^3.2.1:
version "3.3.1"
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.1.tgz#9cecb56503c0ada1f2741dbbd6546e4b13b57ccf"
@@ -2494,9 +2761,14 @@ jest@^29.4.0:
import-local "^3.0.2"
jest-cli "^29.7.0"
-"jq-web@https://github.com/stainless-api/jq-web/releases/download/v0.8.6/jq-web.tar.gz":
- version "0.8.6"
- resolved "https://github.com/stainless-api/jq-web/releases/download/v0.8.6/jq-web.tar.gz#14d0e126987736e82e964d675c3838b5944faa6f"
+jose@^6.1.1:
+ version "6.1.3"
+ resolved "https://registry.yarnpkg.com/jose/-/jose-6.1.3.tgz#8453d7be88af7bb7d64a0481d6a35a0145ba3ea5"
+ integrity sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ==
+
+"jq-web@https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz":
+ version "0.8.8"
+ resolved "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz#7849ef64bdfc28f70cbfc9888f886860e96da10d"
js-tokens@^4.0.0:
version "4.0.0"
@@ -2538,6 +2810,11 @@ json-schema-traverse@^0.4.1:
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
+json-schema-traverse@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2"
+ integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==
+
json-stable-stringify-without-jsonify@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
@@ -2548,6 +2825,15 @@ json5@^2.2.2, json5@^2.2.3:
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==
+jsonfile@^6.0.1:
+ version "6.2.0"
+ resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.2.0.tgz#7c265bd1b65de6977478300087c99f1c84383f62"
+ integrity sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==
+ dependencies:
+ universalify "^2.0.0"
+ optionalDependencies:
+ graceful-fs "^4.1.6"
+
keyv@^4.5.3:
version "4.5.4"
resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93"
@@ -2721,6 +3007,11 @@ ms@^2.1.3:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
+mute-stream@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-1.0.0.tgz#e31bd9fe62f0aed23520aa4324ea6671531e013e"
+ integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==
+
natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
@@ -2731,6 +3022,11 @@ negotiator@^1.0.0:
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-1.0.0.tgz#b6c91bb47172d69f93cfd7c357bbb529019b5f6a"
integrity sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==
+node-forge@^1.3.1:
+ version "1.3.3"
+ resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.3.tgz#0ad80f6333b3a0045e827ac20b7f735f93716751"
+ integrity sha512-rLvcdSyRCyouf6jcOIPe/BgwG/d7hKjzMKOas33/pHEr6gbq18IK9zV7DiPvzsz0oBJPme6qr6H6kGZuI9/DZg==
+
node-int64@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b"
@@ -2796,6 +3092,11 @@ optionator@^0.9.3:
type-check "^0.4.0"
word-wrap "^1.2.5"
+os-tmpdir@~1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
+ integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==
+
p-all@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/p-all/-/p-all-3.0.0.tgz#077c023c37e75e760193badab2bad3ccd5782bfb"
@@ -2939,6 +3240,11 @@ prettier@^3.0.0:
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.5.3.tgz#4fc2ce0d657e7a02e602549f053b239cb7dfe1b5"
integrity sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==
+pretty-bytes@^5.6.0:
+ version "5.6.0"
+ resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb"
+ integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==
+
pretty-format@^29.0.0, pretty-format@^29.7.0:
version "29.7.0"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812"
@@ -3020,6 +3326,11 @@ require-directory@^2.1.1:
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
+require-from-string@^2.0.2:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
+ integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==
+
resolve-cwd@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d"
@@ -3086,7 +3397,7 @@ safe-buffer@5.2.1, safe-buffer@~5.2.0:
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
-"safer-buffer@>= 2.1.2 < 3.0.0":
+"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0":
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
@@ -3190,6 +3501,11 @@ signal-exit@^3.0.3, signal-exit@^3.0.7:
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==
+signal-exit@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04"
+ integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==
+
sisteransi@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
@@ -3334,6 +3650,13 @@ text-table@^0.2.0:
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==
+tmp@^0.0.33:
+ version "0.0.33"
+ resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
+ integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==
+ dependencies:
+ os-tmpdir "~1.0.2"
+
tmpl@1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc"
@@ -3474,6 +3797,11 @@ undici-types@~6.21.0:
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb"
integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==
+universalify@^2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d"
+ integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==
+
unpipe@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
@@ -3537,6 +3865,15 @@ word-wrap@^1.2.5:
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==
+wrap-ansi@^6.2.0:
+ version "6.2.0"
+ resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53"
+ integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==
+ dependencies:
+ ansi-styles "^4.0.0"
+ string-width "^4.1.0"
+ strip-ansi "^6.0.0"
+
wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
@@ -3597,22 +3934,32 @@ yocto-queue@^0.1.0:
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
-zod-to-json-schema@^3.24.1, zod-to-json-schema@^3.24.5:
+yoctocolors-cjs@^2.1.2:
+ version "2.1.3"
+ resolved "https://registry.yarnpkg.com/yoctocolors-cjs/-/yoctocolors-cjs-2.1.3.tgz#7e4964ea8ec422b7a40ac917d3a344cfd2304baa"
+ integrity sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==
+
+zod-to-json-schema@^3.24.5:
version "3.24.5"
resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.24.5.tgz#d1095440b147fb7c2093812a53c54df8d5df50a3"
integrity sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g==
+zod-to-json-schema@^3.25.0:
+ version "3.25.0"
+ resolved "https://registry.yarnpkg.com/zod-to-json-schema/-/zod-to-json-schema-3.25.0.tgz#df504c957c4fb0feff467c74d03e6aab0b013e1c"
+ integrity sha512-HvWtU2UG41LALjajJrML6uQejQhNJx+JBO9IflpSja4R03iNWfKXrj6W2h7ljuLyc1nKS+9yDyL/9tD1U/yBnQ==
+
zod-validation-error@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-4.0.1.tgz#a105723eb40299578a6a38cb86647068f6d005b1"
integrity sha512-F3rdaCOHs5ViJ5YTz5zzRtfkQdMdIeKudJAoxy7yB/2ZMEHw73lmCAcQw11r7++20MyGl4WV59EVh7A9rNAyog==
-zod@^3.23.8:
- version "3.24.4"
- resolved "https://registry.yarnpkg.com/zod/-/zod-3.24.4.tgz#e2e2cca5faaa012d76e527d0d36622e0a90c315f"
- integrity sha512-OdqJE9UDRPwWsrHjLN2F8bPxvwJBK22EHLWtanu0LSYr5YqzsaaW3RMgmjwr8Rypg5k+meEJdSPXJZXE/yqOMg==
+"zod@^3.25 || ^4.0":
+ version "4.1.13"
+ resolved "https://registry.yarnpkg.com/zod/-/zod-4.1.13.tgz#93699a8afe937ba96badbb0ce8be6033c0a4b6b1"
+ integrity sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig==
-zod@^3.25.20:
+zod@^3.25.20, zod@^3.25.67:
version "3.25.76"
resolved "https://registry.yarnpkg.com/zod/-/zod-3.25.76.tgz#26841c3f6fd22a6a2760e7ccb719179768471e34"
integrity sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==
diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh
index 0870aebc..e169cf10 100755
--- a/scripts/utils/upload-artifact.sh
+++ b/scripts/utils/upload-artifact.sh
@@ -12,9 +12,11 @@ if [[ "$SIGNED_URL" == "null" ]]; then
exit 1
fi
-UPLOAD_RESPONSE=$(tar "${BASE_PATH:+-C$BASE_PATH}" -cz "${ARTIFACT_PATH:-dist}" | curl -v -X PUT \
+TARBALL=$(cd dist && npm pack --silent)
+
+UPLOAD_RESPONSE=$(curl -v -X PUT \
-H "Content-Type: application/gzip" \
- --data-binary @- "$SIGNED_URL" 2>&1)
+ --data-binary "@dist/$TARBALL" "$SIGNED_URL" 2>&1)
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
diff --git a/src/client.ts b/src/client.ts
index 1560e2bc..54169b41 100644
--- a/src/client.ts
+++ b/src/client.ts
@@ -189,7 +189,7 @@ export class ImageKit {
baseURL: string;
maxRetries: number;
timeout: number;
- logger: Logger | undefined;
+ logger: Logger;
logLevel: LogLevel | undefined;
fetchOptions: MergedRequestInit | undefined;
@@ -911,10 +911,12 @@ export declare namespace ImageKit {
export type BaseOverlay = API.BaseOverlay;
export type Extensions = API.Extensions;
+ export type GetImageAttributesOptions = API.GetImageAttributesOptions;
export type ImageOverlay = API.ImageOverlay;
export type Overlay = API.Overlay;
export type OverlayPosition = API.OverlayPosition;
export type OverlayTiming = API.OverlayTiming;
+ export type ResponsiveImageAttributes = API.ResponsiveImageAttributes;
export type SolidColorOverlay = API.SolidColorOverlay;
export type SolidColorOverlayTransformation = API.SolidColorOverlayTransformation;
export type SrcOptions = API.SrcOptions;
diff --git a/src/resources/custom-metadata-fields.ts b/src/resources/custom-metadata-fields.ts
index 7629d3f9..81081924 100644
--- a/src/resources/custom-metadata-fields.ts
+++ b/src/resources/custom-metadata-fields.ts
@@ -38,11 +38,7 @@ export class CustomMetadataFields extends APIResource {
* const customMetadataField =
* await client.customMetadataFields.update('id', {
* label: 'price',
- * schema: {
- * type: 'Number',
- * minValue: 1000,
- * maxValue: 3000,
- * },
+ * schema: { minValue: 1000, maxValue: 3000 },
* });
* ```
*/
diff --git a/src/resources/shared.ts b/src/resources/shared.ts
index 6d73d695..9ecb5fcf 100644
--- a/src/resources/shared.ts
+++ b/src/resources/shared.ts
@@ -78,6 +78,54 @@ export namespace Extensions {
}
}
+/**
+ * Options for generating responsive image attributes including `src`, `srcSet`,
+ * and `sizes` for HTML `
` elements. This schema extends `SrcOptions` to add
+ * support for responsive image generation with breakpoints.
+ */
+export interface GetImageAttributesOptions extends SrcOptions {
+ /**
+ * Custom list of **device-width breakpoints** in pixels. These define common
+ * screen widths for responsive image generation.
+ *
+ * Defaults to `[640, 750, 828, 1080, 1200, 1920, 2048, 3840]`. Sorted
+ * automatically.
+ */
+ deviceBreakpoints?: Array;
+
+ /**
+ * Custom list of **image-specific breakpoints** in pixels. Useful for generating
+ * small variants (e.g., placeholders or thumbnails).
+ *
+ * Merged with `deviceBreakpoints` before calculating `srcSet`. Defaults to
+ * `[16, 32, 48, 64, 96, 128, 256, 384]`. Sorted automatically.
+ */
+ imageBreakpoints?: Array;
+
+ /**
+ * The value for the HTML `sizes` attribute (e.g., `"100vw"` or
+ * `"(min-width:768px) 50vw, 100vw"`).
+ *
+ * - If it includes one or more `vw` units, breakpoints smaller than the
+ * corresponding percentage of the smallest device width are excluded.
+ * - If it contains no `vw` units, the full breakpoint list is used.
+ *
+ * Enables a width-based strategy and generates `w` descriptors in `srcSet`.
+ */
+ sizes?: string;
+
+ /**
+ * The intended display width of the image in pixels, used **only when the `sizes`
+ * attribute is not provided**.
+ *
+ * Triggers a DPR-based strategy (1x and 2x variants) and generates `x` descriptors
+ * in `srcSet`.
+ *
+ * Ignored if `sizes` is present.
+ */
+ width?: number;
+}
+
export interface ImageOverlay extends BaseOverlay {
/**
* Specifies the relative path to the image used as an overlay.
@@ -175,6 +223,34 @@ export interface OverlayTiming {
start?: number | string;
}
+/**
+ * Resulting set of attributes suitable for an HTML `
` element. Useful for
+ * enabling responsive image loading with `srcSet` and `sizes`.
+ */
+export interface ResponsiveImageAttributes {
+ /**
+ * URL for the _largest_ candidate (assigned to plain `src`).
+ */
+ src: string;
+
+ /**
+ * `sizes` returned (or synthesised as `100vw`). The value for the HTML `sizes`
+ * attribute.
+ */
+ sizes?: string;
+
+ /**
+ * Candidate set with `w` or `x` descriptors. Multiple image URLs separated by
+ * commas, each with a descriptor.
+ */
+ srcSet?: string;
+
+ /**
+ * Width as a number (if `width` was provided in the input options).
+ */
+ width?: number;
+}
+
export interface SolidColorOverlay extends BaseOverlay {
/**
* Specifies the color of the block using an RGB hex code (e.g., `FF0000`), an RGBA
diff --git a/src/version.ts b/src/version.ts
index 60c81603..915a686a 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -1 +1 @@
-export const VERSION = '7.1.1'; // x-release-please-version
+export const VERSION = '7.2.0'; // x-release-please-version
diff --git a/yarn.lock b/yarn.lock
index 1935915b..2180b9e6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -350,45 +350,52 @@
dependencies:
"@cspotcode/source-map-consumer" "0.8.0"
-"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0":
+"@eslint-community/eslint-utils@^4.4.0":
version "4.4.0"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==
dependencies:
eslint-visitor-keys "^3.3.0"
+"@eslint-community/eslint-utils@^4.8.0":
+ version "4.9.0"
+ resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz#7308df158e064f0dd8b8fdb58aa14fa2a7f913b3"
+ integrity sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==
+ dependencies:
+ eslint-visitor-keys "^3.4.3"
+
"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.12.1":
version "4.12.1"
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.12.1.tgz#cfc6cffe39df390a3841cde2abccf92eaa7ae0e0"
integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==
-"@eslint/config-array@^0.19.0":
- version "0.19.2"
- resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.19.2.tgz#3060b809e111abfc97adb0bb1172778b90cb46aa"
- integrity sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==
+"@eslint/config-array@^0.21.1":
+ version "0.21.1"
+ resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.21.1.tgz#7d1b0060fea407f8301e932492ba8c18aff29713"
+ integrity sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==
dependencies:
- "@eslint/object-schema" "^2.1.6"
+ "@eslint/object-schema" "^2.1.7"
debug "^4.3.1"
minimatch "^3.1.2"
-"@eslint/core@^0.10.0":
- version "0.10.0"
- resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.10.0.tgz#23727063c21b335f752dbb3a16450f6f9cbc9091"
- integrity sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==
+"@eslint/config-helpers@^0.4.2":
+ version "0.4.2"
+ resolved "https://registry.yarnpkg.com/@eslint/config-helpers/-/config-helpers-0.4.2.tgz#1bd006ceeb7e2e55b2b773ab318d300e1a66aeda"
+ integrity sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==
dependencies:
- "@types/json-schema" "^7.0.15"
+ "@eslint/core" "^0.17.0"
-"@eslint/core@^0.11.0":
- version "0.11.0"
- resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.11.0.tgz#7a9226e850922e42cbd2ba71361eacbe74352a12"
- integrity sha512-DWUB2pksgNEb6Bz2fggIy1wh6fGgZP4Xyy/Mt0QZPiloKKXerbqq9D3SBQTlCRYOrcRPu4vuz+CGjwdfqxnoWA==
+"@eslint/core@^0.17.0":
+ version "0.17.0"
+ resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.17.0.tgz#77225820413d9617509da9342190a2019e78761c"
+ integrity sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==
dependencies:
"@types/json-schema" "^7.0.15"
-"@eslint/eslintrc@^3.2.0":
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.2.0.tgz#57470ac4e2e283a6bf76044d63281196e370542c"
- integrity sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==
+"@eslint/eslintrc@^3.3.1":
+ version "3.3.3"
+ resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.3.3.tgz#26393a0806501b5e2b6a43aa588a4d8df67880ac"
+ integrity sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==
dependencies:
ajv "^6.12.4"
debug "^4.3.2"
@@ -396,26 +403,26 @@
globals "^14.0.0"
ignore "^5.2.0"
import-fresh "^3.2.1"
- js-yaml "^4.1.0"
+ js-yaml "^4.1.1"
minimatch "^3.1.2"
strip-json-comments "^3.1.1"
-"@eslint/js@9.20.0":
- version "9.20.0"
- resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.20.0.tgz#7421bcbe74889fcd65d1be59f00130c289856eb4"
- integrity sha512-iZA07H9io9Wn836aVTytRaNqh00Sad+EamwOVJT12GTLw1VGMFV/4JaME+JjLtr9fiGaoWgYnS54wrfWsSs4oQ==
+"@eslint/js@9.39.1":
+ version "9.39.1"
+ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.39.1.tgz#0dd59c3a9f40e3f1882975c321470969243e0164"
+ integrity sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==
-"@eslint/object-schema@^2.1.6":
- version "2.1.6"
- resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.6.tgz#58369ab5b5b3ca117880c0f6c0b0f32f6950f24f"
- integrity sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==
+"@eslint/object-schema@^2.1.7":
+ version "2.1.7"
+ resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.7.tgz#6e2126a1347e86a4dedf8706ec67ff8e107ebbad"
+ integrity sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==
-"@eslint/plugin-kit@^0.2.5":
- version "0.2.5"
- resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz#ee07372035539e7847ef834e3f5e7b79f09e3a81"
- integrity sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==
+"@eslint/plugin-kit@^0.4.1":
+ version "0.4.1"
+ resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz#9779e3fd9b7ee33571a57435cf4335a1794a6cb2"
+ integrity sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==
dependencies:
- "@eslint/core" "^0.10.0"
+ "@eslint/core" "^0.17.0"
levn "^0.4.1"
"@humanfs/core@^0.19.1":
@@ -441,10 +448,10 @@
resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.1.tgz#c72a5c76a9fbaf3488e231b13dc52c0da7bab42a"
integrity sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==
-"@humanwhocodes/retry@^0.4.1":
- version "0.4.1"
- resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.1.tgz#9a96ce501bc62df46c4031fbd970e3cc6b10f07b"
- integrity sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==
+"@humanwhocodes/retry@^0.4.2":
+ version "0.4.3"
+ resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.3.tgz#c2b9d2e374ee62c586d3adbea87199b1d7a7a6ba"
+ integrity sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==
"@istanbuljs/load-nyc-config@^1.0.0":
version "1.1.0"
@@ -1062,6 +1069,11 @@ acorn@^8.14.0:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0"
integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==
+acorn@^8.15.0:
+ version "8.15.0"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.15.0.tgz#a360898bc415edaac46c8241f6383975b930b816"
+ integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==
+
acorn@^8.4.1:
version "8.7.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf"
@@ -1565,15 +1577,15 @@ eslint-plugin-unused-imports@^4.1.4:
resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.1.4.tgz#62ddc7446ccbf9aa7b6f1f0b00a980423cda2738"
integrity sha512-YptD6IzQjDardkl0POxnnRBhU1OEePMV0nd6siHaRBbd+lyh6NAhFEobiznKU7kTsSsDeSD62Pe7kAM1b7dAZQ==
-eslint-scope@^8.2.0:
- version "8.2.0"
- resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.2.0.tgz#377aa6f1cb5dc7592cfd0b7f892fd0cf352ce442"
- integrity sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==
+eslint-scope@^8.4.0:
+ version "8.4.0"
+ resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.4.0.tgz#88e646a207fad61436ffa39eb505147200655c82"
+ integrity sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==
dependencies:
esrecurse "^4.3.0"
estraverse "^5.2.0"
-eslint-visitor-keys@^3.3.0:
+eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.3:
version "3.4.3"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==
@@ -1583,31 +1595,36 @@ eslint-visitor-keys@^4.2.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz#687bacb2af884fcdda8a6e7d65c606f46a14cd45"
integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==
-eslint@^9.20.1:
- version "9.20.1"
- resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.20.1.tgz#923924c078f5226832449bac86662dd7e53c91d6"
- integrity sha512-m1mM33o6dBUjxl2qb6wv6nGNwCAsns1eKtaQ4l/NPHeTvhiUPbtdfMyktxN4B3fgHIgsYh1VT3V9txblpQHq+g==
+eslint-visitor-keys@^4.2.1:
+ version "4.2.1"
+ resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz#4cfea60fe7dd0ad8e816e1ed026c1d5251b512c1"
+ integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==
+
+eslint@^9.39.1:
+ version "9.39.1"
+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.39.1.tgz#be8bf7c6de77dcc4252b5a8dcb31c2efff74a6e5"
+ integrity sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==
dependencies:
- "@eslint-community/eslint-utils" "^4.2.0"
+ "@eslint-community/eslint-utils" "^4.8.0"
"@eslint-community/regexpp" "^4.12.1"
- "@eslint/config-array" "^0.19.0"
- "@eslint/core" "^0.11.0"
- "@eslint/eslintrc" "^3.2.0"
- "@eslint/js" "9.20.0"
- "@eslint/plugin-kit" "^0.2.5"
+ "@eslint/config-array" "^0.21.1"
+ "@eslint/config-helpers" "^0.4.2"
+ "@eslint/core" "^0.17.0"
+ "@eslint/eslintrc" "^3.3.1"
+ "@eslint/js" "9.39.1"
+ "@eslint/plugin-kit" "^0.4.1"
"@humanfs/node" "^0.16.6"
"@humanwhocodes/module-importer" "^1.0.1"
- "@humanwhocodes/retry" "^0.4.1"
+ "@humanwhocodes/retry" "^0.4.2"
"@types/estree" "^1.0.6"
- "@types/json-schema" "^7.0.15"
ajv "^6.12.4"
chalk "^4.0.0"
cross-spawn "^7.0.6"
debug "^4.3.2"
escape-string-regexp "^4.0.0"
- eslint-scope "^8.2.0"
- eslint-visitor-keys "^4.2.0"
- espree "^10.3.0"
+ eslint-scope "^8.4.0"
+ eslint-visitor-keys "^4.2.1"
+ espree "^10.4.0"
esquery "^1.5.0"
esutils "^2.0.2"
fast-deep-equal "^3.1.3"
@@ -1623,7 +1640,7 @@ eslint@^9.20.1:
natural-compare "^1.4.0"
optionator "^0.9.3"
-espree@^10.0.1, espree@^10.3.0:
+espree@^10.0.1:
version "10.3.0"
resolved "https://registry.yarnpkg.com/espree/-/espree-10.3.0.tgz#29267cf5b0cb98735b65e64ba07e0ed49d1eed8a"
integrity sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==
@@ -1632,6 +1649,15 @@ espree@^10.0.1, espree@^10.3.0:
acorn-jsx "^5.3.2"
eslint-visitor-keys "^4.2.0"
+espree@^10.4.0:
+ version "10.4.0"
+ resolved "https://registry.yarnpkg.com/espree/-/espree-10.4.0.tgz#d54f4949d4629005a1fa168d937c3ff1f7e2a837"
+ integrity sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==
+ dependencies:
+ acorn "^8.15.0"
+ acorn-jsx "^5.3.2"
+ eslint-visitor-keys "^4.2.1"
+
esprima@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
@@ -2450,10 +2476,10 @@ js-yaml@^3.13.1:
argparse "^1.0.7"
esprima "^4.0.0"
-js-yaml@^4.1.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
- integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
+js-yaml@^4.1.1:
+ version "4.1.1"
+ resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b"
+ integrity sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==
dependencies:
argparse "^2.0.1"