Skip to content

Commit 3f2a450

Browse files
fix(mcp): update prompt
updates the agent prompt to prevent a common TypeScript error when accessing object keys
1 parent 16e3e6a commit 3f2a450

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { ClientOptions } from 'scan-documents';
2323

2424
const prompt = `Runs JavaScript code to interact with the Scan Documents API.
2525
26-
You are a skilled programmer writing code to interface with the service.
26+
You are a skilled TypeScript programmer writing code to interface with the service.
2727
Define an async function named "run" that takes a single parameter of an initialized SDK client and it will be run.
2828
For example:
2929
@@ -37,7 +37,9 @@ You will be returned anything that your function returns, plus the results of an
3737
Do not add try-catch blocks for single API calls. The tool will handle errors for you.
3838
Do not add comments unless necessary for generating better code.
3939
Code will run in a container, and cannot interact with the network outside of the given SDK client.
40-
Variables will not persist between calls, so make sure to return or log any data you might need later.`;
40+
Variables will not persist between calls, so make sure to return or log any data you might need later.
41+
Remember that you are writing TypeScript code, so you need to be careful with your types.
42+
Always type dynamic key-value stores explicitly as Record<string, YourValueType> instead of {}.`;
4143

4244
/**
4345
* A tool that runs code against a copy of the SDK.

0 commit comments

Comments
 (0)