Skip to content

Graphorin API reference v0.7.0


Graphorin API reference / @graphorin/core / / ToolDefinition

Interface: ToolDefinition

Defined in: packages/core/src/contracts/provider.ts:238

Tool description shipped with a provider request. Implementations convert the user's Zod schema to a JSON Schema 7 fragment.

Stable

Properties

PropertyModifierTypeDescriptionDefined in
description?readonlystring-packages/core/src/contracts/provider.ts:240
examples?readonlyreadonly ToolDefinitionExample[]Worked examples surfaced to the provider alongside the schema. The agent runtime populates this from the tool's examples when they are eagerly rendered (see Tool.examplesEagerlyRendered); it is bounded to ≤5 and absent when the tool declares none or defers them. Implementations MAY fold these into the model-facing tool description.packages/core/src/contracts/provider.ts:256
inputSchemareadonlyReadonly<Record&lt;string, unknown&gt;>-packages/core/src/contracts/provider.ts:241
namereadonlystring-packages/core/src/contracts/provider.ts:239
outputSchema?readonlyReadonly<Record&lt;string, unknown&gt;>A5: the tool's output schema (JSON Schema), when declared. The agent runtime populates it from Tool.outputSchema; structured-output providers and typed code-mode use it to validate / type the tool's result. Absent when the tool declares no output schema.packages/core/src/contracts/provider.ts:248