@orangecheck/agent-vercel / ocTool
Function: ocTool()
function ocTool<TArgs, TResult>(input: OcToolInput<TArgs, TResult>): OcToolWrapped<TArgs, TResult>;
Defined in: index.ts:199
Wrap a tool() definition so its execute path is scope-checked and envelope-emitting. The exact glue depends on which AI-SDK release you're on — the typical pattern is:
const tools = { 'invoice.create': tool({ description: '…', parameters: schema, execute: async (args, { toolCallId }) => { const { result, action } = await invoiceCreate.execute(args, { agent, delegation, callId: toolCallId, }); await yourAuditPipeline.append(action); return result; }, }), };
const invoiceCreate = ocTool({ verb: 'invoice.create', parameters: schema, execute: async (args) => myInvoiceCreateImpl(args), });
The ocTool value is provider/SDK-agnostic — bring your own glue around
it. v1 of the adapter intentionally does not import ai so it works on
any release.
Type Parameters
| Type Parameter |
|---|
TArgs extends Record<string, unknown> |
TResult |
Parameters
| Parameter | Type |
|---|---|
input | OcToolInput<TArgs, TResult> |
Returns
OcToolWrapped<TArgs, TResult>