Skip to content

@camera.ui/sdk / plugin / AssistantToolSpec

Interface: AssistantToolSpec ​

Defined in: plugin/assistant.ts:48

One tool a plugin offers to the assistant. The host prefixes name with the plugin name, so names only have to be unique within the plugin.

Example ​

ts
const queryEvents = defineAssistantTool({
  name: 'query_events',
  description: 'List recorded events for a time range, optionally filtered by camera and label.',
  inputSchema: {
    type: 'object',
    properties: {
      from: { type: 'string', format: 'date-time', description: 'Start of the range, ISO 8601' },
      to: { type: 'string', format: 'date-time', description: 'End of the range, ISO 8601' },
      camera: { type: 'string', description: 'Camera name, all cameras when omitted' },
    },
    required: ['from', 'to'],
  },
});

Properties ​

adminOnly? ​

optional adminOnly?: boolean

Defined in: plugin/assistant.ts:58

Hidden from users without the admin role.


approval? ​

optional approval?: boolean

Defined in: plugin/assistant.ts:56

The user confirms every call before it runs. Set it on anything that changes state.


description ​

description: string

Defined in: plugin/assistant.ts:52

What the tool does and when to use it, written for the model. One or two sentences, name units and defaults.


inputSchema ​

inputSchema: AssistantToolSchema

Defined in: plugin/assistant.ts:54

Object schema of the arguments (see AssistantToolSchema).


lazy? ​

optional lazy?: boolean

Defined in: plugin/assistant.ts:62

Offered through tool discovery instead of on every turn. Use for rarely needed tools.


name ​

name: string

Defined in: plugin/assistant.ts:50

Tool name in snake_case, unique within the plugin.


timeoutMs? ​

optional timeoutMs?: number

Defined in: plugin/assistant.ts:60

Time the host waits for callAssistantTool, in milliseconds. Default 60000.