MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / toolError

Function toolError

packages/kosong/test/fixtures/simple-toolset.ts:68–79  ·  view source on GitHub ↗
(opts: {
  message: string;
  brief: string;
  output?: string | ContentPart | ContentPart[];
})

Source from the content-addressed store, hash-verified

66}
67
68export 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
81export function toolNotFoundError(toolName: string): ToolReturnValue {
82 const message = `Tool \`${toolName}\` not found`;

Callers 1

typed-tool.test.tsFile · 0.90

Calls 1

normalizeOutputFunction · 0.85

Tested by

no test coverage detected