Skip to content

Commit dddad93

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

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 'writer-sdk';
2323

2424
const prompt = `Runs JavaScript code to interact with the Writer 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
@@ -39,7 +39,9 @@ You will be returned anything that your function returns, plus the results of an
3939
Do not add try-catch blocks for single API calls. The tool will handle errors for you.
4040
Do not add comments unless necessary for generating better code.
4141
Code will run in a container, and cannot interact with the network outside of the given SDK client.
42-
Variables will not persist between calls, so make sure to return or log any data you might need later.`;
42+
Variables will not persist between calls, so make sure to return or log any data you might need later.
43+
Remember that you are writing TypeScript code, so you need to be careful with your types.
44+
Always type dynamic key-value stores explicitly as Record<string, YourValueType> instead of {}.`;
4345

4446
/**
4547
* A tool that runs code against a copy of the SDK.

0 commit comments

Comments
 (0)