(opts: {
message: string;
brief: string;
output?: string | ContentPart | ContentPart[];
})
| 66 | } |
| 67 | |
| 68 | export function toolError(opts: { |
| 69 | message: string; |
| 70 | brief: string; |
| 71 | output?: string | ContentPart | ContentPart[]; |
| 72 | }): ToolReturnValue { |
| 73 | return { |
| 74 | isError: true, |
| 75 | output: opts.output !== undefined ? normalizeOutput(opts.output) : '', |
| 76 | message: opts.message, |
| 77 | display: [{ type: 'brief', text: opts.brief }], |
| 78 | }; |
| 79 | } |
| 80 | |
| 81 | export function toolNotFoundError(toolName: string): ToolReturnValue { |
| 82 | const message = `Tool \`${toolName}\` not found`; |
no test coverage detected