diff --git a/README.md b/README.md index f3e7cca6..db403f20 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ const tools = await toolset.fetchTools(); const anthropic = new Anthropic(); await anthropic.messages.create({ - model: 'claude-haiku-4-5-20241022', + model: 'claude-haiku-4-5-20251001', max_tokens: 1024, system: 'You are a helpful HR assistant.', messages: [ @@ -270,7 +270,8 @@ import { StackOneToolSet } from '@stackone/ai'; const toolset = new StackOneToolSet({ accountId: process.env.STACKONE_ACCOUNT_ID || undefined }); // Fetch tools and convert to Claude Agent SDK format -const tools = await toolset.fetchTools(); +// Only the read actions the agent needs: allowedTools below runs them without asking +const tools = await toolset.fetchTools({ actions: ['*_list_*'] }); const mcpServer = await tools.toClaudeAgentSdk(); // Use with Claude Agent SDK query @@ -280,6 +281,7 @@ const result = query({ model: 'claude-sonnet-4-5-20250929', mcpServers: { 'stackone-tools': mcpServer }, tools: [], // Disable built-in tools + allowedTools: ['mcp__stackone-tools'], // Run the StackOne tools without a permission prompt maxTurns: 3, }, }); diff --git a/examples/ai-sdk-integration.ts b/examples/ai-sdk-integration.ts index be312b07..b00f31b0 100644 --- a/examples/ai-sdk-integration.ts +++ b/examples/ai-sdk-integration.ts @@ -57,7 +57,7 @@ const aiSdkIntegration = async (): Promise => { if (step.toolCalls.length > 0) { for (const toolCall of step.toolCalls) { console.log(` Tool call: ${toolCall.toolName}`); - console.log(` Arguments: ${JSON.stringify((toolCall as Record).args)}`); + console.log(` Arguments: ${JSON.stringify(toolCall.input)}`); } } } diff --git a/examples/anthropic-integration.ts b/examples/anthropic-integration.ts index 61762159..84fbdf89 100644 --- a/examples/anthropic-integration.ts +++ b/examples/anthropic-integration.ts @@ -34,7 +34,7 @@ const anthropicIntegration = async (): Promise => { // Create a message with tool calls const response = await anthropic.messages.create({ - model: 'claude-haiku-4-5-20241022', + model: 'claude-haiku-4-5-20251001', max_tokens: 1024, system: 'You are a helpful assistant that can access tools.', messages: [ diff --git a/examples/claude-agent-sdk-integration.ts b/examples/claude-agent-sdk-integration.ts index 28d13d97..1ee48be5 100644 --- a/examples/claude-agent-sdk-integration.ts +++ b/examples/claude-agent-sdk-integration.ts @@ -28,8 +28,8 @@ const claudeAgentSdkIntegration = async (): Promise => { const accountId = process.env.STACKONE_ACCOUNT_ID; const toolset = new StackOneToolSet({ accountId: accountId === '' ? undefined : accountId }); - // Fetch tools from StackOne and convert to Claude Agent SDK format - const tools = await toolset.fetchTools(); + // Fetch only the read actions the agent needs, since allowedTools below runs them without asking + const tools = await toolset.fetchTools({ actions: ['*_list_*'] }); const mcpServer = await tools.toClaudeAgentSdk(); console.log('Claude Agent SDK MCP server created'); @@ -45,6 +45,8 @@ const claudeAgentSdkIntegration = async (): Promise => { }, // Disable built-in tools, only use our custom tools tools: [], + // Run the StackOne tools without a permission prompt, which a headless query cannot answer + allowedTools: ['mcp__stackone-tools'], maxTurns: 3, }, });