From 008c333df360441c300d039d0f8d7c71697d2f4e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 9 Jan 2026 05:10:55 +0000 Subject: [PATCH 1/2] fix(mcp): update code tool prompt --- packages/mcp-server/src/code-tool.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/mcp-server/src/code-tool.ts b/packages/mcp-server/src/code-tool.ts index efc8a01..d597c36 100644 --- a/packages/mcp-server/src/code-tool.ts +++ b/packages/mcp-server/src/code-tool.ts @@ -4,6 +4,25 @@ import { McpTool, Metadata, ToolCallResult, asErrorResult, asTextContentResult } import { Tool } from '@modelcontextprotocol/sdk/types.js'; import { readEnv, readEnvOrError } from './server'; import { WorkerInput, WorkerOutput } from './code-tool-types'; + +const prompt = `Runs JavaScript code to interact with the Scan Documents API. + +You are a skilled programmer writing code to interface with the service. +Define an async function named "run" that takes a single parameter of an initialized SDK client and it will be run. +For example: + +\`\`\` +async function run(client) { + const file = await client.files.upload({ file: fs.createReadStream('path/to/file'), name: 'REPLACE_ME' }); +} +\`\`\` + +You will be returned anything that your function returns, plus the results of any console.log statements. +Do not add try-catch blocks for single API calls. The tool will handle errors for you. +Do not add comments unless necessary for generating better code. +Code will run in a container, and cannot interact with the network outside of the given SDK client. +Variables will not persist between calls, so make sure to return or log any data you might need later.`; + /** * A tool that runs code against a copy of the SDK. * @@ -17,8 +36,7 @@ export function codeTool(): McpTool { const metadata: Metadata = { resource: 'all', operation: 'write', tags: [] }; const tool: Tool = { name: 'execute', - description: - 'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.', + description: prompt, inputSchema: { type: 'object', properties: { code: { type: 'string' } } }, }; const handler = async (_: unknown, args: any): Promise => { From fa16ff80af23bdde7a990bc95e86944444c10a84 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 9 Jan 2026 05:11:11 +0000 Subject: [PATCH 2/2] release: 0.1.0-alpha.20 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ package.json | 2 +- packages/mcp-server/package.json | 2 +- packages/mcp-server/src/server.ts | 2 +- src/version.ts | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 885f916..de4ea38 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.19" + ".": "0.1.0-alpha.20" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c908ae..89ba6e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.1.0-alpha.20 (2026-01-09) + +Full Changelog: [v0.1.0-alpha.19...v0.1.0-alpha.20](https://github.com/Scan-Documents/node-sdk/compare/v0.1.0-alpha.19...v0.1.0-alpha.20) + +### Bug Fixes + +* **mcp:** update code tool prompt ([008c333](https://github.com/Scan-Documents/node-sdk/commit/008c333df360441c300d039d0f8d7c71697d2f4e)) + ## 0.1.0-alpha.19 (2026-01-08) Full Changelog: [v0.1.0-alpha.18...v0.1.0-alpha.19](https://github.com/Scan-Documents/node-sdk/compare/v0.1.0-alpha.18...v0.1.0-alpha.19) diff --git a/package.json b/package.json index f3669c3..5460b6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scan-documents", - "version": "0.1.0-alpha.19", + "version": "0.1.0-alpha.20", "description": "The official TypeScript library for the Scan Documents API", "author": "Scan Documents ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json index 1a0f12c..28b3fe5 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -1,6 +1,6 @@ { "name": "scan-documents-mcp", - "version": "0.1.0-alpha.19", + "version": "0.1.0-alpha.20", "description": "The official MCP Server for the Scan Documents API", "author": "Scan Documents ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts index 4ed82d9..8ce76e9 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -21,7 +21,7 @@ export const newMcpServer = () => new McpServer( { name: 'scan_documents_api', - version: '0.1.0-alpha.19', + version: '0.1.0-alpha.20', }, { capabilities: { tools: {}, logging: {} } }, ); diff --git a/src/version.ts b/src/version.ts index 807be51..48ca0ae 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.1.0-alpha.19'; // x-release-please-version +export const VERSION = '0.1.0-alpha.20'; // x-release-please-version