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

Function getDescription

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

Source from the content-addressed store, hash-verified

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

Callers 2

makeLazyFunction · 0.85
Arbitrary.tsFile · 0.85

Calls 1

Tested by

no test coverage detected