Tulip Logo IconTulip
Reference

Types

Important public types for agents, tools, chat parts, MCP content, and client renderers.

Agent types

Important types are exported from @tulip-systems/ai/agents/server:

  • AgentCallOptions: what Agents and Chat pass with every call: the toolCall, and in a chat the page context
  • DefineAgentOptions: the options of defineAgent(): ToolLoopAgent settings with name, title, tools, output, identity and maxSteps, without prepareCall, toolApproval, stopWhen, toolsContext and callOptionsSchema
  • TulipAgent: an agent made with defineAgent(), with its Tulip fields (TulipAgentInfo) under tulip
  • AgentIdentity: the grants and approvers of an agent that runs as itself

defineAgent() returns an AI SDK ToolLoopAgent. Agents only takes agents made with defineAgent().

Tool types

Important server-side tool types:

  • ToolBase: the options of toolBuilder(): authorize, verifyProof and context
  • ToolDefinition: what tool() takes, with permission and context typed by the base
  • TulipToolDefinition: a tool made with tool(): its definition with the base it follows
  • ToolCaller: who calls a tool and through what (principal, trigger, run), as the base's context gets it
  • ToolCall: what a service passes to the tools it runs: the caller, an agent's grants, authorizeCapability and resolveApproval
  • ToolKind, ToolConfirmation, ToolProofMethod, ToolPermission
  • TulipToolMetadata: the { kind, confirmation } a Tulip tool sends with its tool parts
  • AiProofInput: what verifyProof receives

Chat types

Exported from @tulip-systems/ai/chat/client:

  • ChatPart
  • ToolChatPart: a tool part, the AI SDK's ToolUIPart | DynamicToolUIPart, with the tool's title and its toolMetadata ({ tulip: { kind, confirmation } } for Tulip tools). Use the AI SDK's isToolUIPart and getToolName on it, and getTulipToolMetadata for the Tulip fields.
  • ToolRenderer: a tool's own card: { toolName, render(part) }
  • ToolApprovalChoice: an approve button: { value: "once" | "chat", label }
  • ChatThreadLabels: the texts of a thread (tool, reasoning, sources, activity), with ToolCallCardLabels, ToolApprovalLabels and ChatReasoningLabels
  • ChatComposerLabels: attach, send, stop and wait
  • UseAssistantChatOptions

These are useful when custom-rendering tool parts or building higher-level chat components.

Shared types

@tulip-systems/ai/types exports the types server and client share: the service types below, the tool types ToolKind, ToolConfirmation and ToolProofMethod, and AgentContextValue (the page context). Client code imports them from there, since the service entries are server-only.

Service types

Exported from @tulip-systems/ai/tools/server, agents/server, chat/server and mcp/server, each with its service, and all of them from @tulip-systems/ai/types:

  • AgentsConfig, ChatConfig, McpConfig: the options of Agents.init, Chat.init and Mcp.init (ChatConfig and McpConfig from their server entry only)
  • AiAgentsDatabase, AiChatDatabase, AiMcpDatabase: the database each service stores its data in
  • AiUser: a user the tools act for
  • AiPrincipal: whose permissions a run uses: { type: "user", user } or { type: "agent", agent, title }
  • AiTrigger: what started a run: chat, mcp, action, event or schedule
  • AiRun, AiRunStatus, AiRunReference, AiRunFilters: a run, its status, the run as tools see it, and the filters of agents.runs.list
  • AiRunInput, AiRunResult, AiAgentOutput: the input of agents.run, agents.stream and agents.start, the result of agents.run, and an agent's typed output
  • AiApproval, AiApprovalDetails, AiApprovalStatus, AiApprovalDecision, AiApprovalFilters: approvals outside the chat; AiApprovalDetails adds agentTitle and toolTitle
  • AiAgentInfo, AiAgentStatus, AiAgentTool, AiAgentState: agents as admins see them, and their stored state
  • AiChat, AiMcpAppSettings: a saved chat, and an MCP app's settings for a user
  • AiChatRequest, AiApprovalAnswer: what the client sends for one chat turn (chatId, a message or approvals, and the page context), and one answer to an approval
  • AiChatSendInput: the input of chat.send(): the request with the user, agent and abortSignal
  • AiChatEvent: what the onEvent of Chat.init receives
  • AgentsLabels: the reasons the chat shows for calls the workspace's setting decided
  • AgentPolicy, PolicyTarget: "allow", "ask" or "deny", for an "agent" or an "mcp" app

Exported from @tulip-systems/ai/drizzle:

  • AiAgentsDrizzleSchema, AiChatDrizzleSchema, AiMcpDrizzleSchema: the tables each adapter takes
  • AiChatsDrizzleTable, AiMessagesDrizzleTable, AiMcpAppSettingsDrizzleTable, AiRunsDrizzleTable, AiApprovalsDrizzleTable, AiAgentStatesDrizzleTable: the columns each table must have

MCP types

MCP types describe content blocks returned by helpers such as text(), json(), resource(), and table().

Guidance

  • Prefer exported package types over internal source paths.
  • Import shared types in client code from @tulip-systems/ai/types.
  • Keep app-specific schemas in the app; only generic AI abstractions belong in the package.

On this page