ObjectStackObjectStack

Tool schema — AI Protocol property reference

Tool schemas of the ObjectStack AI Protocol: Tool — each property with its type, default and a TypeScript example.

Source: packages/spec/src/ai/tool.zod.ts

TypeScript Usage

import { ToolSchema } from '@objectstack/spec/ai';
import type { Tool } from '@objectstack/spec/ai';

// Validate data
const result = ToolSchema.parse(data);

Tool

AI tool definition. [READ-ONLY PROJECTION — not an execution entry point] Authoring a tool as metadata does NOT make it runnable: this schema has no implementation/handler field and no framework executor loads a metadata-authored tool. The runtime executes a separately-registered AIToolDefinition (cloud @objectstack/service-ai); tool metadata is a one-way projection for Studio/discovery. Do not expect a hand-authored tool to run in the open edition.

Properties

PropertyTypeRequiredDescription
namestring✅Tool unique identifier (snake_case)
labelstring✅Tool display name
descriptionstring✅Tool description for LLM function calling
parametersRecord<string, any>✅JSON Schema for tool parameters
outputSchemaRecord<string, any>optional[EXPERIMENTAL — not enforced] JSON Schema for tool output; nothing reads it on a tool record — declare it as ai.outputSchema on the action, where the cloud AI runtime validates the action result against it.
objectNamestringoptionalTarget object name (snake_case)
protection{ lock: Enum<'none' | 'no-overlay' | 'no-delete' | 'full'>; reason: string; docsUrl?: string }optionalPackage author protection block — lock policy for this tool.
_lockEnum<'none' | 'no-overlay' | 'no-delete' | 'full'>optionalItem-level lock — controls overlay & delete (ADR-0010).
_lockReasonstringoptionalHuman-readable reason shown when a write is refused by _lock.
_lockSourceEnum<'artifact' | 'package' | 'env-forced'>optionalLayer that set _lock (artifact | package | env-forced).
_provenanceEnum<'package' | 'org' | 'env-forced'>optionalOrigin of the item (package | org | env-forced).
_packageIdstringoptionalOwning package machine id.
_packageVersionstringoptionalOwning package version.
_lockDocsUrlstringoptionalOptional documentation link surfaced next to _lockReason.

Nested Shape: Tool.protection

PropertyTypeRequiredDescription
lockEnum<'none' | 'no-overlay' | 'no-delete' | 'full'>✅Lock policy — none | no-overlay | no-delete | full.
reasonstring✅User-visible reason shown when the lock blocks an action.
docsUrlstringoptionalOptional URL the Studio banner links to for more context.

On this page