Function: withNotes()
withNotes<
T>(__namedParameters):ResultWithNotes<T>
Defined in: tool.ts:310
Wraps a defineTool method's data with notes: each non-empty note becomes
its own text block after the data's JSON. structuredContent stays the
data alone, so an outputSchema describes the data, never the notes.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
__namedParameters | { data: T; notes: string[]; } |
__namedParameters.data | T |
__namedParameters.notes | string[] |
Returns
Example
method: async (args) => {
const report = await buildReport(args);
return withNotes({
data: report,
notes: report.partial ? ['Only the last 7 days are available.'] : [],
});
},