omit falsy global function metadata
Signed-off-by: Matt Benson <gudnabrsam@gmail.com>
This commit is contained in:
@@ -197,10 +197,15 @@ export function extractGlobalFunctionMetadata(
|
||||
|
||||
for (const global of globals) {
|
||||
if (isGlobalFunction(global)) {
|
||||
const metadata: any = {
|
||||
description: global.description,
|
||||
examples: global.examples,
|
||||
};
|
||||
const metadata: any = {};
|
||||
|
||||
if (global.description) {
|
||||
metadata.description = global.description;
|
||||
}
|
||||
|
||||
if (global.examples) {
|
||||
metadata.examples = global.examples;
|
||||
}
|
||||
|
||||
if (global.schema) {
|
||||
metadata.schema = convertZodFunctionToJsonSchema(global.schema(z));
|
||||
|
||||
Reference in New Issue
Block a user