MCPcopy Create free account
hub / github.com/Effect-TS/effect / getDescriptionFromSchemaAst

Function getDescriptionFromSchemaAst

packages/ai/ai/src/Tool.ts:1250–1262  ·  view source on GitHub ↗
(
  ast: AST.AST
)

Source from the content-addressed store, hash-verified

1248 * @category Utilities
1249 */
1250export const getDescriptionFromSchemaAst = (
1251 ast: AST.AST
1252): string | undefined => {
1253 const annotations = ast._tag === "Transformation"
1254 ? {
1255 ...ast.to.annotations,
1256 ...ast.annotations
1257 }
1258 : ast.annotations
1259 return AST.DescriptionAnnotationId in annotations
1260 ? (annotations[AST.DescriptionAnnotationId] as string)
1261 : undefined
1262}
1263
1264/**
1265 * Generates a JSON Schema for a tool.

Callers 1

getDescriptionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected