MCPcopy Create free account
hub / github.com/TanStack/ai / codeExecutionTool

Function codeExecutionTool

packages/ai-anthropic/src/tools/code-execution-tool.ts:72–96  ·  view source on GitHub ↗
(
  config: CodeExecutionToolConfig,
  options: CodeExecutionToolOptions = {},
)

Source from the content-addressed store, hash-verified

70}
71
72export function codeExecutionTool(
73 config: CodeExecutionToolConfig,
74 options: CodeExecutionToolOptions = {},
75): AnthropicCodeExecutionTool {
76 const { skills } = options
77 if (skills) {
78 if (skills.length > 8) {
79 throw new Error('code_execution supports at most 8 skills per request.')
80 }
81 for (const skill of skills) {
82 if (skill.skill_id.length < 1 || skill.skill_id.length > 64) {
83 throw new Error('skill_id must be between 1 and 64 characters.')
84 }
85 }
86 }
87 const metadata: CodeExecutionToolMetadata = {
88 config,
89 ...(skills && { skills }),
90 }
91 return brandProviderTool<AnthropicCodeExecutionTool>({
92 name: 'code_execution',
93 description: '',
94 metadata,
95 })
96}

Calls 1

brandProviderToolFunction · 0.90

Tested by

no test coverage detected