Skip to content

Commit 682fded

Browse files
committed
Do code execution instead
1 parent bcf8c4a commit 682fded

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -614,12 +614,12 @@ const client = new Anthropic({
614614

615615
Beta API features are generally available inside the beta property of the client. To enable a particular beta feature, you need to add the appropriate beta header to the betas field when creating a message.
616616

617-
For example, to add an MCP server:
617+
For example, to use code execution:
618618
```ts
619619
import Anthropic from 'npm:@anthropic-ai/sdk';
620620

621621
const client = new Anthropic();
622-
const response = await this.client.beta.messages.create({
622+
const response = await client.beta.messages.create({
623623
max_tokens: 1024,
624624
model: "claude-sonnet-4-20250514",
625625
messages: [
@@ -628,20 +628,17 @@ const response = await this.client.beta.messages.create({
628628
content: [
629629
{
630630
type: "text",
631-
text: "Explain the latest PR in the anthropics/anthropic-sdk-typescript repo.",
631+
text: "What's 4242424242 * 4242424242?.",
632632
}
633633
]
634634
}
635635
],
636-
mcp_servers: [
636+
tools: [
637637
{
638-
name: "github",
639-
type: "url",
640-
url: "https://api.githubcopilot.com/mcp/",
641-
authorization_token: process.env.GITHUB_PERSONAL_ACCESS_TOKEN!,
642-
},
643-
],
644-
betas: ["mcp-client-2025-04-04"]
638+
"name": "code_execution",
639+
"type": "code_execution_20250522"
640+
}],
641+
betas: ["code-execution-2025-05-22"]
645642
})
646643
```
647644

0 commit comments

Comments
 (0)