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

Function getDescription

packages/ai/ai/src/Tool.ts:1226–1244  ·  view source on GitHub ↗
(
  /**
   * The tool to get the description from.
   */
  tool: Tool<Name, Config>
)

Source from the content-addressed store, hash-verified

1224 * @category Utilities
1225 */
1226export const getDescription = <
1227 Name extends string,
1228 Config extends {
1229 readonly parameters: AnyParametersSchema
1230 readonly success: Schema.Schema.Any
1231 readonly failure: Schema.Schema.All
1232 readonly failureMode: FailureMode
1233 }
1234>(
1235 /**
1236 * The tool to get the description from.
1237 */
1238 tool: Tool<Name, Config>
1239): string | undefined => {
1240 if (Predicate.isNotUndefined(tool.description)) {
1241 return tool.description
1242 }
1243 return getDescriptionFromSchemaAst(tool.parametersSchema.ast)
1244}
1245
1246/**
1247 * @since 1.0.0

Callers 2

makeLazyFunction · 0.85
Arbitrary.tsFile · 0.85

Calls 1

Tested by

no test coverage detected