Appearance
Function: fromToolDescriptors()
ts
function fromToolDescriptors(descriptors: readonly ToolDescriptor<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>[], options?: FromToolDescriptorsOptions): ChatTools;Defined in: packages/sdk/src/renderer/templates/tool-adapter.ts:44
Experimental
Bridge framework-neutral ToolDescriptors (from @matterway/pdf-tools/tools, @matterway/excel-tools/tools, …) into the chat template's ChatTools map.
Results flow through the same tool() normalizer as hand-written chat tools, so the model phrases bare return values naturally. Descriptors marked destructive: true get a default confirm gate — the user approves each call. Wrap individual entries afterwards to customize.
Parameters
| Parameter | Type | Description |
|---|---|---|
descriptors | readonly ToolDescriptor<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>[] | The descriptors to expose to the model. |
options? | FromToolDescriptorsOptions | Optional execution limits (e.g. allowed roots). |
Returns
A ChatTools map keyed by descriptor name.
Example
ts
import {tools as pdfTools} from '@matterway/pdf-tools/tools';
await chat(ctx, {
tools: fromToolDescriptors(pdfTools, {roots: ['/data/skill']}),
});