Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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
Expand All @@ -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,
},
});
Expand Down
2 changes: 1 addition & 1 deletion examples/ai-sdk-integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const aiSdkIntegration = async (): Promise<void> => {
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<string, unknown>).args)}`);
console.log(` Arguments: ${JSON.stringify(toolCall.input)}`);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/anthropic-integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const anthropicIntegration = async (): Promise<void> => {

// 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: [
Expand Down
6 changes: 4 additions & 2 deletions examples/claude-agent-sdk-integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const claudeAgentSdkIntegration = async (): Promise<void> => {
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');

Expand All @@ -45,6 +45,8 @@ const claudeAgentSdkIntegration = async (): Promise<void> => {
},
// 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'],
Comment thread
glebedel marked this conversation as resolved.
Resolved
maxTurns: 3,
},
});
Expand Down
Loading