Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

DuplicateToolNameError.md

57 lines1.3 KB

1---
2id: DuplicateToolNameError
3title: DuplicateToolNameError
4---
5​
6Defined in: [packages/ai/src/activities/chat/tools/unique-tool-names.ts:11](https://github.com/TanStack/ai/blob/main/packages/ai/src/activities/chat/tools/unique-tool-names.ts#L11)
7​
8Thrown when `chat({ tools })` (or a provider converter) receives two tools
9with the same public `name`.
10​
11The common case is a provider-native factory (`webSearchTool()`) next to an
12ordinary function that reused the reserved name (`web_search`). Providers
13reject that pair, so we fail before the request is built.
14​
15## Extends
16​
17- `Error`
18​
19## Constructors
20​
21### Constructor
22​
23```ts
24new DuplicateToolNameError(toolName, message): DuplicateToolNameError;
25```
26​
27Defined in: [packages/ai/src/activities/chat/tools/unique-tool-names.ts:14](https://github.com/TanStack/ai/blob/main/packages/ai/src/activities/chat/tools/unique-tool-names.ts#L14)
28​
29#### Parameters
30​
31##### toolName
32​
33`string`
34​
35##### message
36​
37`string`
38​
39#### Returns
40​
41`DuplicateToolNameError`
42​
43#### Overrides
44​
45```ts
46Error.constructor
47```
48​
49## Properties
50​
51### toolName
52​
53```ts
54readonly toolName: string;
55```
56​
57Defined in: [packages/ai/src/activities/chat/tools/unique-tool-names.ts:12](https://github.com/TanStack/ai/blob/main/packages/ai/src/activities/chat/tools/unique-tool-names.ts#L12)