MCPcopy Index your code
hub / github.com/Effect-TS/effect / getDescriptionFromSchemaAst

Function getDescriptionFromSchemaAst

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

Source from the content-addressed store, hash-verified

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

Callers 1

getDescriptionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected