Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
A single condition that, when met, halts the server-tool agent loop.

Supported Types

models.StopServerToolsWhenFinishReasonIs

const value: models.StopServerToolsWhenFinishReasonIs = {
  reason: "<value>",
  type: "finish_reason_is",
};

models.StopServerToolsWhenHasToolCall

const value: models.StopServerToolsWhenHasToolCall = {
  toolName: "<value>",
  type: "has_tool_call",
};

models.StopServerToolsWhenMaxCost

const value: models.StopServerToolsWhenMaxCost = {
  maxCostInDollars: 1543.31,
  type: "max_cost",
};

models.StopServerToolsWhenMaxTokensUsed

const value: models.StopServerToolsWhenMaxTokensUsed = {
  maxTokens: 577706,
  type: "max_tokens_used",
};

models.StopServerToolsWhenStepCountIs

const value: models.StopServerToolsWhenStepCountIs = {
  stepCount: 5,
  type: "step_count_is",
};