MCPcopy
hub / github.com/Effect-TS/effect / ToolCallPart

Function ToolCallPart

packages/ai/ai/src/Response.ts:1475–1496  ·  view source on GitHub ↗
(
  /**
   * Name of the tool.
   */
  name: Name,
  /**
   * Schema for the tool parameters.
   */
  params: Params
)

Source from the content-addressed store, hash-verified

1473 * @category Schemas
1474 */
1475export const ToolCallPart = <const Name extends string, Params extends Tool.AnyParametersSchema>(
1476 /**
1477 * Name of the tool.
1478 */
1479 name: Name,
1480 /**
1481 * Schema for the tool parameters.
1482 */
1483 params: Params
1484): Schema.Schema<ToolCallPart<Name, Schema.Schema.Type<Params>>, ToolCallPartEncoded> =>
1485 Schema.Struct({
1486 type: Schema.Literal("tool-call"),
1487 id: Schema.String,
1488 name: Schema.Literal(name),
1489 params,
1490 providerName: Schema.optional(Schema.String),
1491 providerExecuted: Schema.optionalWith(Schema.Boolean, { default: constFalse }),
1492 metadata: Schema.optionalWith(ProviderMetadata, { default: constEmptyObject })
1493 }).pipe(
1494 Schema.attachPropertySignature(PartTypeId, PartTypeId),
1495 Schema.annotations({ identifier: "ToolCallPart" })
1496 ) as any
1497
1498/**
1499 * Constructs a new tool call part.

Callers 3

AllPartsFunction · 0.70
PartFunction · 0.70
StreamPartFunction · 0.70

Calls 2

pipeMethod · 0.65
annotationsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…